• 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

Servlet via URL in Email - Suggestions?

 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
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
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.
 
You know it is dark times when the trees riot. I think this tiny ad is their leader:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic