how to pass parameter from servlet to html form
Answers were Sorted based on User's Feedback
Answer / shymax
Either use beans ...or use session.setAttribute
("Yourpara",paravalue) in Servlet and ..get in HTML in
Scriplet as session.getAttribute("Yourpara");
Hope this solve the problem
| Is This Answer Correct ? | 13 Yes | 4 No |
Answer / haneef
By the Hidden form fields..
we can set the name and values here
<input type="hidden" name="uName" value="xxx" />
this way, u can send u r parameters to html
(or) by cookies
Cookie c1=new Cookie("uName","xxx");
response.addCookie(c1);
| Is This Answer Correct ? | 8 Yes | 1 No |
Answer / amit ghosh
its simple... use request diapatcher
RequestDispatcher rd = request.getRequestDispatch("url?
newparam=newvalue");
rd.forward(request, response);
| Is This Answer Correct ? | 9 Yes | 2 No |
Answer / sachin s
You can also use HtppSessio, create a new session variable
and set the value and get the same value in HTML. However
this should be avoided if you want to pass to many
parameters.
Also,remember that Session variable should be flushed off
after the use, thats a good practise.
| Is This Answer Correct ? | 4 Yes | 3 No |
What is filter? Can filter be used as request or response?
What is URL Rewriting ?
What do you mean by a filter and how does it work?
What is the life cycle of a servlet?
When using servlets to build the HTML, you build a DOCTYPE line, why do you do that?
Describe the phases of servlet lifecycle?
What is the purpose of inter-servlet communication?
What is the difference between the http servlet and generic servlet?
How to find whether a parameter exists in the request object?
Directive Include and Action Include how both are working in JSP, what is the difference between both?In which suituation we have to choose these elements?
Given the request path below, which are context path, servlet path and path info? /bookstore/education/index.html
What are the exceptions thrown by servlets? Why?