• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

url question

 
Terrence White
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to understand how to send parameters to a servlet using the url string.
I have seen the following.
http://server.name.com/webappName/servletName/pathInfo?paramName=value¶mName=value2
Since the ? mark is used to indicate a paramater list, what does the semicolon ; mean.
I saw this in the SCWCD Exam Study Kit on page 127:
<a href="/servlet/AccountServlet;JSESSIONID=C084B32241...114">
Should this read:
<a href="/servlet/AccountServlet?JSESSIONID=C084B32241...114">
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Terrence,
You have mixed up the request parameters and the HTTP headers.
If you wanna pass the parameters via the URL, the URL looks:
http://127.0.0.1/Test/abc.jsp?method=xxx&data=yyy
So, you can use request.getParameter("method") and request.getParameter("data") to get the value of the parameters.
On the other hand, in SCWCD Exam Study Kit, since JSESSIONID is NOT a request parameter, it is a HTTP header info. Why we need this? Because we cannot assume the client browser supports COOKIE. In this case, if we still need to maintain the session, we need something to keep trace the session, and we use the header JSESSIONID to maintain the session.
Since it is NOT a request parameter, so, we dont use ?, instead, we use ; as the delimiter.
I remember SCWCD Exam Study Kit mentioned and explain this in a short note. Please read it again.
Hope this help.
Nick
 
Terrence White
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you have parameters and headers in the same request URL?
If so, would you put the parms first or the headers?
 
dan levine
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IE's built in password remembering feature will not work for URL's that include header information... so our users have to enter their password every time the come to our site, when many of them are used to checking the IE box for "Remeber my password". Is there a good way around this?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic