File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP hyperlink to protected page

 
Brooke Maddox
Ranch Hand
Posts: 42
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64196
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not at all clear what yea mean by a "protected page".
 
Brooke Maddox
Ranch Hand
Posts: 42
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64196
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 42
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you :)
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic