What is the difference between using
href="../usermanagement/search_user.jsp?"
and
href="../usermanagement/search_user.jsp?pagename=navigation"
in file navigation.jsp
?
Its name is query string. After the question mark you can pass key-value pairs and use them server-side.
It is a query to pass paramters. ?pagename=navigation
passes the value 'navigation' to the pagename
parameter.
The question mark ("?", ASCII 3F hex) is used to delimit the boundary between the URI of a queryable object, and a set of words used to express a query on that object. When this form is used, the combined URI stands for the object which results from the query being applied to the original object.
Source: w3.org - syntax for URIs as used in the WorldWide Web initiative
Whenever we want to pass some parameter to JSP then we simply append "?" question mark after the JSP URL, and after that we mentioned the parameter name and its value.
"../usermanagement/search_user.jsp?
" means you did not get any parameter on this JSP file.
"../usermanagement/search_user.jsp?pagename=navigation
" with this URL you can get the value of the pagename parameter on JSP as by using this syntax:
String pagenNameValue=request.getParameter("pagename");
You will get "navigation" as the pageNameValue parameter value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With