How values can be passed from HTML page to servlet?

Answers were Sorted based on User's Feedback



How values can be passed from HTML page to servlet?..

Answer / shivom srivastava

We can use BEAN's getters and setters to get the the value
from the html pages.
At least in case of struts we do the same

Is This Answer Correct ?    7 Yes 0 No

How values can be passed from HTML page to servlet?..

Answer / venkat

Using QueryString

Is This Answer Correct ?    7 Yes 1 No

How values can be passed from HTML page to servlet?..

Answer / satya

there are two ways in passing form data to a servlet

in case of the form using GET method
-------------------------------------

the form data is appended as a query string after the
end of the url in the address bar of the browser

in case of the form using POST method
--------------------------------------
the form data is added to the body part of the Http
protocol request body .this form data is called as payload

Is This Answer Correct ?    6 Yes 0 No

How values can be passed from HTML page to servlet?..

Answer / samsudeen

Using <form tag>
ex : <form action=controller method=post>

The action controller is mapping in web.xml.

Is This Answer Correct ?    7 Yes 2 No

How values can be passed from HTML page to servlet?..

Answer / mani

The values passed through the HttpRequest object.

Example:
request.getParameter("Key Value given in the
JSP/HTML Page");

Is This Answer Correct ?    3 Yes 0 No

How values can be passed from HTML page to servlet?..

Answer / saikiran

we have methods like
String st=ServletRequest.getParameter(String );
Enumeration en=ServletRequest.getParameterNames(String);
ServletRequest.getParameterValues(int value);

Is This Answer Correct ?    4 Yes 2 No

How values can be passed from HTML page to servlet?..

Answer / dadhich

we can pass the values to servlet through from HTML Page as follows:-
create a form --> define <form action=Ser>

where Ser is a servlet java class in which we want to retrieve the value.in web-xml in <servlet> tag class name will be defined.

In Ser.java we can retrieve the value by writing as follows:

String login=request.getParameter("login");

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More Servlets Interview Questions

How to handle the debug errors in servlets?

2 Answers  


What is the difference between encodeRedirectUrl and encodeURL?

0 Answers  


When the methods init() and Distroy() will be called?

2 Answers  


What is ServletContext object?

0 Answers  


Hi............ When i am started the tomcat server it started. but it not load the jar files wht we deploving file.suppose we load the wapp folder in webapps. At running time it show the below error in tomcat server INFO: validateJarFile(C:\Program Files\Apache Software Foundation\Tomcat 5.0\web apps\wapp\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, s ection 9.7.2. Offending class: javax/servlet/Servlet.class How to slove this problem in my system. plz give answer for this problem.

5 Answers  






How to make sure a servlet is loaded at the application startup?

0 Answers  


How can we include static files in the jsp page?

0 Answers  


init() method of servlet loaded by?

3 Answers  


What is servlet and its types?

0 Answers  


What is the difference between the include() and forward() methods?

0 Answers  


How do we translate jsp?

0 Answers  


What is servlet used for?

0 Answers  


Categories