aspose file tools*
The moose likes JSP and the fly likes JSP hyperlink to protected page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP hyperlink to protected page" Watch "JSP hyperlink to protected page" New topic
Author

JSP hyperlink to protected page

Brooke Maddox
Ranch Hand

Joined: Nov 23, 2012
Posts: 42
Hello everyone,
I was wondering if there is a way I can hyperlink to protected page. Here is my reasoning, I have a jsp page that allows a user to add/delete items from a database. Once the user has added/deleted an item they are redirected to a confirmation jsp page. From this page I would like to allow the user to go back to the protected add/delete page in order to add/delete another item from the database. Can I do this using a hyper link or do I need to use a form whose action is a servlet in order to redirect the response back to the add/delete page. Here is the code I am trying, and is not working.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61658
    
  67

It's not at all clear what yea mean by a "protected page".


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Brooke Maddox
Ranch Hand

Joined: Nov 23, 2012
Posts: 42
Sorry I mean a jsp page that is in the WEB-INF directory.
Here is by tree
WebPages
-WEB-INF
-view
-admin.jsp

I should add that a user name and password are needed in order to access this page.

Do I need to store the user name and password in a session in order to allow a hyperlink back to the admin.jsp page?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61658
    
  67

The whole purpose for putting a JSP under WEB-INF is to prevent just what you are trying to do; so don't even try. A JSP page should never be invoked without its page controller. So your link should be to the page controller, not to the JSP page.
Brooke Maddox
Ranch Hand

Joined: Nov 23, 2012
Posts: 42
Thank you :)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP hyperlink to protected page