You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Calin Duma <cd...@ecologic.net> on 2001/04/12 15:36:55 UTC

issues with setProperty="*"

Hello,

I am having trouble with the following jsp action:

File: search.jsp (an HTML form)

<jsp:useBean
 id="searchAttributes" scope="request"
 class="mypackage.CustomerSearchBean">
 <jsp:setProperty name="searchAttributes" property="*" />
</jsp:useBean>

The CustomerSearchBean has attributes that match the form field names in
search.jsp.  It does not exist in request scope under the
"searchAttributes" keyword - so I expect it to be created by the JSP.

The servlet that receives the form post request can't find an attribute
in the request scope associated to the "searchAttributes" keyword:

CustomerSearchBean bAtt = (mypackage.CustomerSearchBean)
req.getAttribute("searchAttributes");
    if(bAtt == null) {
      logger.log("No REQUEST ATTRIBUTE FOUND", true); // i get this
    }


I am trying to automatically populate the bean with the fields that were
entered by the user, rather than interrogate the request parameters for
each specific field.  According to the JSP spec, the property='*' should
accomplish exactly this (on forward to a JSP should fill up the fields -
and on dispatch from the JSP should create and populate the bean).  

Any ideas on what am I doing wrong ?

Thanks,

Calin