Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem while forwarding

 
Vic Hood
Ranch Hand
Posts: 477
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey folks,
Im trying to implement role based user access in a system that Im building .Im plugged in some code into a filter that maps across all the secure pages , which is helping me do so.I just check whether a user has the required role to access a particular page , if not I redirect the person to a home page . However in pages , where Im already forwarding through a servlet during page load , I get an error saying that the response has already been committed.
Any ideas on how I could circumvent this ?
 
amit punekar
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
This happens when you are trying to use the Response stream that has already been comitted.
For e.g when you are doing response.redirect(new html) , you should not have committed the response while doing this.
HttpServletResponse API will tell you which all methods if invoked on Response object commits the response.

Regards,
Amit
 
Shailesh Narkhede
Ranch Hand
Posts: 368
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thing you are going to implement is given by server implementation, just need to change some XML file according to server, you can use it for your requirment.
Which server you are using ?


 
Vic Hood
Ranch Hand
Posts: 477
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apache Tomcat.
@amit , I really didnt get your answer.
 
amit punekar
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Please check this.

regards,
amit
 
Vic Hood
Ranch Hand
Posts: 477
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic