I am an avid proponent of Spring and Spring MVC.  I even developed a custom
framework for my company that incorporates Spring.  I have not attempted to
integrate Magnolia and Spring MVC, but my initial thought would be that they
are not compatible.  Both of them provide controllers and attempt to capture
URIs and make processing decisions based upon URIs.  Unless you were to
modify the Magnolia source, I don't think you can integrate them.  I suggest
the following courses of action:

1) Use Spring (but not Spring MVC) within your templates to support
datasource access, cross-cutting concerns (IoC), loose-coupling of
components, etc.
2) Build Spring MVC apps and run them alongside magnolia as separate web
apps within the same server.  Link between them and reference the respective
applications when necessary. I do this for my company's intranet.  A Spring
MVC app is used to provide a news management console that writes to a
database.  I then have templates that read from that database and display
news articles.
3) Get really ambitious and re-engineer Magnolia to operate within the
Spring Framework. ;)

Best of luck!

-KG


-----Original Message-----
From: Aditya Poosarla [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 18, 2005 9:59 AM
To: [email protected]
Subject: [magnolia-user] Problems Integrating Magnolia with Spring MVC

Hi,

I am trying to integrate magnolia with spring MVC. I made a template which
includes another jsp which has <spring:bind> tag's in it. When I try to
access a page made using this template I get a class cast exception. If I
remove the spring tags completely from the included page the template is
shown fine. I am using magnolia 2.1 and resin as my server.

I can access the included page directly and it also works fine in which case
it is handled by the spring servlet

The exception I get is
ERROR  org.springframework.web.servlet.tags.BindErrorsTag
RequestContextAwareTag.java(doStartTag:75) 18.10.2005 10:56:48
java.lang.ClassCastException
        at
org.springframework.web.servlet.support.RequestContext.getFallbackLocale(Req
uestContext.java:248)
        at
org.springframework.web.servlet.support.JspAwareRequestContext.getFallbackLo
cale(JspAwareRequestContext.java:95)
        at
org.springframework.web.servlet.support.RequestContext.initContext(RequestCo
ntext.java:212)
        at
org.springframework.web.servlet.support.JspAwareRequestContext.initContext(J
spAwareRequestContext.java:74)
        at
org.springframework.web.servlet.support.JspAwareRequestContext.<init>(JspAwa
reRequestContext.java:48)
        at
org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(Reque
stContextAwareTag.java:65)
        at
_jsp._templates._jsp._corp._careers__jsp._jspService(_careers__jsp.java:507)
        at com.caucho.jsp.JavaPage.service(JavaPage.java:60)
        at com.caucho.jsp.Page.pageservice(Page.java:570)
        at
com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:159
)
        at
com.caucho.server.webapp.DispatchFilterChain.doFilter(DispatchFilterChain.ja
va:115)
        at
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:
208)
        at
com.caucho.server.webapp.RequestDispatcherImpl.forward(RequestDispatcherImpl
.java:268)
        at
com.caucho.server.webapp.RequestDispatcherImpl.forward(RequestDispatcherImpl
.java:106)
        at info.magnolia.cms.Dispatcher.dispatch(Dispatcher.java:79)
        at
info.magnolia.cms.servlets.EntryServlet.doGet(EntryServlet.java:141)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:115)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:92)
        at
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.ja
va:99)
        at
info.magnolia.cms.filters.SecurityFilter.doFilter(SecurityFilter.java:73)
        at
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java
:70)
        at
info.magnolia.cms.filters.MultipartRequestFilter.doFilter(MultipartRequestFi
lter.java:80)
        at
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java
:70)
        at
info.magnolia.cms.filters.ContentTypeFilter.doFilter(ContentTypeFilter.java:
65)
        at
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java
:70)
        at
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:1
63)
        at
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:
208)
        at
com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:259)
        at com.caucho.server.port.TcpConnection.run(TcpConnection.java:363)
        at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:490)
        at com.caucho.util.ThreadPool.run(ThreadPool.java:423)
        at java.lang.Thread.run(Thread.java:534)
ERROR  info.magnolia.cms.servlets.EntryServlet EntryServlet.java(doGet:144)
18.10.2005 10:56:48 java.lang.ClassCastException
        at
org.springframework.web.servlet.support.RequestContext.getFallbackLocale(Req
uestContext.java:248)
        at
org.springframework.web.servlet.support.JspAwareRequestContext.getFallbackLo
cale(JspAwareRequestContext.java:95)
        at
org.springframework.web.servlet.support.RequestContext.initContext(RequestCo
ntext.java:212)
        at
org.springframework.web.servlet.support.JspAwareRequestContext.initContext(J
spAwareRequestContext.java:74)
        at
org.springframework.web.servlet.support.JspAwareRequestContext.<init>(JspAwa
reRequestContext.java:48)
        at
org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(Reque
stContextAwareTag.java:65)
        at
_jsp._templates._jsp._corp._careers__jsp._jspService(_careers__jsp.java:507)
        at com.caucho.jsp.JavaPage.service(JavaPage.java:60)
        at com.caucho.jsp.Page.pageservice(Page.java:570)
        at
com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:159
)
        at
com.caucho.server.webapp.DispatchFilterChain.doFilter(DispatchFilterChain.ja
va:115)
        at
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:
208)
        at
com.caucho.server.webapp.RequestDispatcherImpl.forward(RequestDispatcherImpl
.java:268)
        at
com.caucho.server.webapp.RequestDispatcherImpl.forward(RequestDispatcherImpl
.java:106)
        at info.magnolia.cms.Dispatcher.dispatch(Dispatcher.java:79)
        at
info.magnolia.cms.servlets.EntryServlet.doGet(EntryServlet.java:141)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:115)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:92)
        at
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.ja
va:99)
        at
info.magnolia.cms.filters.SecurityFilter.doFilter(SecurityFilter.java:73)
        at
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java
:70)
        at
info.magnolia.cms.filters.MultipartRequestFilter.doFilter(MultipartRequestFi
lter.java:80)
        at
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java
:70)
        at
info.magnolia.cms.filters.ContentTypeFilter.doFilter(ContentTypeFilter.java:
65)
        at
com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java
:70)
        at
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:1
63)
        at
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:
208)
        at
com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:259)
        at com.caucho.server.port.TcpConnection.run(TcpConnection.java:363)
        at com.caucho.util.ThreadPool.runTasks(ThreadPool.java:490)
        at com.caucho.util.ThreadPool.run(ThreadPool.java:423)
        at java.lang.Thread.run(Thread.java:534)

Thanks,
Aditya

----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------

----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------

Reply via email to