• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

My logic Tag Does Not Seem To Work

 
Ranch Hand
Posts: 1309
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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" );
session.invalidate();
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:notPresent>
<logic resent name="user">|
<html:link forward="exit">LOGOUT</html:link>
</logic resent>
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic