You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mick Knutson <mi...@safeway.com> on 2005/06/27 21:00:11 UTC
unable to print nested values with bean:write, or c:out
I have an ActionForm (consumerValidatorForm) that contains a
ConsumerActivity object. The CA object contains a date
(lastPinChangeDate).
I am trying this in my jsp, and nothing seems to print:
<bean:define id="lastPinChangeDate" name="consumerValidatorForm"
property="consumerActivity.lastPinChangeDate"/>
<tr>
<td class="textreq" noWrap> <bean:message
key="label.consumer.lastPinChangeDate" /></td>
<td class="textreq"><c:set var="lastPinChangeDate"
value="${consumerValidatorForm.consumerAct.lastPinChangeDate}"/>
[<c:out value="${lastPinChangeDate}"/>]
</td>
</tr>
All I get is [] printed, and I know there is a date in that object as I
do a print in my action.
--
Thanks
Mick Knutson
(925) 951-4126
HP Consulting Services
Safeway (Blackhawk Fastword Project)
J2EE Architect
---
"MMS <safeway.com>" made the following annotations.
------------------------------------------------------------------------------
Warning:
All e-mail sent to this address will be received by the Safeway corporate e-mail system, and is subject to archival and review by someone other than the recipient. This e-mail may contain information proprietary to Safeway and is intended only for the use of the intended recipient(s). If the reader of this message is not the intended recipient(s), you are notified that you have received this message in error and that any review, dissemination, distribution or copying of this message is strictly prohibited. If you have received this message in error, please notify the sender immediately.
==============================================================================
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: unable to print nested values with bean:write, or c:out
Posted by Wendy Smoak <ja...@wendysmoak.com>.
From: "Mick Knutson" <mi...@safeway.com>
> <bean:define id="lastPinChangeDate" name="consumerValidatorForm"
> property="consumerActivity.lastPinChangeDate"/>
> <c:set var="lastPinChangeDate"
> value="${consumerValidatorForm.consumerAct.lastPinChangeDate}"/>
> [<c:out value="${lastPinChangeDate}"/>]
The <bean:define> tag has the equivalent of:
lastPinChangeDate = form.getConsumerActivity().getLastPinChangeDate();
The <c:set> has
lastPinChangeDate = form.getConsumerAct().getLastPinChangeDate();
My guess is that the former is correct, (with Activity spelled out) but then
you overwrite lastPinChangeDate with blank when <c:set> can't find the
'consumerAct' property.
--
Wendy Smoak
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: unable to print nested values with bean:write, or c:out
Posted by Mick Knutson <mi...@safeway.com>.
If ConsumerValidatorForm:
public IConsumerActivity getConsumerActivity() {
return consumerActivity;
}
from ConsumerActivity (not an Action Form though):
public String getLastPinChangeDate() {
return lastPinChangeDate;
}
Could it be that consumer activity is just a pojo, and not an action form?
Wendy Smoak wrote:
> From: "Mick Knutson" ?mick.knutson1@safeway.com>
> >I modified what I was trying with this:
> >
> > ?bean:define id="lastPinChangeDate" name="consumerValidatorForm"
> > property="consumerActivity.lastPinChangeDate"/>
> >
> > [?c:out value="${lastPinChangeDate}"/>]
> >
> > And this is the error message I get:
> > 19:02:50,908 ERROR [[jsp]] Servlet.service() for servlet jsp threw
> > exception
> > javax.servlet.jsp.JspException: Invalid argument looking up property
> > consumerActivity.lastPinChangeDate of bean consumerValidatorForm
>
> And you're sure that your form has a getConsumerActivity() method, and
> whatever it returns has a getLastPinChangeDate() method?
>
> Can you try it with all JSTL instead of mixing ?bean> and ?c> tags? It
> doesn't look like ?bean:define> is doing what you want-- it looks like it
> thinks "consumerActivity.lastPinChangeDate" is the property name. So use
> ?c:set> for the first part. If you need it... what does just
> ?c:out value="${consumerValidatorForm.consumerActivity.lastPinChangeDate}"/>
> print?
>
> Unless you're on a JSP 2.0 container (probably not if you're using ?c:out>
> the best combination is JSTL and Struts-EL. Use JSTL as much as possible,
> and the Struts-EL taglib only has the things that can't be done in JSTL.
>
> --
> Wendy Smoak
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
--
Thanks
Mick Knutson
(925) 951-4126
HP Consulting Services
Safeway (Blackhawk Fastword Project)
J2EE Architect
---
"MMS <safeway.com>" made the following annotations.
------------------------------------------------------------------------------
Warning:
All e-mail sent to this address will be received by the Safeway corporate e-mail system, and is subject to archival and review by someone other than the recipient. This e-mail may contain information proprietary to Safeway and is intended only for the use of the intended recipient(s). If the reader of this message is not the intended recipient(s), you are notified that you have received this message in error and that any review, dissemination, distribution or copying of this message is strictly prohibited. If you have received this message in error, please notify the sender immediately.
==============================================================================
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: unable to print nested values with bean:write, or c:out
Posted by Wendy Smoak <ja...@wendysmoak.com>.
From: "Mick Knutson" <mi...@safeway.com>
>I modified what I was trying with this:
>
> <bean:define id="lastPinChangeDate" name="consumerValidatorForm"
> property="consumerActivity.lastPinChangeDate"/>
>
> [<c:out value="${lastPinChangeDate}"/>]
>
> And this is the error message I get:
> 19:02:50,908 ERROR [[jsp]] Servlet.service() for servlet jsp threw
> exception
> javax.servlet.jsp.JspException: Invalid argument looking up property
> consumerActivity.lastPinChangeDate of bean consumerValidatorForm
And you're sure that your form has a getConsumerActivity() method, and
whatever it returns has a getLastPinChangeDate() method?
Can you try it with all JSTL instead of mixing <bean> and <c> tags? It
doesn't look like <bean:define> is doing what you want-- it looks like it
thinks "consumerActivity.lastPinChangeDate" is the property name. So use
<c:set> for the first part. If you need it... what does just
<c:out value="${consumerValidatorForm.consumerActivity.lastPinChangeDate}"/>
print?
Unless you're on a JSP 2.0 container (probably not if you're using <c:out>
the best combination is JSTL and Struts-EL. Use JSTL as much as possible,
and the Struts-EL taglib only has the things that can't be done in JSTL.
--
Wendy Smoak
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: unable to print nested values with bean:write, or c:out
Posted by Mick Knutson <mi...@safeway.com>.
I modified what I was trying with this:
<bean:define id="lastPinChangeDate" name="consumerValidatorForm"
property="consumerActivity.lastPinChangeDate"/>
<tr>
<td class="textreq" noWrap> <bean:message
key="label.consumer.lastPinChangeDate" /></td>
<td class="textreq"><bean:write name="" property="" />
[<c:out value="${lastPinChangeDate}"/>]
</td>
</tr>
And this is the error message I get:
19:02:50,908 ERROR [[jsp]] Servlet.service() for servlet jsp threw
exception
javax.servlet.jsp.JspException: Invalid argument looking up property
consumerActivity.lastPinChangeDate of bean consumerValidatorForm
at org.apache.struts.taglib.TagUtils.lookup(TagUtils.java:1017)
at
org.apache.struts.taglib.bean.DefineTag.doEndTag(DefineTag.java:232)
at
org.apache.jsp.WEB_002dINF.default_.body.consumer_jsp._jspService(org.apache.jsp.WEB_002dINF.default_.body.consumer_jsp:387)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
at
org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
at
org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:604)
at
org.apache.struts.tiles.TilesUtilImpl.doInclude(TilesUtilImpl.java:101)
at org.apache.struts.tiles.TilesUtil.doInclude(TilesUtil.java:137)
at
org.apache.struts.taglib.tiles.InsertTag.doInclude(InsertTag.java:758)
at
org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:890)
at
org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:460)
at
org.apache.jsp.WEB_002dINF.default_.defaultLayout_jsp._jspx_meth_tiles_insert_3(org.apache.jsp.WEB_002dINF.default_.defaultLayout_jsp:
195)
at
org.apache.jsp.WEB_002dINF.default_.defaultLayout_jsp._jspService(org.apache.jsp.WEB_002dINF.default_.defaultLayout_jsp:93)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
at
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
at
org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
at
org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
at
org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1056)
at
org.apache.struts.tiles.TilesRequestProcessor.doForward(TilesRequestProcessor.java:261)
at
org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:237)
at
org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:300)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:231)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at
com.baselogic.struts.ExtendedActionServlet.process(ExtendedActionServlet.java:61)
at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at
org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at
org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:534)
19:02:50,970 ERROR [InsertTag] ServletException in
'/WEB-INF/default/body/consumer.jsp': Invalid argument looking up property
consumerActivity.la
stPinChangeDate of bean consumerValidatorForm
Mick Knutson wrote:
> I have an ActionForm (consumerValidatorForm) that contains a
> ConsumerActivity object. The CA object contains a date
> (lastPinChangeDate).
>
> I am trying this in my jsp, and nothing seems to print:
>
> <bean:define id="lastPinChangeDate" name="consumerValidatorForm"
> property="consumerActivity.lastPinChangeDate"/>
> <tr>
> <td class="textreq" noWrap> <bean:message
> key="label.consumer.lastPinChangeDate" /></td>
> <td class="textreq"><c:set var="lastPinChangeDate"
> value="${consumerValidatorForm.consumerAct.lastPinChangeDate}"/>
> [<c:out value="${lastPinChangeDate}"/>]
> </td>
> </tr>
>
> All I get is [] printed, and I know there is a date in that object as I
> do a print in my action.
>
> --
>
> Thanks
> Mick Knutson
> (925) 951-4126
> HP Consulting Services
> Safeway (Blackhawk Fastword Project)
> J2EE Architect
> ---
--
Thanks
Mick Knutson
(925) 951-4126
HP Consulting Services
Safeway (Blackhawk Fastword Project)
J2EE Architect
---
"MMS <safeway.com>" made the following annotations.
------------------------------------------------------------------------------
Warning:
All e-mail sent to this address will be received by the Safeway corporate e-mail system, and is subject to archival and review by someone other than the recipient. This e-mail may contain information proprietary to Safeway and is intended only for the use of the intended recipient(s). If the reader of this message is not the intended recipient(s), you are notified that you have received this message in error and that any review, dissemination, distribution or copying of this message is strictly prohibited. If you have received this message in error, please notify the sender immediately.
==============================================================================
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org