there is another way to set the value too.
suppose u want to set the value of a parameter in bean equals to the value
of a parameter passed by another form then u can write setproperty like
this:
<jsp:setProperty name="myBean" property="method" param="<param name>" />
suppose the parameter name is custId.
<jsp:setProperty name="myBean" property="method" param="custId" />
remember no getParameter etc statements.
Hans Bergsten <[EMAIL PROTECTED]> on 07/04/2000 07:16:34 AM
Please respond to A mailing list about Java Server Pages specification and
reference <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
cc: (bcc: Kher Tamanna-SWD-ITIL-UB/Itilmail)
Subject: Re: Syntax of setproperty
Paras Sharma wrote:
>
> hello
>
> can some one tell me the syntax of set property of bean in JSP
> i have bean as mybean with method as
> setMethod(String str) {...}
> thanks in advance
I'm not sure if this is what you ask for, but you can use the
<jsp:setProperty> action to set a bean property. With your example,
it could look like this:
<jsp:useBean name="myBean" class="com.company.MyBean" />
<jsp:setProperty name="myBean" property="method" value="Hello!" />
The <jsp:useBean> action creates the bean, <jsp:setProperty> sets the
property.
For information about syntax and how to use JSP, I recommend that you
buy a book and/or read the specification online:
<http://java.sun.com/products/jsp/>
Hans
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
===========================================================================
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