-
Apr 20th, 2009, 10:47 PM
#1
Spring MVC with Tiles2
Hi,
I started using Spring MVC only recently and ran into a problem when using it with Tiles2. Problem is if I have a url like http://mydomain.com/myapp/public/about.htm, and I configure the myapp-servlet.xml as below:
<bean name="/public/about.htm" class="org.springframework.web.servlet.mvc.Paramet erizableViewController ">
<property name="viewName" value="about" />
</bean>
And tiles config as:
<definition name="main" template="WEB-INF/jsp/templates/main.jsp">
<put-attribute name="title" value="My App" type="string" />
<put-attribute name="header" value="/WEB-INF/jsp/templates/header.jsp" />
<put-attribute name="footer" value="/WEB-INF/jsp/templates/footer.jsp" />
<put-attribute name="menu" value="/WEB-INF/jsp/templates/menu2.jsp" />
</definition>
<definition name="about" extends="main">
<put-attribute name="content" value="/WEB-INF/jsp/public/about.jsp" />
But Tiles seems to be searching for the page elements with 'public/' prefixed to all paths like /public/WEB-INF/jsp...."
Log trace:
13:39:19,725 DEBUG org.springframework.web.servlet.handler.BeanNameUr lHandlerMapping:176 - Mapping [/public/about.htm] to handler 'org.springframework.web.servlet.mvc.Parameterizab leViewController@b5d05b'
13:39:19,726 DEBUG org.springframework.web.servlet.DispatcherServlet: 970 - Last-Modified value for [/myapp/public/about.htm] is: -1
13:39:19,726 DEBUG org.springframework.web.servlet.DispatcherServlet: 781 - DispatcherServlet with name 'myapp' processing request for [/myapp/public/about.htm]
13:39:19,727 DEBUG org.springframework.beans.factory.support.DefaultL istableBeanFactory:1367 - Invoking afterPropertiesSet() on bean with name 'about'
13:39:19,728 DEBUG org.springframework.web.servlet.DispatcherServlet: 1181 - Rendering view [org.springframework.web.servlet.view.tiles2.TilesV iew: name 'about'; URL [about]] in DispatcherServlet with name 'myapp'
13:39:19,729 DEBUG org.apache.tiles.impl.BasicTilesContainer:568 - Render request recieved for definition 'about'
13:39:19,729 DEBUG org.apache.tiles.impl.BasicTilesContainer:603 - Dispatching to definition path 'WEB-INF/jsp/templates/main.jsp '
13:39:19,730 DEBUG org.apache.catalina.core.ApplicationDispatcher:143 - servletPath=/public/WEB-INF/jsp/templates/main.jsp, pathInfo=null, queryString=null, name=null
13:39:19,731 DEBUG org.apache.catalina.core.ApplicationDispatcher:370 - Path Based Forward
13:39:19,732 DEBUG org.apache.jasper.servlet.JspServlet:247 - JspEngine --> /public/WEB-INF/jsp/templates/main.jsp
13:39:19,733 DEBUG org.apache.jasper.servlet.JspServlet:248 - ServletPath: /public/WEB-INF/jsp/templates/main.jsp
13:39:19,733 DEBUG org.apache.jasper.servlet.JspServlet:249 - PathInfo: null
13:39:19,734 DEBUG org.apache.jasper.servlet.JspServlet:250 - RealPath: F:\Tomcat\Tomcat 5.5\webapps\myapp\public\WEB-INF\jsp\templates\main.jsp
13:39:19,735 DEBUG org.apache.jasper.servlet.JspServlet:251 - RequestURI: /myapp/public/WEB-INF/jsp/templates/main.jsp
13:39:19,735 DEBUG org.apache.jasper.servlet.JspServlet:252 - QueryString: null
13:39:19,736 DEBUG org.apache.jasper.servlet.JspServlet:253 - Request Params:
13:39:19,737 DEBUG org.apache.catalina.core.ApplicationDispatcher:407 - Disabling the response for futher output
13:39:19,737 DEBUG org.apache.catalina.core.ApplicationDispatcher:415 - The Response is vehiculed using a wrapper: org.springframework.security.context.HttpSessionCo ntextIntegrationFilter$OnRedirectUpdateSessionResp onseWrapper
13:39:19,739 DEBUG org.springframework.web.servlet.DispatcherServlet: 591 - Successfully completed request
Can some one please suggest what's going on here?
Many Thanks,
Riri
Last edited by riri; Apr 20th, 2009 at 10:50 PM.
-
Apr 24th, 2009, 01:29 PM
#2
You have to configure the view resolver to property prefix/postfix your request. Post your servlet config if you need more help than that.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules