|
From: William G. T. Jr. <wg...@ru...> - 2004-08-12 22:22:37
|
Nick Lothian wrote: >>Nick Lothian wrote: >> >>>Should I be able to use the spring tag library within a Portlet? >> >>It should, but as you have found out it does not at the moment. >> >>The intent is to have all the WebMVC View technology available in >>PortletMVC. However, much of the View technology is dependent on >>specifics of the Servlet API. To get around this we wrote a "bridge" >>Servlet which PortletMVC delegates to for rendereing. This >>works ok for >>simple JSTL views and allows one to use the Portlet taglib. >> >>The problem now is that <spring:bind ...> is dependendant upon >>WebApplicationContext...which is not available in PortletMVC, >>so we'll >>have to figure out a way to also "bridge" the taglib. >>Essentially if we >>are running in PortletMVC we need the tablibs to look for >>PortletApplicationContext instead of WebApplicationContext or come up >>with an abstraction for both and refactor the tablib. >> >>later. >>Bill >> >> > > > Why can't PortletApplicationContext inherit from WebApplicationContext? Maybe it can. Though I do not believe the ServletContext is meant to be directly available to Portlets the way the PortletApplicationContext and the PortletContext are and visa versa. > > Logically it would make sense - the portlet specification leaverages the > servlet spec, even if there are no interfaces shared between the > specifications. While the portlet spec does leverage the servlet container, the APIs differ enough to make it difficult to support to Spring WebMVC directly. Which is why we currently have the View Servlet bridge. The main goal is to provide MVC framework similar to Spring WebMVC for the Portlet API. Portlets can be thought of as Servlets with additional lifecycle and constraints. They are essentially web applications with defined "modes" and are restricted to outputting markup that can be embedded in a final document. Portlets benefit from PortletMVC the same way Servlets benefit from WebMVC and a Spring layered architecture. The starting pointing was to create a DispatcherPortlet, the analog of DispatcherServlet. This initially led to the creation of many mirror objects from o.s.web.servlet.*. I simply ported many objects to the web.portlet.* package with the ServletAPI dependencies replaced with the PortletAPI. This madness would have led to duplicating the View support as well had it not been for Juergen's design proposal: http://opensource.atlassian.com/confluence/spring/display/JSR168/SpringPortlet+module+design+discussion To get the spring tag libs to work in this model it looks like we need to make them aware of and compatible with the View bridge, or provide PortletMVC specific implementations. Thoughts? later. Bill |