// JP opened flex table

Click to See Complete Forum and Search --> : Problem retrieving request parameters


manucomp
July 22nd, 2008, 12:20 PM
Hi

I have written code for uploading attachment. For that I have created one jsp and a servlet. I have used multipart/form-data as encoding type in the form tag on the jsp page. There is one hidden field and a text field on that page. On submitting that form the request goes to the servlet. I am trying to retrieve these fields in the servlet class using getParameter() method. But i am unable to do that. Even when i am setting any attribute in the request object using method setAttribute() and retrieving it using getAttribute() in the servlet, I am not able to do. Although the file which i am attaching, i am able to upload.
Can anyone help me...

Thanks
Manucomp

compavalanche
July 22nd, 2008, 03:33 PM
I would first try to enumerate all the parameters that you are seeing.

Maybe you have a type or case issue?

Here is an example of how to print the variables:

<code>
for(Object name: request.getParameterMap().keySet())
{
System.out.println((String) name);
}
</code>

Note: you could of used the enumeration instead but I like the for ( : ) syntax better.

If your not seeing your form values then make sure you are posting. tools like Firebug or live http headers can help you see what data your actually posting back.

Hope that helps!

koma_love
July 25th, 2008, 11:09 AM
There are many factors .Maybe the problems about *.jar files,or the server,and so on .
May I have look at your codes?

//JP added flex table