how to pass values like in ASP, help!
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   jaime_mendoza
Posted On:   Wednesday, November 14, 2001 08:25 PM

I am trying to pass a value as in ASP that would look like this
http://www.domainname.com/page1.asp?id=1234


See how I can pass an id value in the URL, what is the best way to do this in JSP. Thanks in advance.

Re: how to pass values like in ASP, help!

Posted By:   Harikrishna_Neerkaje  
Posted On:   Wednesday, November 14, 2001 10:39 PM

Well it would be the exact same way, only replace the .asp with .jsp as shown below.



http://www.domainname.com/page1.jsp?id=1234


Then U can access this request parameter parameter in page1.jsp using either request.getParameter(String parameterName)
or

request.getQueryString()

Where request is an instance of javax.servlet.http.HttpServletRequest , and is an implicit object in JSP.

Please read the api docs of javax.servlet.ServletRequest javax.servlet.http.HttpServletRequest for further details.

About | Sitemap | Contact