I have next situation. Guess I'm stupidwith this code, but at all can not handle it myself.
web.xml I need dispatcher servlet to handle requests from starting from root path (/*)
I also would use Tiles.Code:<servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>/*</url-pattern> </servlet-mapping>
definitions.xml
servlet-context.xmlCode:<definition name="catalog.default" template="pages/home.jsp"> <put-attribute name="header" value="pages/common/header.jsp" /> <put-attribute name="menu" value="pages/common/menu.jsp" /> <put-attribute name="footer" value="pages/common/footer.jsp" /> <put-attribute name="search" value="pages/body/statistic-info.jsp" /> </definition>
Code:<bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.TilesConfigurer"> <property name="definitions" value="/WEB-INF/definitions.xml"/> </bean> <bean id="tilesViewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.tiles2.TilesView"/> </bean>
my controller
Code:@Controller public class HomeController { @RequestMapping(value = "/", method = RequestMethod.GET) public ModelAndView home() { ModelAndView mv = new ModelAndView(); mv.setViewName("catalog.default"); return mv; } }
I've got
Tried to configure in different ways and also not only with JSP.Code:org.springframework.web.servlet.PageNotFound.noHandlerFound No mapping found for HTTP request with URI [/pages/home.jsp] in DispatcherServlet with name 'dispatcher'
Also tried Freemarker with the same result.
Looks like Spring view resolvers works only parallel, they could handle different views.
But could not handle view after view.
And all this only for <url-pattern>/*</url-pattern>.
If I used diferent path (example: /test/*) all will works, this is because dispatcher servlet doesn't handle pages path.
What I did wrong?
How could I use url-path "/*" with tiles and pages?
folder pages placed not in WEB-INF but in root directory.
Code:project-home - js\ - css\ - pages\ - WEB-INF\


with this code, but at all can not handle it myself.
Reply With Quote