Hope this helps....
Snippet in JSP
==========
<jsp:useBean id="file_reader"class="textfileaccess.TextFileReader"
scope="session"/>
This will tell the compiler that we will use a bean, how we are going to
identify it, and what class we will instansiate. The scope means that the
named object is available from the current page's HttpSession Object.
<jsp:setProperty name="file_reader" property="FileName"/>
Then we decide which of the Bean property that is to be set. In this case it
is "FileName", since we want to use the setFileName method in the Bean. The
name of the Bean must be included as well.
Note that FileName is the form element name.
<form method=get>< /FONT>
FileName? <input type=text name= FileName>< /FONT>
<input type=submit value="Show it!">
</form>
The snippet in TextFileReader.java
=======================
/**
* Returns the filename.
*/
public String getFileName() {
return fileName;
}
/**
* Sets the filename.
*/
public void setFileName(String fileName) {
this.fileName = fileName;
}
Regds
Veena
----- Original Message -----
From: Rakesh Bhat <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 04, 2000 6:56 PM
Subject: Re: Syntax of setproperty
> In this context , could anyone tell me what does following statement does
?
>
> <jsp:setProperty name="myBean" property="*"/>
>
>
> Thx
> Rakesh
>
>
> Hans Bergsten wrote:
>
> > 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
===========================================================================
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