I need help regarding how to pass values in a url to my java application.
For example my application is www.xyz.com and some one try to send telephone info with that url like www.xyz.com/tel=6463339999. How can i receive that value in my servlet or index.jsp page. I do not know how to retrieve a value send via url directly to my website. Please guide me. Please also tell me what is Http get, some body told me i can use http get to retrieve values sent directlyin url...... thanks
The URL you showed was not well formed; the ? character was missing from the query string.
If it were well-formed, you would be able to retrieve the values of the query parameters with methods defined on HttpServletRequest.
www.xyz.com/tel=6463339999. Is not referring to any servlet, but to your webapp root, and since it looks like you have index.jsp as a welcome-file, So references that specify your webapp root without a resource are taken to index.jsp. Unless the user specifies the path to the servlet that can read the parameters, there is no way you are doing to be able to read those parameters.
Originally posted by Alix Sye:
i know how to retrieve parm values when sent via form using post to servlet using getParameter. My questions is if some one else send a parameter attached to my website url then how i retrieve that value. because when i type www.xyz.com it goes to the index.jsp page. I have MVC design on my site so all requests go thru a single servlet. MY website is build in j2ee using jsp and servlet. can some body give me a sample code how to retrieve values if sent in url form some body else...thanks
[ June 12, 2006: Message edited by: Bosun Bello ]
Welcome to the Ranch!
We're a friendly bunch, but we take our display names very seriously.
Display names must be two words: your first name, a space, then your last name, and fictitious names are not allowed.
Please edit your profile and correct your display name, since accounts with invalid display names get deleted.