Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Amit Roy
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic