aspose file tools*
The moose likes Struts and the fly likes My logic Tag Does Not Seem To Work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "My logic Tag Does Not Seem To Work" Watch "My logic Tag Does Not Seem To Work" New topic

My logic Tag Does Not Seem To Work

JiaPei Jen
Ranch Hand

Joined: Nov 19, 2000
Posts: 1309
Please point out my mistakes. Does the 'name' attribute of the logic tag accept an object only? For example, I created a session this way:
HttpSession session = request.getSession();
String username = request.getRemoteUser();
session.setAttribute( "user", username );
In the LogoffAction, I invalidate the session and want to forward the visitor to the welcome page. This is what I did:
HttpSession session = request.getSession(false);
String username = (String)session.getAttribute( "user" );
if (username != null)
session.removeAttribute( "user" );
return (mapping.findForward( "success" ));
I used the logic tag in my welcome.jsp. The tag does seem to work because the LOGOFF button is still displayed.
<logic:notPresent name="user">
<html:link forward="logon">LOGON</html:link>
<logic resent name="user">|
<html:link forward="exit">LOGOUT</html:link>
</logic resent>
Don't get me started about those stupid light bulbs.
subject: My logic Tag Does Not Seem To Work
Similar Threads
Problem with a select tag
Mr. Ford, My Logic Tag Does Not Seem to Work
Setting HttpSession Attribute Not Working (Struts)
When to use logic:present tag
How can this be done better (html:link)