tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sayre Robert <say...@rappdigital.com>
Subject RE: Strange bean problem in JSP
Date Wed, 03 Apr 2002 20:54:05 GMT
You should check the capitalization of your bean properties:
is it "eMail" or "EMail"? 

the jsp tag: <jsp:setProperty name="dataBean" property="eMail"/>
calling the set method: dataBean.setEMail( request.getParameter( "eMail" )
);

I would try <jsp:setProperty name="dataBean" property="EMail"/>.

Robert Sayre



-----Original Message-----
From: Nikola Milutinovic [mailto:Nikola.Milutinovic@ev.co.yu]
Sent: Wednesday, April 03, 2002 3:46 PM
To: Tomcat Users List
Subject: Strange bean problem in JSP


Hi all.

I have a strange bean problem in my JSP page.

The bean in question has several properties, most of them are R/W. Anyway,
those 
that I'm trying to set from the request parameters are R/W.

My problem is that one of the properties *refuses* to be set. That is
"eMail". 
Others, like "name", "surname" and "mailBox" are set just fine.

These are the tests I've tried:

------------------------------------------
<jsp:useBean id="dataBean" class="EUserBean" scope="request">
   <jsp:setProperty name="dataBean" property="*"/>
</jsp:useBean>
------------------------------------------

This sets all properties except "eMail"

------------------------------------------
<jsp:useBean id="dataBean" class="EUserBean" scope="request">
   <jsp:setProperty name="dataBean" property="*"/>
   <jsp:setProperty name="dataBean" property="eMail"/>
</jsp:useBean>
------------------------------------------

This produces an exception:

2002-04-03 13:01:46 StandardWrapperValve[jsp]: Servlet.service() for servlet
jsp 
threw exception org.apache.jasper.JasperException: Cannot find any
information 
on property 'eMail' in a bean of type 'EUserBean'
         at 
org.apache.jasper.runtime.JspRuntimeLibrary.internalIntrospecthelper(JspRunt
imeLibrary.java, 
Compiled Code)
         at 
org.apache.jasper.runtime.JspRuntimeLibrary.introspecthelper(JspRuntimeLibra
ry.java, 
Compiled Code)
....

However, this succedes and produces the desired result (setting of "eMail" 
property):

<jsp:useBean id="dataBean" class="EUserBean" scope="request">
   <jsp:setProperty name="dataBean" property="*"/>
</jsp:useBean>
<%
dataBean.setEMail( request.getParameter( "eMail" ) );
%>

I know I can use this as a workaround, but I'd like to know what the real 
problem is.

TYIA,
Nix.


--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message