Manomohan K Kalathil wrote:

> Hi
>         I am jsu trying to reduce my learning time . Can I do this in JSP
> 1.0
>         ...
>         ...
>
>         <jsp:useBean id="mybean" scope="page" class="pack1.AccessBean" />
>         <% mybean.createMessage() %>
>         ...
>         ..
>
> Regards
>
> Mano.
>

Yes.  The useBean action, among other things, creates a local variable in the
servlet that is generated from your page, named whatever you set the ID
attribute to, and initializes it to the bean that was either created or
located for you.  Therefore, as long as createMessage() is valid in the
pack1.AccessBean class, then the above code is legal.

When learning JSP, one technique that helps a lot is to set the
keepgenerated=true initialization parameter on the JSP servlet, and then
examining the Java code that is generated.  Besides learning more about how
JSP works, this can also help you learn about techniques that are useful in
your own servlets as well.

Craig McClanahan

===========================================================================
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".

Reply via email to