cancel
Showing results for 
Search instead for 
Did you mean: 

How to varify JSP form field values at servlet level

Former Member
0 Kudos

Dear All

I am new to Java world. Currently I am working on ICSS application.

Frontend is designed using JSP, and form values goes to servlet and then servlet fetch the data using form values from backend and send it back to JSP page.

Servlet is not used to print anything,

I want to check the form field values at servlet, can any one let me know how can I check those form values at servlet as well as the values which are being seding back to JSP.

Your help is highly appreciated !!!

Best Regards

Bhavishya

Accepted Solutions (0)

Answers (2)

Answers (2)

prashil
Advisor
Advisor
0 Kudos

Hi Bhavishya,

If you are using the NWDS and SAPWAS then you can easily debug the form values. You need to first set the J2EE engine in debug mode.

Once it is set you can debug you servlet in NWDS.

To recieve a form value from JSP, you can use, request object

String value = request.getParameter("<name of field>");

and then you can set the breakpoints to this statement.

so whenever your application calls the servlet it will halt at this place and allow to check the value of String value.

If you are not using NWDS,

then only way to check the value is to use System.out/out.print.

to check the value at runtime.

Hope this help!!!

Please feel free to query!!!

Regards,

Prashil

Former Member
0 Kudos

Hi,

so you are submitting your JSP page to a servelt. so in the servlet you can make use of

String str = request.getParameter("<parametername>");

request will be availble in the life cycle method of the

servlet and this parameter name should be with the form control name . There should be a submit page name in the form tag in the JSP page.

<form name="XXX" submit="yyy">

Let me know any more info you need.

regards

Vivek Nidhi