jQuery in Action, 2nd edition*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "JSP page Authentiaction" Watch "JSP page Authentiaction" New topic

JSP page Authentiaction

Krishna Attravanam

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

Matt Raible
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.

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
    I agree. Here's the link: http://aspose.com/file-tools
    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