• Post Reply Bookmark Topic Watch Topic
  • New Topic

QueryString(in ASP) Equivalent in JSP  RSS feed

 
Hari Haran
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ,
I m new to JSP. I have worked in ASP. Can anyone help me out with the Equivalent of QueryString in Jsp.
 
Uma Balu
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
JSP does not distinguish between get and post methods of submit. To obtain any parameter value, use request.getParameter("param_name").
Uma.
 
Hari Haran
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Uma Balu:
Hi,
JSP does not distinguish between get and post methods of submit. To obtain any parameter value, use request.getParameter("param_name").
Uma.


hi ,
I m not submitting my jsp page . Have a look at this code.
<FRAME name="left" src="symbol.asp?<%=strQueryString%>" scrolling="auto" marginwidth="0" marginheight="0">
I have a page(lets have it as source.asp) which has the above code. I m storing certain values in the variable "strQueryString" . By making use of the above code i will be able to access the values stored in "strQueryString" in symbol.asp page. Similarly i want to do in a jsp page. If i can make use of request.getparameter, should i set the value of the variable in source page.
 
Uma Balu
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
As per my understanding of ur code, the same thing will work fine in JSP also. You can use, <%= %> kind of expression in JSP also. If in case you want to extract the querystring part of your url, lets say, u have something like this,
http://www.someserver.com?name=uma&password=test
Then, if you use request.getQueryString(), then u can get the contents after the ?, ie, name=uma&password=test can be retrieved.
I hope this is what you are looking for...
Uma...
 
Hari Haran
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Uma Balu:
Hi,
As per my understanding of ur code, the same thing will work fine in JSP also. You can use, <%= %> kind of expression in JSP also. If in case you want to extract the querystring part of your url, lets say, u have something like this,
http://www.someserver.com?name=uma&password=test
Then, if you use request.getQueryString(), then u can get the contents after the ?, ie, name=uma&password=test can be retrieved.
I hope this is what you are looking for...
Uma...


Exactly!! This was what i was looking for.
Thanks
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66208
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch Servlet Learnet!
You'll find this forum a great place to seek help on JSP pages, and there aren't many rules you'll have to worry about, but one is that proper names are required. Please take a look at the JavaRanch Naming Policy and change your display name to match it.
Thanks!
bear
JSP Fourm Bartender
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!