Is it possible to call servlet with parameters in the URL?

Answer Posted / muhammad farhaan

If HTML form submitted with Get request to servlet URL
which is defined in action attribute of HTML form then form
values are sent as a name value pairs appended at the end of
URL calling servlet. List of parameters is separated by ?
sign with rest of URL and paramter are append to the list of
paramter as name value pair separated by & sign. You can
manually attach the paramters as a list of name value pairs
separated by & sign at the end of query string followed by ?
sign.
The maximum length of URL changes across the browser
generally you can not send more than 255 characters long URL
string so keep in mind that when you send paramters with URL
string then whole length of URL must not be more than 255
character.

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain get and post.

642


How to notify an object in session when session is invalidated or timed-out?

624


What is meant by session? Tell me something about httpsession class?

594


What is difference between jsp and servlet?

636


What are the mechanisms used by a servlet container for maintaining session information?

556






What are the steps involved in placing a servlet within a package?

580


Explain the methods of request dispatcher in servlet?

507


What is a deployment descriptor?

592


Which java application server is the best?

542


Why HttpServlet class is declared abstract?

642


What is context in servlet?

532


How to rectify errors in java servlet while compilation?

514


What is a servlet?

605


Can you explain in detail 'javax.servlet' package?

540


Why doesn’t a servlet include main()? How does it work?

624