Forum Stats

  • 3,853,880 Users
  • 2,264,288 Discussions
  • 7,905,491 Comments

Discussions

how to request a hidden field value on servlet with post method?

903603
903603 Member Posts: 3
edited Dec 6, 2011 3:22AM in Java Servlet
hi,

i am trying to get a hiddenField value on servlet but i am getting a null value, how to solve this?

my jsp code look like this:

<form action="ImageResizeServlet" method="post">
<input type="hidden" id="pageWidth" name="pWidth"></input>
</form>

and my servlet code look like this:

protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
try {
String s=request.getParameter("pWidth");
....


what to do?
thank you.

Answers

This discussion has been closed.