You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by lixin chu <li...@yahoo.com> on 2004/09/06 16:25:36 UTC
Struts messages are not displayed in JSP
Hi,
I gies a strange problem, the messages are not
displayed. here is the code in my Action:
----
messages.add(ActionMessages.GLOBAL_MESSAGE, new
ActionMessage ("templates List error"));
saveMessages (request, messages);
----
In JSP:
----
<font color="blue" size=2>
<logic:messagesPresent message="true">
<html:messages id="messages" message="true">
<li><c:out value="${messages}"/></li>
</html:messages><br>
</logic:messagesPresent>
</font>
----
however, the messages are not displayed when the code
is indeed executed.
Instead, I saw error in log file:
----
javax.servlet.jsp.JspException: ServletException in
'/WEB-INF/tiles/DisplayTemplate.jsp': Cannot find bean
messages in any scope
......
----
I thought the 'messgaes' is already in request scope.
And more strange, I also find the error message in log
file:
----
2004-09-06 22:12:50
org.apache.catalina.core.StandardHostValve@d76d51:
Exception Processing ErrorPage[errorCode=404,
location=/WEB-INF/pages/404.jsp]
ClientAbortException: java.net.SocketException:
Connection reset by peer: socket write error
at
org.apache.coyote.tomcat5.OutputBuffer.doFlush(OutputBuffer.java:374)
at
org.apache.coyote.tomcat5.OutputBuffer.flush(OutputBuffer.java:340)
at
org.apache.coyote.tomcat5.CoyoteResponse.flushBuffer(CoyoteResponse.java:552)
at
org.apache.coyote.tomcat5.CoyoteResponseFacade.flushBuffer(CoyoteResponseFacade.java:285)
at
org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:357)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:205)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
at
org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700)
at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
at java.lang.Thread.run(Unknown Source)
----
I am debugging on one PC, so I do not understand the
'Connection reset by peer' error.
It seems that this error is cause by the following
display tag - however, I can see the page rendered
correctly:
----
<html:form action="/admin/TemplateManagerAction">
<display:table name="listTemplates" pagesize="10"
id="templates" sort="list" export="true"
requestURI="/Canal/admin/TemplateManagerAction.do">
<display:setProperty name="basic.empty.showtable"
value="true"/>
<display:column media="html"> <input type=checkbox
name="value(<bean:write name="templates"
property="name"/>)" value="x"/> </display:column>
<display:column title="Name" property="name"
sortable="true"
href="TemplateManagerAction.do?method=View"
paramId="name"/>
<display:column title="Description"
property="description"
href="TemplateManagerAction.do?method=View"
paramId="name" paramProperty="name"/>
<display:column title="Category"
property="category" sortable="true"
href="TemplateManagerAction.do?method=View"
paramId="name" paramProperty="name"/>
</display:table>
<html:submit property="method"><bean:message
key="button.remove"/></html:submit>
</html:form>
------
I have no idea now.
appreciate your help !
li xin
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Struts messages are not displayed in JSP
Posted by Javen Fang <fa...@gmail.com>.
struts 用户列表已经改了,新的地址是:
user@struts.apache.org
www.matrix.org.cn
On Mon, 6 Sep 2004 07:25:36 -0700 (PDT), lixin chu <li...@yahoo.com> wrote:
> Hi,
> I gies a strange problem, the messages are not
> displayed. here is the code in my Action:
> ----
> messages.add(ActionMessages.GLOBAL_MESSAGE, new
> ActionMessage ("templates List error"));
> saveMessages (request, messages);
> ----
>
> In JSP:
> ----
> <font color="blue" size=2>
> <logic:messagesPresent message="true">
> <html:messages id="messages" message="true">
> <li><c:out value="${messages}"/></li>
> </html:messages><br>
> </logic:messagesPresent>
> </font>
> ----
>
> however, the messages are not displayed when the code
> is indeed executed.
>
> Instead, I saw error in log file:
> ----
> javax.servlet.jsp.JspException: ServletException in
> '/WEB-INF/tiles/DisplayTemplate.jsp': Cannot find bean
> messages in any scope
> ......
> ----
>
> I thought the 'messgaes' is already in request scope.
>
> And more strange, I also find the error message in log
> file:
> ----
> 2004-09-06 22:12:50
> org.apache.catalina.core.StandardHostValve@d76d51:
> Exception Processing ErrorPage[errorCode=404,
> location=/WEB-INF/pages/404.jsp]
> ClientAbortException: java.net.SocketException:
> Connection reset by peer: socket write error
> at
> org.apache.coyote.tomcat5.OutputBuffer.doFlush(OutputBuffer.java:374)
> at
> org.apache.coyote.tomcat5.OutputBuffer.flush(OutputBuffer.java:340)
> at
> org.apache.coyote.tomcat5.CoyoteResponse.flushBuffer(CoyoteResponse.java:552)
> at
> org.apache.coyote.tomcat5.CoyoteResponseFacade.flushBuffer(CoyoteResponseFacade.java:285)
> at
> org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:357)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:205)
> at
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:164)
> at
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:149)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:156)
> at
> org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:151)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:564)
> at
> org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:972)
> at
> org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:206)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
> at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:700)
> at
> org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:584)
> at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
> at java.lang.Thread.run(Unknown Source)
> ----
>
> I am debugging on one PC, so I do not understand the
> 'Connection reset by peer' error.
>
> It seems that this error is cause by the following
> display tag - however, I can see the page rendered
> correctly:
> ----
> <html:form action="/admin/TemplateManagerAction">
> <display:table name="listTemplates" pagesize="10"
> id="templates" sort="list" export="true"
> requestURI="/Canal/admin/TemplateManagerAction.do">
> <display:setProperty name="basic.empty.showtable"
> value="true"/>
> <display:column media="html"> <input type=checkbox
> name="value(<bean:write name="templates"
> property="name"/>)" value="x"/> </display:column>
> <display:column title="Name" property="name"
> sortable="true"
> href="TemplateManagerAction.do?method=View"
> paramId="name"/>
> <display:column title="Description"
> property="description"
> href="TemplateManagerAction.do?method=View"
> paramId="name" paramProperty="name"/>
> <display:column title="Category"
> property="category" sortable="true"
> href="TemplateManagerAction.do?method=View"
> paramId="name" paramProperty="name"/>
> </display:table>
> <html:submit property="method"><bean:message
> key="button.remove"/></html:submit>
> </html:form>
>
> ------
>
> I have no idea now.
>
> appreciate your help !
>
> li xin
>
> __________________________________
> Do you Yahoo!?
> New and Improved Yahoo! Mail - 100MB free storage!
> http://promotions.yahoo.com/new_mail
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
Javen Fang
-----------------------
Just for fun - Just do it
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org