It's not a secret anymore!*
The moose likes Struts and the fly likes sess.existsAttribute tag not working? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "sess.existsAttribute tag not working?" Watch "sess.existsAttribute tag not working?" New topic
Author

sess.existsAttribute tag not working?

Nicolas Flammel
Ranch Hand

Joined: May 05, 2004
Posts: 32
I have set a session attribute at the end of the action class
session.setAttribute("USERS_ONLY", "usersOnly") after which the JSP page loads and I have a block of code inside the
<sess:existsAttribute name="USERS_ONLY" value="false">
html tags etc...
</sess:existsAttribute>

<sess:existsAttribute name="USERS_ONLY">
html tags etc...
</sess:existsAttribute>

The JSP doe not load properly and when i see the source it displys the contents inside <sess:existsAttribute name="USERS_ONLY" value="false">
tag although the attribute USERS_ONLY exixts. So why does it go inside the first <sess:existsAttribute name="USERS_ONLY" value="false"> tag???
Nicolas Flammel
Ranch Hand

Joined: May 05, 2004
Posts: 32
Please help me out.
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
ExistsAttribute : Includes the body of the tag if the session attribute exists

Attribute :
- name : Name of session attribute. is Required
- value : If value is set to false the existsAttribute tag includes body of tag if session attribute does not exist. Default is true.

Example






This will this help you.


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: sess.existsAttribute tag not working?