struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Hardy <ahardy.str...@cyberspaceroad.com>
Subject Re: xwork injecting parameters into requestScope
Date Tue, 21 Oct 2008 22:04:34 GMT
Adam Hardy on 21/10/08 14:12, wrote:
> I have an Action and corresponding JSP form with the property "portfolio".
> 
> In my JSP, I have this JSTL tag test:
> 
> <c:if test="${not empty portfolio and portfolio.id gt 0}"> stuff </c:if>
> 
> which works fine for my purposes. But then when I submit the form and 
> validation fails and myAction.portfolio is not initialized, Struts2 
> injects the portfolio request parameter into the requestAttributes.
> 
> Now my JSP blows up because:
> 
> ${portfolio} = "0"
> 
> and
> 
> ${not empty portfolio} = true
> 
> and then
> 
> ${portfolio.id} ----> javax.servlet.jsp.JspException: 
> javax.el.PropertyNotFoundException: Property 'id' not found on type 
> java.lang.Character
> 
> 
> What influence can I have over this injection behaviour?
> 
> Or perhaps, can I reformulate my test so that I can tell whether my 
> "${portfolio}" is a string or a bean?

Solved the issue by writing a JSTL function to do the checks.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message