From: Phil Hedley@MITEL on 10/16/2000 01:27 PM GDT
Hi Louis,
This does not appear to work :-
[snip]
>If you want to use setProperty, then your field name (or parameter name)
>must same as the bean property name. E.g, if you have a textfield which name
call
>SurName, in your bean you must have setSurName(String name).
[snip]
I have a bean property name and field name called 'username'.
setProperty will work if I have a setUsername() or setusername() method in the
bean.
However, it will NOT work when I change the bean property name AND field name to
mixed case e.g. 'Username'.
Any other ideas why this is happening ?
Phil Hedley
Louis <[EMAIL PROTECTED]> on 16/10/2000 12:32:47
Please respond to A mailing list about Java Server Pages specification and
reference <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
cc: (bcc: Phil Hedley/Cal/Mitel)
Subject: Re: Help - problem using <jsp:setProperty
> Hi all,
>
> I'm using the following directive in a jsp page
>
> <jsp:useBean id="fH" class="SambaUsers" scope="session"/>
> <jsp:setProperty name="fH" property="*"/>
>
> This would NOTcall the set method in my java bean. After hours of code
changing
> I managed to
> get it to work by changing my bean properties and corresponding form names
to
> lowercase,
> where previously I was using mixed case.
There is no problem with using mixing case.
> Could someone please tell me the correct rules for naming the bean
properties
> and get/set methods.
If you want to use setProperty, then your field name (or parameter name)
must same as
the bean property name. E.g, if you have a textfield which name call
SurName, in your
bean you must have setSurName(String name).
> I have read various pieces of conflicting literature.. From my own
experience it
> seems that the safest
> way is to put the bean properties and get/set methods into lowercase, is
this
> correct ?
May be, I'm not sure.
Another thing is, where you put your
<jsp:useBean id="fH" class="SambaUsers" scope="session"/>?
<jsp:setProperty name="fH" property="*"/>
You must put these in the second page.
Hope this help.
Louis
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets