Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

bean:parameter giving exception

 
Gayatri Sinha
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In the ActionForm I am setting a session varaible

Boolean forward = new Boolean(false);
session.setAttribute("forward",forward);

In the front end jsp page when I use the struts tag to get the variable as
<bean arameter id="sample" name="forward" />
it gives an exception thta there is no such parameter.

>javax.servlet.jsp.JspException: ServletException in '/sample.jsp': No >parameter forward was included in this request
> at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(InsertTag.java:923)
> at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:462)

Am I missing something here..

Thanks
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The <bean:parameter> tag is for parameters passed in the query string as in: mypage.jsp?parm1=xyz.

What you want to use for this example is the <bean:write> tag.

<bean:write name="forward" />

Or if you want to use it in a conditional expression:

<logic:equals name="forward" value="true" >
</logic:equals>
[ March 02, 2006: Message edited by: Merrill Higginson ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic