• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem in login

 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hai to all
i am using jsp and servlet in my application.i have the option for login in all page like index.jsp,product.jsp.if user login in index.jsp .i have to redirect to index.jsp. if user login in product.jsp i have to redirect to product.jsp from servlet



thanks in advance
[ August 30, 2008: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why dont you keep a single login page for all jsp pages, say login.jsp , so that whenever a user wants to login from any jsp page like products.jsp, supplier.jsp page , you can forward them to login.jsp !!
 
vijayakumar durai
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i include login.jsp in all page.suppose if user login in product.jsp i have to redirect to product.jsp.if user login in supplier.jsp. i have to redirect to supplier.jsp
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Repeating the code on every page is a poor approach. The more common approach is to have a filter that checks if the user is logged in or not (usually by checking a token in the session). If not, the request is forwarded to the login page. The original URL is easy to record within hidden parameters or in the session. After login, you can send the user to the original URL.
 
reply
    Bookmark Topic Watch Topic
  • New Topic