|
From: Nick L. <nl...@es...> - 2004-08-11 04:44:04
|
Should I be able to use the spring tag library within a Portlet?
I'm using the sandbox portlets code. When I try and use a <spring:bind ...>
tag I get
java.lang.IllegalStateException: No WebApplicationContext found: not in a
DispatcherServlet request?
at
org.springframework.web.servlet.support.RequestContextUtils.getWebApplicatio
nContext(RequestContextUtils.java:81)
at
org.springframework.web.servlet.support.RequestContextUtils.getWebApplicatio
nContext(RequestContextUtils.java:58)
at
org.springframework.web.servlet.support.RequestContext.<init>(RequestContext
.java:91)
at
org.springframework.web.servlet.support.RequestContext.<init>(RequestContext
.java:77)
at
org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(Reque
stContextAwareTag.java:85)
at
org.apache.jsp.WEB_002dINF.jsp.portlet.edit_jsp._jspService(edit_jsp.java:13
5)
at
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
When I start up my webapp I get:
INFO: Loading XML bean definitions from resource
[/WEB-INF/applicationContext.xml] of ServletContext
11/08/2004 14:04:28
org.springframework.context.support.AbstractXmlApplicationContext
refreshBeanFactory
INFO: Bean factory for application context [Root XmlWebApplicationContext]:
org.springframework.beans.factory.support.DefaultListableBeanFactory
defining beans
[messageSource]; Root of BeanFactory hierarchy
11/08/2004 14:04:28
org.springframework.context.support.AbstractApplicationContext refresh
INFO: 1 beans defined in ApplicationContext [Root XmlWebApplicationContext]
11/08/2004 14:04:28
org.springframework.beans.factory.support.AbstractBeanFactory getBean
...
INFO: Published root WebApplicationContext
[org.springframework.web.context.support.XmlWebApplicationContext:
displayName=[Root XmlWebApplicationContext]; startup date=[Wed Aug 11
14:08:53 CST 2004]; root of ApplicationContext hierarchy; config
locations=[/WEB-INF/applicationContext.xml]; ] as ServletContext
attributewith name [interface
org.springframework.web.context.WebApplicationContext.ROOT]
Later, when I hit the portlet for the first time I get
INFO: Loading XML bean definitions from resource
[/WEB-INF/content-portlet-portlet.xml] of PortletContext
11/08/2004 14:09:00
org.springframework.context.support.AbstractXmlApplicationContext
refreshBeanFactory
INFO: Bean factory for application context [XmlPortletApplicationContext for
namespace 'content-portlet-portlet']:
org.springframework.beans.factory.support.DefaultListableBeanFactory
defining beans
[viewResolver,defaultControllerMapping,portletModeNameViewController,editCon
troller,contentViewerController,contentResolver];
parent=<org.springframework.beans.factory.support.DefaultListableBeanFactory
defining beans [messageSource]; Root of BeanFactory hierarchy>11/08/2004
14:09:00 org.springframework.context.support.AbstractApplicationContext
refresh
...
INFO: Published PortletApplicationContext of portlet 'content-portlet' as
PortletContext attribute with name
org.springframework.web.portlet.FrameworkPortlet.CONTEXT.content-portlet]
I'm not an experienced Spring user, so it's probabaly something fairly
obvious I'm missing. I've based my app on the example spring portelt app,
and it all works fine except for this. Any help would be appreciated.
('ve attached my applicationContext.xml and content-portlet-portlet.xml
config files)
Nick
|