"Shah, Mayank (RSCH)" wrote:
>
> I'm not sure if this is the correct place for technical questions. If it
> isn't then, please inform me of the correct location.
>
> Can someone tell me why the following does not set the bean property. I
> print out the value someone else on the page from the request object and
> shows that the session value is set, but the bean property is not set.
>
> <HTML>
>
> <USEBEAN name="user" type=beans.User lifespan=session>
> <SETONCREATE BEANPROPERTY="userId" VALUE= <%=
> Request.getSession().getValue("user_id") %> >
> </USEBEAN>
>
> ....
> Try 2
>
> <HTML>
>
> <USEBEAN name="user" type=beans.User lifespan=session>
> <SETONCREATE BEANPROPERTY="userId" VALUE= <%
> Request.getSession().getValue("user_id") %> >
> </USEBEAN>
>
> ....
> Try 3
>
> <HTML>
>
> <USEBEAN name="user" type=beans.User lifespan=session>
> <SETONCREATE BEANPROPERTY="userId" VALUE= "<%
> Request.getSession().getValue("user_id") %>" >
> </USEBEAN>
>
Well the answer is fairly simple. You are trying to set a "dynamic"
value on your property which to my knowledge is not possible with the
actual specification. Anyway, if you look at what you have written, you
have a Jsp tag ( <% %>) into another Jsp tag (<SETONCREATE>), which
means some recursivity...
I tend to think that it can be very usefull in some situations like this
one:
<!--# include file="/dir/<DISPLAY PROPERTY="info:myFile">" -->
that's why I have implemented this kind of thing in my own
implementation... I would like to publish my implementation as Open
Source (and I am ready to do it), but I am waiting for my company for
their approval, legal stuf... blah blah blah... So if anyone has any
idea on how to speed up the process that would be great!
To do what you really want to do here, you should implement the
processRequest method (in your beans.User class) and do the jobj
inside...
Yan
--
http://eowyn.fr.eu.org/~yan/ | [EMAIL PROTECTED]
SocialNet: Where people connect... http://www.socialnet.com
===========================================================================
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".