dcsimg
How do I access request attributes from a bean?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   David_Stevenson
Posted On:   Friday, November 16, 2001 09:17 AM

I have a JSP with a form with multiple fields, all dynamically generated so I don't know the names of the fields in advance. I want to pass the field names and values to a bean to process them. I originally used myBean.processForm(request.getParameterMap()) but I can't use that when running Tomcat 3.2.3 which doesn't support it. I tried to pass request.getQueryString() but it passes all escaped characters too, which I don't want. I can't pass request.getParameter() as I need the values too. I think the easiest way would be to process the request.getParameter() and request.getParameterValues() from inside the bean, but I don't know how to access them if I don't pass them in as a parameter. Can anyone help?    More>>

I have a JSP with a form with multiple fields, all dynamically generated so I don't know the names of the fields in advance. I want to pass the field names and values to a bean to process them. I originally used

myBean.processForm(request.getParameterMap())
but I can't use that when running Tomcat 3.2.3 which doesn't support it.

I tried to pass
request.getQueryString()
but it passes all escaped characters too, which I don't want. I can't pass
request.getParameter()
as I need the values too.

I think the easiest way would be to process the
request.getParameter()
and
request.getParameterValues()
from inside the bean, but I don't know how to access them if I don't pass them in as a parameter. Can anyone help?

Thanks


David Stevenson

   <<Less

Re: How do I access request attributes from a bean?

Posted By:   Richard_Braun  
Posted On:   Saturday, November 17, 2001 03:41 AM

use javax.servlet.ServletRequest.getParameterNames()
to get the parameter names list in an Enumeration object.


Then call them with request.getParameter().


R. Braun

About | Sitemap | Contact