• 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

Help with Servlet Code

 
Ranch Hand
Posts: 421
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What am I looking at:




I am wanting to determine if these strings are being passed on the query string and if I needed to add a parameter, how to do so.

Thanks,
 
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, in that code "req.getParameter(something)" gets one of the request parameters.

As for how they get into your application, that depends on whether the request was GET or POST (or one of the other more unusual methods). If it's a GET request then the parameters come in as parameters of the URL (probably what you meant by "on the query string") but if it's a POST request then they work somewhat differently.

As for adding a parameter, you can't do that in your servlet. You can only respond to whatever your client has sent. Now if that question was meant to be how to get the client to send another parameter, then it's a question about the client. About which we know nothing.
 
Sheriff
Posts: 67747
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
Taking a guess, if you mean these lines:
Then yes, those are request parameters.

They can be set by the query string on a the request URL (in the case of a GET), or by form elements (in the case of a POST).

[Edit: Paul shot first while I was posting! ]
 
Michele Smith
Ranch Hand
Posts: 421
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can I be sure that the parentid is passing? I have examined DMTemplateLoaderFLReports and it apperas to be passing a "1" as a parameter.

For example,

https://209.173.134.79:7001/DMTemplateLoaderFLReports?sdate=03/16/2010&edate=03/19/2012&caseid=0&homeid=1&parentid=1&userid=100059&mode=APA&documentFileName=1-EmbalmingReport.doc&homeId=<xsl:value-of select="../../Home/Id"/>&transId=NA&dmDocumentId=<xsl:value-of select="../../DMDocumentId"/>

 
Paul Clapham
Marshal
Posts: 28226
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know what that enormous bit of code was supposed to mean. (Please don't post huge code samples, nobody wants to read them.) However in the URL you posted at the beginning, after the XSLT transformation was complete, there would be three URL parameters, namely "homeId", "transId", and "dmDocumentId". Actually I suppose there could be others if the XSLT transformation generated them, but the code doesn't look to me as if it would do that. It's not impossible, though, so the best way to see what parameters are being passed is to look at the actual URL which is generated rather than trying to figure out what the code might produce.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic