You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Wellie W. Chao" <wc...@caraveltech.com> on 2002/04/02 18:37:11 UTC

Bug in html:errors and html:messages? Problem with printing errors.

I am having some weird problems with the html:errors and html:messages tags
in struts-html from the 1.1-b1 version. I am certain the Request object has
an attribute named "org.apache.struts.action.ERROR" because I have printed
out all attributes in the Request object on the page footer. Also, the
"org.apache.struts.action.ERROR" object (an instance of ActionErrors) has
two ActionError instances: one that maps to
error.registerForm.username.required and another that maps to
error.registerForm.email.required. Both are present in the
ApplicationResources.properties file, which is stored under WEB-INF.

When I insert <html:errors/> in my JSP page, nothing prints out. I also
tried replacing html:errors with the following tags:

<html:messages id="errorMsg">
  <li><bean:write name="errorMsg"/></li>
</html:messages>

When I do this, I get a NullPointerException with the following stack trace:

2002-04-02 11:22:14,817 ERROR
[org.jboss.web.catalina.EmbeddedCatalinaServiceSX]
ApplicationDispatcher[/rmjobs] Servlet.service() for servlet jsp threw
exception
java.lang.NullPointerException
        at java.util.Hashtable.put(Hashtable.java:386)
        at
org.apache.jasper.runtime.PageContextImpl.setAttribute(PageContextImpl.java:
229)
        at
org.apache.struts.taglib.html.MessagesTag.doStartTag(MessagesTag.java:253)
        at
org.apache.jsp.registerForm$jsp._jspService(registerForm$jsp.java:68)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:202)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:683)
        at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatch
er.java:574)
        at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher
.java:497)
        at
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:8
20)
        at
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:391)
        at
org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.ja
va:757)
        at
org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:369)
        at
org.apache.jsp.guestLayout$jsp._jspService(guestLayout$jsp.java:253)
        at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.ja
va:202)
        at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:382)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:474)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.
java:683)
        at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatch
er.java:431)
        at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher
.java:355)
        at
org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcesso
r.java:181)
        at
org.apache.struts.action.RequestProcessor.processValidate(RequestProcessor.j
ava:947)
        at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:245)
        at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1109)
        at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:452)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        ... Lots more stack trace after this ...

I have the taglib definitions at the top of the JSP page like so:
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>

Does anyone know if Struts has a bug in the 1.1-b1 version, or whether I'm
doing something wrong?


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>