jakarta-taglibs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kris Schneider <k...@dotech.com>
Subject Re: Plugging in Implicit Objects
Date Wed, 21 Jan 2004 14:52:06 GMT
Back to the tag approach for a second. It looks like the Portlet Spec mandates
the existence of the "portlet tag library". If you do something like:

<%@ taglib prefix="portlet" uri="http://java.sun.com/portlet" %>

Then you get:

renderRequest:  RenderRequest (extends PortletRequest)
renderResponse: RenderResponse (extends PortletResponse)
portletConfig:  PortletConfig

Does that help any? BTW, the <taglib:defineObjects/> action is the recommended
style for defining new implicit objects.

Quoting Kris Schneider <kris@dotech.com>:

> I'm not that familiar with the portlet spec, but I assume a filter could also
> be
> used to create your attribute maps. No tags needed and the filter can apply
> to
> every request so it's not tied to JSP.
> Quoting Eric W Hauser <ehauser@indiana.edu>:
> > I've got some portlet projects coming up, and the one thing the bothers
> me
> > is that fact that EL expressions in JSPs are not easy to use.  A quick
> > background of the problem: Each portlet has its own PortletRequest,
> > PortletSession, and PortletContext objects which are just extensions of
> > HttpServletRequest, HttpSession, and ServletContext objects.  Accessing 
> > these objects from a JSP using requires a container specific tag that
> > makes them available in the page context.  I would like to be able to
> > access them using EL expressions.
> > 
> > I've been trying to come up with a workaround and came up with a couple
> of
> > solutions.  First, I could just define a tag (i.e.
> > <p:initPortletObjects/>) that would just make the attributes of these
> > objects available in a Map that is stored in the PageContext.  Then, they
> > called be accessed by ${pageScope.portletRequest.attribute}.  However,
> the
> > downside to doing this is that I would have to run this tag on every page
> > and it would be creating objects that may not get used.  My other option
> > was to build my own version of the tag libraries and add these as
> > implicit objects so that they could be resolved by the expression
> > evaluator.  
> > 
> > I was thinking that there should be an easier way to accomplish this, but
> > the spec doesn't define a way to plugin implicit objects.  I'm
> > sure there would be other instances were this could be useful.  Just
> > wondering if any had any thoughts/suggestions.
> > 
> > -------------------
> > Eric Hauser
> > ehauser@indiana.edu
> -- 
> Kris Schneider <mailto:kris@dotech.com>
> D.O.Tech       <http://www.dotech.com/>

Kris Schneider <mailto:kris@dotech.com>
D.O.Tech       <http://www.dotech.com/>

To unsubscribe, e-mail: taglibs-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-dev-help@jakarta.apache.org

View raw message