This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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
jQuery in Action, 2nd edition
subject: sess.existsAttribute tag not working?
Similar Threads
html:checkbox disable property
Using Custom tags inside HTML or Scriptlet
called tag file with scripting inside
simple struts conditional?