Has anybody ever noticed that if you declare a bean class member variable
with an uppercase first letter, the setter and getter methods for than
variable don't work?
e.g. in the Bean you might have...
String MyString() = new String();
void setMyString(String tempString){
MyString = temString;
}
With this JSP in your page
<jsp:setProperty name="myInstance" property="MyString" value="textfiled1"
/>
or
<% myInstance.setMyString(value); %>
Glenn
> -----Original Message-----
> From: Hamid Mukhtar [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 10, 2001 6:06 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Session scope
>
>
> Thanks for telling the capitalization rules in beans. I will
> care next time.
>
> Hamid Mukhtar
>
> -----Original Message-----
> From: A mailing list about Java Server Pages specification
> and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Jann VanOver
> Sent: Tuesday, July 10, 2001 1:02 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Session scope
>
>
> You ALSO need the line:
> <jsp:useBean id="MyBean" class="MyClass" scope="session"/>
> on page 2 before the getProperty line.
>
> That's how you tell page 2 that the bean is available in
> session scope.
>
> By the way: to follow common style guidelines, your bean id
> should not be
> capitalized. Capital names are for classes. So you should use:
>
> <jsp:useBean id="myBean" class="MyClass" scope="session"/>
> <jsp:setProperty name="myBean" property="someProperty"
> value="someValue"/>
>
> -----Original Message-----
> From: Hamid Mukhtar [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 09, 2001 11:13 AM
> To: [EMAIL PROTECTED]
> Subject: Session scope
>
>
> Hi JSP developers,
> I've got a question:
> Suppose, I want to use a bean for session scope.So I
> write in page
> 1:
> <jsp:useBean id="MyBean" class="MyClass" scope="session"/>
> <jsp:setProperty name="MyBean" property="someProperty"
> value="SomeValue"/>
>
> Then I can click on a link on page1 which refers to page 2,
> where I use:
> <jsp:getProperty name="MyBean" property="someProperty"/>
>
> However the bean is not recognised there, and generates error.
> Is this approach correct for using a bean for session
> or there is
> some
> error. Please help me(or provide some reference/url).
> Thanks,
> Hamid Mukhtar
>
> ==============================================================
> =============
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> 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".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> 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".
> For digest: mailto [EMAIL PROTECTED] with body: "set
> JSP-INTEREST DIGEST".
> 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".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
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