Announcement Announcement Module
Collapse
No announcement yet.
ModelAndView can't find tiles definitions Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • ModelAndView can't find tiles definitions

    Hi,

    I'm triyng to use ModelAndView inside of a MultiActionController in order to redirect to a Tiles defined page. But, the MultiaAction is redirecting to a path with the same name as the tiles name.
    Ex:
    Code:
    public ModelAndView list(HttpServletRequest request, HttpServletResponse response){
    		Collection news = manager.listAll(); 
    		return new ModelAndView(".tiles.news.list", "news-list", news);
    	}
    1. I access the URL mapped to the list method("/news/list"). This is working fine.
    2. When the ModelAndView(".tiles.news.list"... is instanced, the MultiAction redirects to that URL:
    "/news/.tiles.news.list").
    I was expecting for the JSP mapped in the tiles-def.xml with the key ".tiles.news.list"


    I'm using SimpleUrlHandlerMapping as the URL Handler and the TilesJstlView as the view resolver.

    Best regards,

    Franklin Samir
    www.portaljava.com

  • #2
    can you post your full spring web application context config file.

    Comment


    • #3
      Hi,

      this is my main xxx-servlet.xml file:
      Code:
      <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
      		<property name="viewClass">
      			<value>org.springframework.web.servlet.view.tiles.TilesJstlView</value>
      		</property>
      	</bean>
      <bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles.TilesConfigurer">
      		<property name="definitions">
      			<list>
      				<value>/WEB-INF/conf/tiles/tiles-defs.xml</value>
      	  			<value>/WEB-INF/conf/tiles/core-tiles-defs.xml</value>		
      			</list>
      		</property>
      	</bean>
      My applicationContext.xml has no Tiles configurations , like you can see below:
      Code:
        <bean id="multipartResolver" 
          	class="org.springframework.web.multipart.commons.CommonsMultipartResolver"/>
          <bean id="messageSource"     	class="org.springframework.context.support.ResourceBundleMessageSource">
              <property name="basename">
                  <value>org.javanuke.core.resources.application</value>
              </property>
          </bean>
          <bean id="logInterceptor" class="org.javanuke.core.aop.LoggingInterceptor">
      	</bean>
          <bean id="webErrorInterceptor" class="org.javanuke.core.aop.WebErrorInterceptor">
      	</bean>
          
          <bean id="managersBeanNameProxyCreator" class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">
              <property name="beanNames">
                  <value>*Manager,logsEveryThing</value>
              </property>
              <property name="interceptorNames">
                  <list>
                      <value>webErrorInterceptor</value>
                  </list>
              </property>
          </bean>
      Today I'm trying to use Sitemesh instead Tiles.
      If you wanna see the entire source code, please look at:
      https://jnuke.dev.java.net/source/browse/jnuke/

      Comment

      Working...
      X