This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes JSP page Authentiaction Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "JSP page Authentiaction" Watch "JSP page Authentiaction" New topic
Author

JSP page Authentiaction

Krishna Attravanam
Greenhorn

Joined: Oct 21, 2004
Posts: 16
I am developing a webapp using struts with a bunch of JSP pages.

A login screen ( outside my webapp) authenticates the user and forwards it to home page of my webapp.

Now if any user wants to access my jsp pages directly (assuming the user is unauthenicated) I need to forward him to the login page...

now i am not sure where i should write the code for this ..and what kind of code should i write?

Can any one help me

Thanks
~K
Matt Raible
author
Ranch Hand

Joined: Jan 11, 2001
Posts: 114
I'd suggest using container managed security or possibly the SecurityFilter if you're on a Servlet 2.3 container.


Matt<br /> <br />Author: <a href="http://springlive.com" target="_blank" rel="nofollow">Spring Live</a> and <a href="http://www.apress.com/book/bookDisplay.html?bID=256" target="_blank" rel="nofollow">Pro JSP</a><br />Weblogs: <a href="http://raibledesigns.com" target="_blank" rel="nofollow">Raible Designs</a> <a href="http://jroller.com/page/raible" target="_blank" rel="nofollow">Spring Live Blog</a>
somkiat puisungnoen
Ranch Hand

Joined: Jul 04, 2003
Posts: 1312
sometime you can use session scope to solve this problem.


SCJA,SCJP,SCWCD,SCBCD,SCEA I
Java Developer, Thailand
Alexandru Popescu
Ranch Hand

Joined: Jul 12, 2004
Posts: 995
You can read more about Struts and security:
  • Struts Best Practices
  • Using JAAS for Authorization and Authentication (with Struts)


  • ./pope


    blog - InfoQ.com
     
    It is sorta covered in the JavaRanch Style Guide.
     
    subject: JSP page Authentiaction
     
    Similar Threads
    Redirect to the requested page failed using form-based authentication
    redirecting a request to another page in another webapp.
    Resource Restriction using web.xml
    Processing a login page not working
    creating secure Java apps