tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eduardo Pelegri--Llopart <Eduardo.Pelegrillop...@eng.sun.com>
Subject Re: Creating Your Own Implicit Objects
Date Tue, 27 Jun 2000 00:16:55 GMT
The JSP 1.1 spec suggested an action like <me:defineObjects/> ... See
section 5.8.1.

	- eduard/o

"Craig R. McClanahan" wrote:
> 
> Jon Baer wrote:
> 
> > Hi,
> >
> > This is more of a programming question using Tomcat, I am interested in how to
> > accomplish via JSP/Servlet 2.2 on how to create your own implicit objects in a
> > page.  Does anyone have any reference for this or a piece of code that shows it
> > being done?  Im told you can do it though a taglib but I havent seen it in an
> > examples.
> >
> 
> You can indeed create new implicit objects in a custom tag (portable across any
> servlet 2.2/JSP 1.1 container, not just Tomcat).  For just one example, check out
> the <struts:enumerate> tag (Java class is org.apache.struts.taglib.EnumerateTag)
in
> the Struts framework project at <http://jakarta.apache.org/struts>.  It creates
an
> implicit object for the current element of a collection that is visible to other
> tags (and scriptlets) on the current page, as well as allowing you to loop through
> all the elements of an Enumeration or an array.
> 
> If you are using an architecture that forwards to a JSP page (using
> RequestDispatcher.forward), you should also know that there is a direct
> correspondence between the attributes models for servlets and JSP pages:
> 
> * Request attributes (servlet) == request scope beans (JSP)
> * Session attributes (servlet) == session scope beans (JSP)
> * ServletContext attributes (servlet) == application scope beans (JSP)
> 
> This correspondence makes it very easy to share information between the various
> servlets and JSP pages in your web application.
> 
> >
> > Thanks.
> >
> > - Jon
> >
> 
> Craig McClanahan
> 
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org

Mime
View raw message