|
|
My first TIles 2 attempt integration, have question ...
Hi, let me first show you my configurations
tiles.xml
Code:
lt;?xml version=quot;1.0quot; encoding=quot;ISO-8859-1quot; ?gt;
lt;!DOCTYPE tiles-definitions PUBLIC quot;-//Apache Software Foundation//DTD Tiles Configuration 2.0//ENquot; quot;dtds/tiles-config_2_1.dtdquot;gt;
lt;tiles-definitionsgt;
lt;definition name=quot;base.definitionquot; template=quot;/WEB-INF/tiles/layout.jspquot;gt; lt;put-attribute name=quot;titlequot; value=quot;quot; /gt; lt;put-attribute name=quot;headerquot; value=quot;/WEB-INF/tiles/header.jspquot; /gt; lt;put-attribute name=quot;menuquot; value=quot;/WEB-INF/tiles/menu.jspquot; /gt; lt;put-attribute name=quot;bodyquot; value=quot;quot; /gt; lt;put-attribute name=quot;footerquot; value=quot;/WEB-INF/tiles/footer.jspquot; /gt; lt;/definitiongt; lt;definition name=quot;contactquot; extends=quot;base.definitionquot;gt; lt;put-attribute name=quot;titlequot; value=quot;Contact Detailsquot; /gt; lt;put-attribute name=quot;bodyquot; value=quot;/WEB-INF/views/contact.jspquot; /gt; lt;/definitiongt; lt;definition name=quot;indexquot; extends=quot;base.definitionquot;gt; lt;put-attribute name=quot;bodyquot; value=quot;/WEB-INF/views/index.jspquot; /gt; lt;/definitiongt; lt;definition name=quot;categoryquot; extends=quot;base.definitionquot;gt; lt;put-attribute name=quot;bodyquot; value=quot;/WEB-INF/views/categoryItems.jspquot; /gt; lt;/definitiongt;
lt;definition name=quot;productquot; extends=quot;base.definitionquot;gt; lt;put-attribute name=quot;bodyquot; value=quot;/WEB-INF/views/productDetails.jspquot; /gt; lt;/definitiongt;
lt;definition name=quot;basketquot; extends=quot;base.definitionquot;gt; lt;put-attribute name=quot;bodyquot; value=quot;/WEB-INF/views/shoppingBasket.jspquot; /gt; lt;/definitiongt;
lt;definition name=quot;errorquot; extends=quot;base.definitionquot;gt; lt;put-attribute name=quot;bodyquot; value=quot;/WEB-INF/views/error.jspquot; /gt; lt;/definitiongt;
lt;/tiles-definitionsgt;
servlet-config.xml
Code:
lt;bean class=quot;org..web.servlet.view.InternalResourceViewResolverquot;gt; lt;property name=quot;prefixquot; value=quot;/WEB-INF/views/quot;/gt; lt;property name=quot;suffixquot; value=quot;.jspquot;/gt;
lt;/beangt;
lt;bean id=quot;viewResolverquot; class=quot;org..web.servlet.view.uclBasedViewResolverquot;gt; lt;property name=quot;viewClassquot;gt; lt;valuegt;org..web.servlet.view.tiles2.TilesView lt;/valuegt; lt;/propertygt;
lt;/beangt;
lt;bean id=quot;tilesConfigurerquot; class=quot;org..web.servlet.view.tiles2.TilesConfigurerquot;gt; lt;property name=quot;definitionsquot;gt; lt;listgt;lt;valuegt;/WEB-INF/defs/tiles.xmllt;/valuegt; lt;/listgt; lt;/propertygt;
lt;/beangt;
web.xml
Code:
lt;?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?gt;
lt;web-app xmlns:xsi=quot;2001/XMLSchema-instancequot; xmlns=quot;xml/ns/javaeequot; xmlns:web=quot;xml/ns/javaee/web-app_2_5.xsdquot; xsi:schemaLocation=quot;xml/ns/javaee xml/ns/javaee/web-app_2_5.xsdquot; version=quot;2.5quot;gt;
lt;filtergt; lt;filter-namegt;springSecurityFilterChainlt;/filter-namegt; lt;filter-classgt;org..web.filter.DelegatingFilterProxylt;/filter-classgt; lt;/filtergt; lt;filter-mappinggt; lt;filter-namegt;springSecurityFilterChainlt;/filter-namegt; lt;ucl-patterngt;/*lt;/ucl-patterngt; lt;/filter-mappinggt;
lt;context-paramgt; lt;param-namegt;contextConfigLocationlt;/param-namegt; lt;param-valuegt;/WEB-INF/spring/onlinebasket-webapp-config.xmllt;/param-valuegt; lt;/context-paramgt;
lt;listenergt; lt;listener-classgt;org..web.context.ContextLoaderListenerlt;/listener-classgt; lt;/listenergt;
lt;servletgt; lt;servlet-namegt;onlinebasketlt;/servlet-namegt; lt;servlet-classgt;org..web.servlet.DispatcherServletlt;/servlet-classgt; lt;init-paramgt;lt;param-namegt;contextConfigLocationlt;/param-namegt;lt;param-valuegt; /WEB-INF/spring/onlinebasket-servlet-config.xmllt;/param-valuegt; lt;/init-paramgt; lt;/servletgt;
lt;servlet-mappinggt; lt;servlet-namegt;onlinebasketlt;/servlet-namegt; lt;ucl-patterngt;/onlinebasket/*lt;/ucl-patterngt; lt;/servlet-mappinggt;
lt;welcome-file-listgt; lt;!-- Redirects to quot;index.htmlquot; for dispatcher handling --gt; lt;welcome-filegt;index.jsplt;/welcome-filegt; lt;/welcome-file-listgt;
lt;/web-appgt;
i have index.jsp on WEB-INF root
Code:
lt;%@ taglib prefix=quot;cquot; uri=quot;jstl/corequot; %gt;
lt;%-- Redirected because we can't set the welcome page to a virtual ucl. --%gt;
lt;c:redirect ucl=quot;/index.htmlquot;/gt;
and the another index.jsp on WEB-INF/views. When i load the application, i get
Code:
from Status 404 - /onlinebasket/index.html
type Status report
message /onlinebasket/index.html
description The requested resource (/onlinebasket/index.html) is not available.
not even sure if tiles are loaded? |
|