Girish Haran wrote:
>
> I would like to know what mechanisms are currently supported by JSP1.0
> to share data between parent and child JSPs. (I typically have a master
> JSP that delegate to other component child JSP to render specific areas
> of the screen. The component JSP are used to assemble master pages
> rapidly ) From reading the "Core Syntax Ref", I thought that by simply
> declaring a reference variable in the parent JSP, it would become
> available to the entire "translation unit" ( which I guess should
> include all child JSP ). This is not the case in the WebLogic
> implementation.
>
> I could use <jsp:usebean > (JavaBeans) but I'm trying to leverage my
> existing "model" classes (my version of bean classes that unfortunately
> don't comply 100% to the JavaBeans spec) to rapidly change the front end
> to JSP. Also, if I did "beanify" my models, is there any way to get hold
> of the bean object ref in JSP so that I can invoke any public method
> that I want?
The component used for sharing data in JSP is a bean. The <jsp:useBean>
action lets you place the bean in a certain scope: page, request,
session or application. If the bean is only needed in one page, use the
default page scope. To share a been between pages invoked through
<jsp:forward> or <jsp:include>, use the request scope. If you need access
to the bean when processing a series of request from the same user you
use the session scope. Finally, if you need access to data no matter
which user is making the request, you can use application scope beans.
No matter which scope you use, the bean is always available for scripting
elements as a variable with the name you specify as the id attribute
in the <jsp:useBean> action.
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html