Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlets and html pages

 
Bala Krishniah
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My jsp has 2 menus. The first menu makes a call to the servlet and the second menu is a static html page.
menu1 manu2
servlet1) (static html)
_______________________________________________

When clicked on the first, the resulting page will be a jsp page along with the above two menu options.
But when the second menu is selected, the resulting page is a static html page along with the same menu options.
First time the user selects the first menu option, (The 2nd menu, the user can view the info without logging)I take them to the login screen before displaying the result.
My problem is,
(Case 1.)The user slects the menu two first. And now slects the first menu. In this case the user has not logged in, so I need to take him to logging screen.
(Case 2)User logs in. The resulting pages is displayed. Then selects the menu2. Now when he selets the menu 1, I have to take him to the resulting screen of menu 1 and not the loggin screen.
In other words, before and after logging, the same html pages is selected.
So how do I make a check from the html page, whethet the user has logged in or not every time when the user selects the menu 1.
Thanks
 
maha anna
Ranch Hand
Posts: 1467
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bala,
Plain HTML pages can't make any intelligent decision as to the user logged or not etc.
I understand your situation. What you can do is, instead of menu2 linking to static html page directly, change the menu2 to link to a 'CheckServlet' which checks for 'loginInfo' in user's session and if presents, the 'CheckServlet' would forward the request whereever you want to. (either html/servlet/jsp resources). Otherwise, let the 'CheckServle' redirect to 'Login' Page again.
regds
maha anna
 
Bala Krishniah
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Maha.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic