This week's book giveaway is in the Design and Architecture forum.
We're giving away four copies of Communication Patterns: A Guide for Developers and Architects and have Jacqui Read on-line!
See this thread for details.
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Problem with getting parameters from the URL and the fields within my JSP

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello all.

I'm currently developing a system which allows the user to login to perform their activities.
As a requirement, I'm developing a way for the user to reset their password if they forget.
Now, my web service is tied to a database, where it generates a unique token (expires after a certain amount of time)
and emails this to the user, for them to click and reset their password etc. The URL (with the unique token) they click is a JSP page, where I have
two fields and a "Submit" button.

Something like this which gets email to the user http://localhost:8080/resetPassword.jsp?token=UNIQUE_TOKEN

As a security measure, I have two seperate JSP pages. One which is public accessible (contains the unique token, button, and two text fields),
and one that is inside the WEB-INF folder. I can forward the token parameter from the public accessible JSP to the JSP page inside the WEB-INF folder.


Is there a way that I can grab all of the parameters from the text fields on the JSP page and token, to send this off to my webservice.

Thanks
 
Ranch Hand
Posts: 440
Hibernate Eclipse IDE Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Philip,

Just a suggestion. How about you a form on the public page with 3 fields
1 hidden field -> your token. just populate it via JavaScript just as soon as the page loads
2 text fileds -> for name and password ( I am guessing its a password reset page from your URL)

Then submit this form to the JSP to WEB_INF one and you will get all the 3 params in that JSP.

However, this is just one way of doing it , there can be other.
 
Ranch Hand
Posts: 384
Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Philip,

First of all we can't access your localhost

Anyways,
Why don't you try getting to the jsp page through a servlet. In that get the token from the database and use it in your submission jsp.

 
The world's cheapest jedi mind trick: "Aw c'mon, why not read this tiny ad?"
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic