Kevin Jones wrote:
> You can populate beans with data in a number of ways - when the bean is
> first constructed you can use the setProperty tags, if the bean alread
> exists you can write a scriptlet (usually in Java) to call methods on the
> bean - if you've followed the bean guidelines these will be setXXX methods
> where XXX is the name of the property.
>
> Beans can be 'stored' by the jsp engine, depending on what you are doing you
> will need to have the bean stored in the 'request', 'session' or
> 'application.' So if you are calling one JSP page from another (using the
> requestDispatcher) store the bean in a session. If you want the bean stored
> across calls from the user, use the session object, and if you want the bean
> stored for all users put in in the application object, so
>
> <jsp:useBean id="fred" class="com.somebean.Bean", scope="session">
> <jsp:setProperty name="myProp", value="0" />
> </jsp:useBean>
>
> <%
> out.write("value of bean is " + fred.getMyProp());
> %>
It's ok. But i need set some Bean properties from request object.
Or maybe what my Bean can know current request? I need know
request.getRemoteHost() (for sample) for hide logic from jsp and move it
to Bean.
And if i have two (or more) Beans on one page. Can beans share
parameters (or maybe bean1 can use bean2 as member? Of course i interest
if properties of bean1 and bean2 set automatical by jsp engine. For
sample:
<jsp:useBean id="b1" class="com.somebean.Bean1", scope="session">
</jsp:useBean>
<jsp:useBean id="b2" class="com.somebean.Bean2", scope="session">
</jsp:useBean>
Thank you.
Eugen Kuleshov.
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".