Web tier: servlets, JSP, Web frameworks: what does '?' mean in the following statement
- Posted by: Thien Loc Le Minh
- Posted on: October 31 2004 23:36 EST
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 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
- 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 null on November 02 2004 06:53 EST
The ? and & are the standard ways of passing parameters in HTTP.
You can collect the parameters up within a servlet with something like
Website Uptime and Availability | Permission Email List Management | Smartphone GPS | All Time Top 100 Rock Charts
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.
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!
? saperates URL and list of parameters. where as & saperates each parameter.
BTW, This is an example of HTTP GET method. Post shouldn't have this type of list.
Take a look at the following URL to understand HTTP URL submission: