• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

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

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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.

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!