Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

parameter to a bean

Status
Not open for further replies.

sweng

Programmer
Jun 2, 2003
10
IN
hi,

How do I pass parameter to a method written in a bean.
I need to perform the query on the database using a bean
based on the parameter that is passed to the bean.
 
What is calling the bean class ? Servlet, JSP ??
 

Tell the JSP about the bean class to use ::
<jsp:useBean id=&quot;pagebeanname&quot; scope=&quot;session&quot; class=&quot;YourBeanClassName&quot; />

Set a bean property ::
<jsp:getProperty name=&quot;pagebeanname&quot; property=&quot;yourBeanVariable&quot; value=&quot;someValue&quot;/>&quot; >

Get a bean property ::
<jsp:getProperty name=&quot;pagebeanname&quot; property=&quot;yourBeanVariable&quot;/>&quot; >
 
Sorry, cut-and-paste typo, should be ::

Set a bean property ::
<jsp:setProperty name=&quot;pagebeanname&quot; property=&quot;yourBeanVariable&quot; value=&quot;someValue&quot;/>

Get a bean property ::
<jsp:getProperty name=&quot;pagebeanname&quot; property=&quot;yourBeanVariable&quot;/>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top