• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet via URL in Email - Suggestions?

 
K DeLucia
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm working on an application that uses jsp and html pages and servlets. Basically, a user logs in, fills out a request form and submits it. On submit a servlet kicks off that saves the request details in an Oracle table and sends an email. That email is picked up by another system where there is some internal routing of the request document and the status in the Oracle table is updated. Once that is complete, I want to send an email back to the original requestor so they can see a status of their request and click 'approve' or 'deny'.

I'm at the point where I'm trying to figure out how to display the request and its status to the requestor. I don't have a problem with the servlet that will pull the appropriate data to display for the user, but I'm not sure of the best way to get the user to the page they need to be at.

For instance, (and I'm very new to java so these may very well not be the best ways) I think I could send a url such as http://myhost/rfs/MyServlet which will kick off the servlet to pull the data from Oracle to display. I'm not sure though how to pass in the 'Request#' which is my key for looking up the request. Can the url be appended with ?reqnum=myreqnum? And if so, is this a good way to handle it?

Another option could be to send a url such as http://myhost/rfs/mypage.html and have some onload javascript run to kick off the servlet and displays the appropriate data to the user. This seems like an extra step that is relying on javascript which may or may not be enabled.

Am I going about this the right way? Any suggestions as to how I should go about this are most appreciated!
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JavaScript seems like an unnecessary complication. There's no problem with emailing an URL like http://myhost/rfs/MyServlet?reqnum=myreqnum&foo=bar
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64993
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, the query string is one means by which you can attach the data. Or, you can investigate the use of "friendly URLs" in which the info is embedded in the path info.

In either case, be sure that you are not introducing security issues by exposing actual ID values. be sure to use indirect methods or encryption.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic