href="BookDetail.jsp?item_id=<%=java.net.URLEncoder.encode(result.getString(1))%>"
And please also give me a hand in these question .
1.Is '?' the default ways to pass the params along with a link to another jsp ?
2.The params is named at the time we write that code or it is named before ? And how ?
3. How the BookDetail.jsp receive the params to look it up in the database and show all the details of that book name out ?
It would be very nice of you if you could give me some advices !
-
what does '?' mean in the following statement (6 messages)
- Posted by: Thien Loc Le Minh
- Posted on: October 31 2004 23:36 EST
Threaded Messages (6)
- what does '?' mean in the following statement by Ian Purton on November 01 2004 07:55 EST
- RE: what does '?' mean in the following statement by Grim Shieldsson on November 01 2004 09:22 EST
- RE: what does '?' mean in the following statement by Bruce Blackshaw on November 03 2004 12:11 EST
- what does '?' mean in the following statement by Udayan Patel on November 01 2004 12:38 EST
- what does '?' mean in the following statement by Udayan Patel on November 01 2004 12:40 EST
- what does '?' mean in the following statement by null on November 02 2004 06:53 EST
-
what does '?' mean in the following statement[ Go to top ]
- Posted by: Ian Purton
- Posted on: November 01 2004 07:55 EST
- in response to Thien Loc Le Minh
The ? and & are the standard ways of passing parameters in HTTP.
i.e.
www.theurl.com?param1=value1¶m2=value2
You can collect the parameters up within a servlet with something like
HttpRequest.getParameterValue("param1");
Ian Purton
Website Uptime and Availability | Permission Email List Management | Smartphone GPS | All Time Top 100 Rock Charts -
RE: what does '?' mean in the following statement[ Go to top ]
- Posted by: Grim Shieldsson
- Posted on: November 01 2004 09:22 EST
- in response to Thien Loc Le Minh
Ian is correct, and you should know that the questions you have asked are incredibly basic. Any half-way decent beginners book would have the answer.
If you don't know this, you're going to be writing code that is going to just plain suck. -
RE: what does '?' mean in the following statement[ Go to top ]
- Posted by: Bruce Blackshaw
- Posted on: November 03 2004 12:11 EST
- in response to Grim Shieldsson
Hilariously, I worked with someone on a project who didn't know this most basic stuff.
In a typical JSP of his, he got the url as a string and manually parsed it to extract the parameters. And he assumed the order of the parameters was fixed! I've never seen anything like it! -
what does '?' mean in the following statement[ Go to top ]
- Posted by: Udayan Patel
- Posted on: November 01 2004 12:38 EST
- in response to Thien Loc Le Minh
? saperates URL and list of parameters. where as & saperates each parameter. -
what does '?' mean in the following statement[ Go to top ]
- Posted by: Udayan Patel
- Posted on: November 01 2004 12:40 EST
- in response to Udayan Patel
BTW, This is an example of HTTP GET method. Post shouldn't have this type of list. -
what does '?' mean in the following statement[ Go to top ]
- Posted by: null
- Posted on: November 02 2004 06:53 EST
- in response to Thien Loc Le Minh
Take a look at the following URL to understand HTTP URL submission:
http://www.cs.tut.fi/~jkorpela/forms/methods.html