History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: WW-639
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: keron
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
WebWork

"Could not open template ", possible a bug

Created: 14/Sep/04 11:46 AM   Updated: 15/Oct/04 01:09 AM
Component/s: None
Affects Version/s: None
Fix Version/s: 2.1.2

Environment: Windows XP Sp2 Tomcat 5.27 JDK1.4.2.05


 Description  « Hide
In my application, I had 2 versions of a login.jsp(both quite simple)
one is:

//////////////////////////////////////////////////////
<%@ taglib prefix="ww" uri="webwork"%>
<html>
<style type="text/css">
.errorMessage {
color: red;
}
</style>
<body>
<ww:if test="hasFieldErrors()">
<span class="errorMessage">
<b>Errors:</b><br>
<ww:iterator value="fieldErrors">
<li><ww:property/></li>
</ww:iterator>
</span>
</ww:if>

<form action="/login.action">

<p align="center">
Login<br>
<ww:if test="message != null">
<font color="red">
<ww:property value="message"/>
</font>
</ww:if>

<ww:if test="errorMessage != null">
<font color="red">
<ww:property value="errorMessage"/>
</font>
</ww:if>

</p>

username:
<input type="text" name="model.username" />
<br>

password
<input type="password" name="model.password" />
<br>

<p align="center">
<input type="submit" value="submit" name="B1"/>
</p>

</form>
</body>
</html>
////////////////////////////////////////////////////////

this one works well.
then I try to updated it with ui tags, as:

///////////////////////////////////////////////////////

<%@ taglib prefix="ww" uri="webwork"%>
<html>
<style type="text/css">
.errorMessage {
color: red;
}
</style>
<body>

<ww:form name="'login'" action="'/login.action'" method="'post'">
<p align="center">
Login<br>
<ww:if test="message != null">
<font color="red">
<ww:property value="message"/>
</font>
</ww:if>

<ww:if test="errorMessage != null">
<font color="red">
<ww:property value="errorMessage"/>
</font>
</ww:if>

</p>


<ww:textfield label="'username'" name="'model.username'" />
<br>


<ww:textfield label="'password'" name="'model.password'" />
<br>

<p align="center">
<ww:submit value="'submit"/>
</p>

</ww:form>

</body>
</html>
//////////////////////////////////////////////////////////////////

this one failed.

if I restart tomcat, and access the first one . then goto the second one.

all seemed quite good, the second page can work.


but if I access the second page directly after restart tomcat.
then we will see:

Fatal exception caught in com.opensymphony.webwork.views.jsp.ui.TextFieldTag tag class, doEndTag: null

I am quite confused, it seemed the second one need the first one
to do some pre-work, is it?

I had upload my Application as a rar file to my website.
http://www.xiaxin.net/ROOT.rar

Thanks for any comment for this issue.





 All   Comments   Change History      Sort Order:
keron - [14/Sep/04 12:49 PM ]
After 1 hour's code tracing, I found the answer.
The DispatcherServlet initialize the velocitymanager in init() method.

when the first jsp post request,the DispathcherServlet will be
initialized.

If a page with ui tag be accessed fist restart after tomcat .
the velocitymanager had not been initialed.
So when build the jsp page,we will get a NullPointException.

simple solution.
add a <load-on-startup>1</load-on-startup> to DispatcherServlet
configuration.

Suggest the webwork team to add this item in example web.xml.

Issue closed.




Patrick Lightbody - [15/Oct/04 01:09 AM ]
This should be fixed in 2.1.2