File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 REST with Spring (video course) 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

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 name="USERS_ONLY">
html tags etc...

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.


This will this help you.

Java Developer, Thailand
It is sorta covered in the JavaRanch Style Guide.
subject: sess.existsAttribute tag not working?
It's not a secret anymore!