aspose file tools*
The moose likes Struts and the fly likes Doubts about bean:write Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Doubts about bean:write" Watch "Doubts about bean:write" New topic
Author

Doubts about bean:write

Kinjal Sonpal
Ranch Hand

Joined: Jun 06, 2003
Posts: 96
Hi all,

I have following code in the JSP. Here the name "inquiry.count" is a simple
Integer instance stored by using

request.setAttribute("inquiry.count", new Integer(count));

in the Action class, which then forwards to a jsp page


Here, usage of request.getAttribute in a scriptlet, instead of <bean: write> gives expected results.

Please suggest.

Thanks and regards,
Kinjal Sonpal

[ edited to disable smilies - ds ]
[ May 27, 2004: Message edited by: Dirk Schreckmann ]
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
I'm not sure what your question is.

<bean:write name="inquiry.count" scope="request" />

...will display the Integer value as expected.
Kinjal Sonpal
Ranch Hand

Joined: Jun 06, 2003
Posts: 96
Originally posted by Jason Menard:
I'm not sure what your question is.

<bean:write name="inquiry.count" scope="request" />

...will display the Integer value as expected.

It does not, though expected to display. It does not even throw any exception either.

Thanks and regards,
Kinjal Sonpal
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
Originally posted by Kinjal Sonpal:

It does not, though expected to display. It does not even throw any exception either.


Your problem is something else then. If you place an Integer into some scope, you can display its value using <bean:write>. If it's not displaying correctly for you, then maybe it's not in request scope? I've run the same code you have given and it works fine for me.
Kinjal Sonpal
Ranch Hand

Joined: Jun 06, 2003
Posts: 96
Originally posted by Jason Menard:

Your problem is something else then. If you place an Integer into some scope, you can display its value using <bean:write>. If it's not displaying correctly for you, then maybe it's not in request scope? I've run the same code you have given and it works fine for me.

Hmmm .., I also think so. But when I use <%=request.getAttribute("inquiry.count")%> in place of <bean: write>, I get the expected result.

Please share your thoughts.

Thanks and regards,
Kinjal Sonpal
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Doubts about bean:write
 
Similar Threads
Display firstName and lastName in banking example
jsp page for struts
looping with iterate tag in struts
problem with html:errors
javax.servlet.ServletException:javax.servlet.jsp.JspException: Cannot find bean: "riga" in any scope