Win a copy of Head First Android this week in the Android forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Open a JSP page without doing hardcoded the credential in hyperlink.

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have one JSP page(a.jsp) and when I try to open this page it asks for username and password. I want to open this JSP page through a html page(b.html) with the help of hyperlink. One way is; If I hard coded the username and password in the hyperlink i.e. <a href="http://xyz.com:8080/rpt/a.jsp?USERNAME=admin&PASSWORD=admin"> Click here to check </a>. but this way is not secure.

Could someone please help me how can I open the JSP file without doing hardcoded the credential in hyperlink something like with the help of setting session attribute. Do let me know if any more clarification is needed.

Cheers!
 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi suresh,

You can set in both request and session scope.
My Advice is to set in session scope.After using them you just remove them from session..
 
Suresh Raatoori
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Vipul,

Thanks for your reply....
Can you please tell me the excat code to put the credential in session scope.

Regards,
Suresh
 
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Suresh,

Please read this link which explains about SessionManagement and check sample code examples here
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic