3)URL RewritingIn URL rewriting, we append a token or identifier to the URL of the next Servlet or the next resource. We can send parameter name/value pairs using the following format: url?name1=value1&name2=value2&?? A name and a value is separated using an equal = sign, a parameter name/value pair is separated from another parameter using the ampersand(&). When the user clicks the hyperlink, the parameter name/value pairs will be passed to the server. From a Servlet, we can use getParameter() method to obtain a parameter value. Advantage of URL Rewriting
Disadvantage of URL Rewriting
Example of using URL RewritingIn this example, we are maintaning the state of the user using link. For this purpose, we are appending the name of the user in the query string and getting the value from the query string in another page. index.htmlFirstServlet.javaSecondServlet.javaweb.xmldownload this example (developed using Myeclipse IDE) download this example (developed using Eclipse IDE) download this example (developed using Netbeans IDE) Next TopicHttp Session In Session Tracking |