wood burning stoves 2.0*
The moose likes JSP and the fly likes how to access out and request parameters from a JSP page into a bean URGENT Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » JSP
Bookmark "how to access out and request parameters from a JSP page into a bean URGENT" Watch "how to access out and request parameters from a JSP page into a bean URGENT" New topic
Author

how to access out and request parameters from a JSP page into a bean URGENT

Amit Roy
Ranch Hand

Joined: Oct 10, 2000
Posts: 132
hello friends
I have a JSP page where i am doing request.getParameternames() i want to do the same thing in a bean how can i do it URGENT


<I>Chance Favours the Prepared minds"</I>
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12791
    
    5
There is nothing to prevent you from calling a bean method with the request object or any other object that the JSP knows about. You just have to write your bean code that way.
Bill
Carl Trusiak
Sheriff

Joined: Jun 13, 2000
Posts: 3340
There are several answers. Bill is correct, you could write the bean to have a method which recieves the request or out objects.
The classic answer for request parameters is to provide a setXXX for every parameter on the submit and set them in your bean with a simple call to
< jas:setProperty name="beanName" property="*" />
There isn't a simple way to do that for the out Object hawever. The canned answer that you find is simply refactor your bean into a JSP Taglib. The Tag package has access to all the implicate Objects on a JSP page through the use of the PageContext object.


I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
 
GeeCON Prague 2014
 
subject: how to access out and request parameters from a JSP page into a bean URGENT