aspose file tools*
The moose likes JSP and the fly likes how to make second jsp not accessable directly from url Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "how to make second jsp not accessable directly from url" Watch "how to make second jsp not accessable directly from url" New topic
Author

how to make second jsp not accessable directly from url

rajesh chowdary
Greenhorn

Joined: Oct 12, 2008
Posts: 2
i have two jsp pages.login.jsp and second.jsp .after verifying the login.jsp with database i have to enter into the 2nd jsp page.but,if i type http://localhost:8080/project/second.jsp it was appearing with out validating in login.jsp. how can i make second.jsp not visible with out login page validations.
please help me.

[ October 13, 2008: Message edited by: rajesh chowdary ]

rajesh pendyala
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
hi,

You can put second.jsp under security constraint in the web.xml config file.
In other words by making second.jsp page, an authorized page you can restraint
that page to be accessed without login. This way, direct access to this page will redirect the user to the login page setup by you.


cmbhatt
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
See this:
Form based authentication
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

Hi rajesh chowdary welcome to Javaranch ,

Firstly are you using only JSP's to do the work with no controllers in between?
If yes then consider reworking your design so that it follows the MVC 2 architecture.
Otherwise there will be more of such patch-up problems.

Hope this helps


SCJP, SCWCD.
|Asking Good Questions|
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to make second jsp not accessable directly from url