• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem in SessionManagement in Struts

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hii,,

I am having a problem doing session management in Struts.....After logging out the user has to be directed to login page. and invalidate the session..This i am doing through logoff action class...Also after logging i need to make sure that user cannot see the contents of jsp page rather be directed to login page...here is m login action class..
.

My logoff action class is as follows


In all the action classes i am checking whether the (String)session.getAttribute("loggedin")==true...If not i am redirecting it to login page...This works fine...But in my jsp i am trying the same thing...


Its giving Illegal State Exception....Cannot FORWARD..The response already committedI am using a simple tile template for each of my page...one of the page is






Its giving Illegal State Exception...What is the problem i am unable to understand..I also incresed size of buffer to 256k but still no solution....Please Help as to how to redirect to login page after session is invalidated


Thanks in advance


 
patriot indian
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey i solved provblem to certain extent instead of jsp:forward i used response.sendRedirect("login.jsp")...but it is not redirecting to the page...Also its not showing any error...What is causing such thing..I am giving my jsp code please help..
.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Once data is written to the response you can't redirect.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic