File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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="" target="_blank" rel="nofollow">Spring Live</a> and <a href="" target="_blank" rel="nofollow">Pro JSP</a><br />Weblogs: <a href="" target="_blank" rel="nofollow">Raible Designs</a> <a href="" 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 -
    I agree. Here's the link:
    subject: JSP page Authentiaction
    It's not a secret anymore!