Next state is not getting called in spring web flow - spring-webflow

I have Spring 3 application having Tiles2 as view resolver. Whenever I am clicking on "submit" button next jsp page should be displayed but it stays on same page.
I have a file WebFlow.xml file inside /WEB-INF/flow directory and JSPs are also in same folder.
My configuration as follows:
-servlet.xml
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:flow="http://www.springframework.org/schema/webflow-config"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/webflow-config
http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.0.xsd">
<mvc:annotation-driven/>
<context:component-scan base-package="com.controller.*"/>
<bean id="tilesViewResolver" class="org.springframework.web.servlet.view.tiles2.TilesViewResolver"/>
<bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
<property name="definitions">
<list>
<value>/WEB-INF/tiles.xml</value>
</list>
</property>
</bean>
<flow:flow-executor id="flowExecutor" flow-registry="flowRegistry"/>
<flow:flow-registry id="flowRegistry">
<flow:flow-location path="/WEB-INF/flow/WebFlow.xml" id="flow"/>
</flow:flow-registry>
<bean id="flowHandlerMapping" class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping">
<property name="flowRegistry" ref="flowRegistry"/>
</bean>
<bean id="flowHandlerAdapter" class="org.springframework.webflow.mvc.servlet.FlowHandlerAdapter">
<property name="flowExecutor" ref="flowExecutor"/>
</bean>
</beans>
WebFlow.xml
<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow-2.0.xsd">
<var name="studentRegForm" class="com.formbean.flows.StudRegForm"/>
<view-state id="login" view="login">
<transition on="studentReg" to="studentReg"/>
</view-state>
<view-state id="studentReg" view="studentReg" model="studentRegForm">
<transition on="submitStudInfo" to="studConfirmPage"/>
</view-state>
<view-state id="studConfirmPage">
<transition on="submit" to="showStoredPage"/>
<transition on="Cancel" to="studentReg"/>
</view-state>
<end-state id="showStoredPage"/>
</flow>
login.jsp
<sf:form id="loginFrm" modelAttribute="loginForm" method="GET" action="${flowExecutionUrl}">
<input type="text" name="_flowExecutionKey" value="${flowExecutionKey}"/>
<input type="submit" value="Student Registration" name="_eventId_studentReg"/>
</sf:form>
StudentReg.jsp
<sf:form id="studRegFrm" modelAttribute="studentRegForm" method="GET" action="${flowExecutionUrl}">
<input type="text" name="_flowExecutionKey" value="${flowExecutionKey}"/>
<table>
<tr>
<td><sf:label path="name">Please Enter Name:</sf:label></td>
<td><sf:input path="name"/></td>
</tr>
<tr>
<td><sf:label path="address">Please Enter Address:</sf:label></td>
<td><sf:input path="address"/></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="_eventId_submitStudInfo" value="Submit"/></td>
</tr>
</table>
</sf:form>
tiles.xml
<tiles-definitions>
<definition name="mainLayout" template="/WEB-INF/jsp/layout/mainLayout.jsp">
<put-attribute name="Title" value=""/>
<put-attribute name="Header" value="/WEB-INF/jsp/layout/Header.jsp"/>
<put-attribute name="Body" value=""/>
<put-attribute name="Footer" value="/WEB-INF/jsp/layout/Footer.jsp"/>
</definition>
<definition name="login" extends="mainLayout">
<put-attribute name="Title" value="Start Page"></put-attribute>
<put-attribute name="Body" value="/WEB-INF/flow/login.jsp"/>
</definition>
<definition name="studentReg" extends="mainLayout">
<put-attribute name="Title" value="Registration Page"></put-attribute>
<put-attribute name="Body" value="/WEB-INF/flow/StudentReg.jsp"/>
</definition>
</tiles-definitions>
But whenever I am clicking on submit button of login.jsp, it gives ${flowExecutionUrl} & ${flowExecutionKey} as blank and next screen is not displaying. Am I missing some configuration or what's going wrong? Please help.

#Aasif your configuration 'looks' fine. SWF is notoriously un-intuitive to trouble shoot. Try inserting a logger into your flows like this:
Printing log from flow.xml
and determine where the the 'flow' execution is being interrupted. Once you isolate the location. Try to step into the flow code... I suspect an exception is being swallowed.
Possible Answer:
If I had to guess (even though your config looks correct). I would suspect SWF/tiles is NOT resolving the view name 'studentReg'. Try isolate this case by creating a separate flow and see if you can navigate to the view studentReg. You can also step into the Tiles resolver logic to make sure it is being located.
Also:
In my opinion, it is bad practice to give the same name to your viewStateId, transition, and viewName (i.e 'studentReg'). I think it makes trouble shooting more difficult when issues like this arise. Better to append a suffix to them. (i.e studentRegVsId, studentRegViewName, etc...) to create a distinction.

Related

Spring mvc: Controller Result resent to RequestMappingHandlerMapping

I have an abstract Spring Controller class extended by various controllers.
Example method:
#Override
#RequestMapping(value = { "/", "" }, method = RequestMethod.GET)
public String getAllAsView(#RequestParam(required = false) boolean ajax,
Model m) {
String mapping = elementClass.getSimpleName();
m.addAttribute(mapping + "List", getAll());
return mapping + "All" + (ajax ? "Ajax" : "");
}
These are the relevant definitions in my view.xml:
<definition name="maintemplate" template="/WEB-INF/views/main_template.jsp">
<put-attribute name="top" value="/WEB-INF/views/header.jsp" />
<put-attribute name="side" value="/WEB-INF/views/menu.jsp" />
</definition>
<definition name="ajaxtemplate" template="/WEB-INF/views/ajax_template.jsp">
<put-attribute name="top" value="/WEB-INF/views/header.jsp" />
</definition>
<definition name="PersonAll" extends="maintemplate">
<put-attribute name="content" value="/WEB-INF/views/personlist.jsp" />
</definition>
<definition name="PersonAllAjax" template="ajaxtemplate">
<put-attribute name="content" value="/WEB-INF/views/personlist.jsp" />
</definition>
With the ajax parameter only the body content is to return.
Everything works fine without the ajax parameter.
But with the Ajax parameter the return string is used for a new Controller request.
This is the Log:
DEBUG: org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Looking up handler method for path /person/6
TRACE: org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod - Invoking [PersonController.getAsView] method with arguments [6, true, {}]
WARN : de.kreth.clubhelperbackend.aspects.DaoLoggerAspect - de.kreth.clubhelperbackend.dao.PersonDao.getById(6) ==> 6: M Kreth
TRACE: org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod - Method [getAsView] returned [PersonGetAjax]
DEBUG: org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping - Looking up handler method for path /person/ajaxtemplate
This is the servlet-context.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<context:component-scan base-package="de.kreth.clubhelperbackend" />
<mvc:annotation-driven>
<mvc:message-converters>
<bean
class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
<property name="objectMapper">
<bean
class="org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean">
<property name="dateFormat">
<bean class="java.text.SimpleDateFormat">
<constructor-arg type="java.lang.String"
value="dd/MM/yyyy HH:mm:ss.SSS Z"></constructor-arg>
</bean>
</property>
</bean>
</property>
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
<mvc:resources mapping="/resources/**" location="/resources/" />
<bean
class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver" />
<bean class="org.springframework.web.servlet.view.tiles2.TilesViewResolver">
<property name="order" value="1" />
</bean>
<bean class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
<property name="definitions">
<list>
<value>/WEB-INF/views/**/views.xml</value>
</list>
</property>
</bean>
<bean
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="order" value="2" />
<property name="prefix" value="/WEB-INF/views/" />
<property name="suffix" value=".jsp" />
</bean>
I am stuck finding out what is happening here. I changed the template name and the new name was used for the request.
The problem came up, after I changed nearly all xml files in project. I inserted Doctype tag and changed schema definitions and stuff. Because that caused heavy problems I stepped back to a working version. Before that, the ajax parameter worked.
Ah - and I updated to java-version 1.6.
Any ideas why spring uses the templatename "ajaxtemplate" as a new request and sends it back to the controller?
Best regards
Markus
Stupid mistake: never programm past midnight:
<definition name="PersonAllAjax" template="ajaxtemplate">
<put-attribute name="content" value="/WEB-INF/views/personlist.jsp" />
</definition>
must be
<definition name="PersonAllAjax" extends="ajaxtemplate">
<put-attribute name="content" value="/WEB-INF/views/personlist.jsp" />
</definition>

Images/CSS/Styles in Tiles and Spring MVC in Included pages not working

Problem
I am developing an application using Spring 4.1.1 and Tiles 3.0.5. I could able to create Layout. When I add the Image tag directly in the layout.jsp, I could able to see the Images/CSS etc, but when I add same Image tag in the different JSP which is added as "attribute" to the Layout, then none of the resources is working.
"I can see error in console as
org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/abc/%3Cc:url%20value=%22/resources/images/slides/trial.jpg%22%20/%3E] in DispatcherServlet with name "abc".
Web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:spring/applicationContext-resource.xml
/WEB-INF/spring/applicationContext-base.xml
/WEB-INF/spring/applicationContext-dao.xml
</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>abc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/spring/applicationContext.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>abc</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
Application Context
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<beans:bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping" id="handlerMapping">
<beans:property name="alwaysUseFullPath" value="true"/>
</beans:bean>
<!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure -->
<!-- Enables the Spring MVC #Controller programming model -->
<annotation-driven />
<!-- Handles HTTP GET requests for /resources/** by efficiently serving up static resources in the ${webappRoot}/resources directory -->
<resources mapping="/resources/**" location="/resources/" />
<resources mapping="/styles/**" location="/resources/css" />
<resources mapping="/images/**" location="/resources/images"/>
<resources mapping="/js/**" location="/resources/js"/>
<resources mapping="/fonts/**" location="/resources/fonts"/>
<!-- Resolves views selected for rendering by #Controllers to .jsp resources in the /WEB-INF/views directory -->
<beans:bean id="tilesConfigurer"
class="org.springframework.web.servlet.view.tiles3.TilesConfigurer">
<beans:property name="definitions">
<beans:list>
<beans:value>/WEB-INF/tiles-defs/templates.xml</beans:value>
</beans:list>
</beans:property>
</beans:bean>
<beans:bean id="viewResolver"
class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<beans:property name="viewClass" value="org.springframework.web.servlet.view.tiles3.TilesView" />
</beans:bean>
<context:component-scan base-package="com.online.abc" />
</beans:beans>
Tiles Definition
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
"http://tiles.apache.org/dtds/tiles-config_2_0.dtd">
<tiles-definitions>
<definition name="baseLayout" template="/WEB-INF/views/layout/layout.jsp">
<put-attribute name="title" value="abc" />
<put-attribute name="header" value="/WEB-INF/views/layout/header.jsp" />
<put-attribute name="navigation" value="/WEB-INF/views/layout/navigation.jsp" />
<put-attribute name="slider" value="/WEB-INF/views/layout/slider.jsp"/>
<put-attribute name="body" value="" />
<put-attribute name="footer" value="/WEB-INF/views/layout/footer.jsp" />
</definition>
<definition extends="baseLayout" name="login">
<put-attribute name="title" value="SivaLabs : Login" />
<put-attribute name="navigation" value="" />
<put-attribute name="body" value="/WEB-INF/views/login.jsp" />
</definition>
<definition extends="baseLayout" name="home">
<put-attribute name="title" value="SivaLabs : Welcome" />
<put-attribute name="body" value="/WEB-INF/views/home.jsp" />
</definition>
</tiles-definitions>
Layout.jsp
<!DOCTYPE html>
<%# taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%# taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><tiles:insertAttribute name="title" ignore="true" /></title>
<link rel="stylesheet" type="text/css" href='<c:url value="/resources/css/styles.css" />' />
<script src='<c:url value="/resources/js/jquery/jquery-2.1.3.min.js" />'> </script>
<script src='<c:url value="/resources/js/unslider/unslider.js" />'> </script>
</head>
<body class="body">
<div class="headerContent">
<header class="mainHeader">
<tiles:insertAttribute name="header" />
</header>
</div>
<tiles:insertAttribute name="slider" />
<%-- <content>
<tiles:insertAttribute name="body" />
</content> --%>
<%-- <footer>
<tiles:insertAttribute name="footer" />
</footer> --%>
</body>
</html>
Slider.jsp
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<script type="text/javascript">
$(function() {
$('.banner').unslider();
});
</script>
<body>
<div class="banner">
<ul>
<li><img src='<c:url value="/resources/images/slides/visa.jpg" />'></li>
</ul>
</div>
</body>
</html>
If I use same code of slider.jsp in layout.jsp, it is working.
I found solution but have no clue what is the problem. Found the solution from this link
JavaScript with Spring MVC doesn't work

How to load js and css file in Spring MVC 3 with tiles3

I am unable to load the Js and Css files in to jsp using Spring MVC 3 with tiles3. Can someone help me. Here the my configuration.
Project Folder Structure
-SpringWithTiles
----webapp
--------resouces
----------script
--------------js
---------------myscript.js
--------------css
---------------style.css
----WEB-INF
-------jsp
---------signIn.jsp
servlet.xml
<bean class="org.springframework.web.servlet.view.UrlBasedViewResolver" id="viewResolver">
<property name="viewClass">
<value>
org.springframework.web.servlet.view.tiles3.TilesView
</value>
</property>
</bean>
<bean id="tilesConfigurer"
class="org.springframework.web.servlet.view.tiles3.TilesConfigurer">
<property name="definitions">
<list>
<value>/WEB-INF/tiles.xml</value>
</list>
</property>
</bean>
<mvc:resources mapping="/resources/script/js/**" location="/webapp/resources/script/css" />
<mvc:resources mapping="/resources/script/css/**" location="/webapp/resources/script/js" />`
tiles.xml
<tiles-definitions>
<definition name="baseLayout" template="/WEB-INF/layout/simpleLayout.jsp">
<put-attribute name="title" value="" />
<put-attribute name="header" value="/WEB-INF/layout/header.jsp"/>
<put-attribute name="body" value="" />
<put-attribute name="footer" value="/WEB-INF/layout/footer.jsp" />
</definition>
<!-- <definition name="baseLayoutWithLeftPane" template="/jsp/layout
/layoutWithLeftPane.jsp">
<put-attribute name="title" value="Learn - Educate" />
<put-attribute name="header" value="/jsp/layout/header.jsp" />
<put-attribute name="navigation" value="/jsp/layout/navigation.jsp" />
<put-attribute name="body" value="" />
<put-attribute name="footer" value="/jsp/layout/footer.jsp" />
</definition>
<definition name="welcome" extends="baseLayoutWithLeftPane">
<put-attribute name="title" value="Learn - Educate" />
<put-attribute name="body" value="/jsp/home.jsp" />
</definition> -->
<definition name="siginIn" extends="baseLayout">
<put-attribute name="title" value="siginIn" />
<put-attribute name="body" value="/WEB-INF/jsp/siginIn.jsp" />
</definition>
web.xml
<servlet-mapping>
<servlet-name>babwitU</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>/index.jsp</welcome-file>
</welcome-file-list>
index.jsp
Click Here
Contoller.java
#RequestMapping("/redirectToSiginIn")
public ModelAndView siginIn(){
ModelAndView mav=new ModelAndView();
mav.setViewName("/siginIn");
return mav;
}
In servlet.xml change mapping like this location="/resources/script/css"
and give path from resources/fileNameToLoad where you want to load ur js or css
In location attribute give path from /resources/** not from /webapps/
The correct mapping should be:
<mvc:resources mapping="/resources/script/js/**" location="/resources/script/css" />
<mvc:resources mapping="/resources/script/css/**" location="/resources/script/js" />
The first / in the attribute location indicates the ${webappRoot} already.
My problem get resolved with following configuration.. thanks for all
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:web="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" id="WebApp_ID" version="2.4">
<display-name>babwitU</display-name>
<servlet>
<servlet-name>babwitU</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/coreJava.xml,/WEB-INF/home.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>babwitU</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>/index.jsp</welcome-file>
</welcome-file-list>
<!-- <listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener> -->
</web-app>
servelt.xml
<context:component-scan base-package="com.babwitU.life.dream.controller" />
<mvc:annotation-driven />
<bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<!-- <property name="location" value="classpath:jdbc.properties" /> -->
</bean>
<!-- <bean id="viewResolver"
class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp"></property>
<property name="suffix" value=".jsp"></property>
</bean> -->
<bean class="org.springframework.web.servlet.view.UrlBasedViewResolver" id="viewResolver">
<property name="viewClass">
<value>
org.springframework.web.servlet.view.tiles3.TilesView
</value>
</property>
</bean>
<bean id="tilesConfigurer"
class="org.springframework.web.servlet.view.tiles3.TilesConfigurer">
<property name="definitions">
<list>
<value>/WEB-INF/tiles.xml</value>
</list>
</property>
</bean>
<mvc:resources mapping="/resources/**" location="/resources/" />
controller.java
#RequestMapping(value ="redirectToSiginIn", method = RequestMethod.GET)
public ModelAndView viewSiginIn(){
ModelAndView mav=new ModelAndView();
mav.setViewName("siginIn");
return mav;
}
#RequestMapping(value ="home", method = RequestMethod.GET)
public ModelAndView viewHome(){
ModelAndView mav=new ModelAndView();
mav.setViewName("home");
return mav;
}
#RequestMapping(value ="java", method = RequestMethod.GET)
public ModelAndView viewJava(){
ModelAndView mav=new ModelAndView();
mav.setViewName("java");
return mav;
}
myjsp.jsp
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title> <tiles:getAsString name="title" ignore="true"></tiles:getAsString >
</title>
<!-- <script type="text/javascript" src="resources/script/js/appjs.js"></script>
--><link rel="stylesheet" type="text/css" href="resources/script/style.css">
</head>
<body>
folder structure
-springwithtiles
---webapp
-----resources
-------images
----------one.jpg
-------script
------------style.css
------------myjs.js
-----web-inf
--------jsp

Spring Web Flow 2 Setup, not rendering ${flowExecutionUrl} nor even starting

I am putting together a simple Spring MVC with Web Flow app and I cannot get it to render the flowExecutionUrl on a page so that I can navigate to the next state. Which I assume means the flow isn't starting(is there an explicit trigger?).
I'm assuming there is something wrong in my setup, although the logs suggest I am registering the flow.xml file correctly.
My spring config(mvc-dispatcher-servlet.xml) is:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:webflow="http://www.springframework.org/schema/webflow-config"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.1.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
http://www.springframework.org/schema/webflow-config
http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.3.xsd">
<context:component-scan base-package="com.intl.cigna.ecommerce.controller" />
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix">
<value>/WEB-INF/view/</value>
</property>
<property name="suffix">
<value>.jsp</value>
</property>
</bean>
<mvc:annotation-driven/>
<!-- Forwards requests to the "/" resource to the "welcome" view -->
<mvc:view-controller path="/" view-name="welcome"/>
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean">
<property name="persistenceUnitName" value="com.intl.cigna"/>
<!-- Configures Handler Interceptors -->
<mvc:interceptors>
<!-- Changes the locale when a 'locale' request parameter is sent; e.g. /?locale=de -->
<bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor" />
</mvc:interceptors>
<!-- Saves a locale change using a cookie -->
<bean id="localeResolver" class="org.springframework.web.servlet.i18n.CookieLocaleResolver" />
<!-- Application Message Bundle -->
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basename" value="/WEB-INF/messages/messages" />
<property name="cacheSeconds" value="0" />
</bean>
<!-- Enables FlowHandler URL mapping -->
<bean class="org.springframework.webflow.mvc.servlet.FlowHandlerAdapter">
<property name="flowExecutor" ref="flowExecutor" />
</bean>
<webflow:flow-executor id="flowExecutor" />
<!--
Maps request paths to flows in the flowRegistry; e.g. a path of
/hotels/booking looks for a flow with id "hotels/booking"
-->
<bean class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping">
<property name="flowRegistry" ref="flowRegistry" />
<property name="order" value="0" />
</bean>
<webflow:flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices">
<webflow:flow-location path="/WEB-INF/view/flow.xml" />
</webflow:flow-registry>
<webflow:flow-builder-services id="flowBuilderServices"
view-factory-creator="mvcViewFactoryCreator" />
<bean id="mvcViewFactoryCreator"
class="org.springframework.webflow.mvc.builder.MvcViewFactoryCreator">
<property name="viewResolvers" ref="viewResolver" />
</bean>
And my flow.xml is:
<?xml version="1.0" encoding="UTF-8"?>
<flow xmlns="http://www.springframework.org/schema/webflow"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/webflow
http://www.springframework.org/schema/webflow/spring-webflow.xsd">
<view-state id="step1" view="step1">
<transition on="next" to="step2"/>
<transition on="cancel" to="cancel"/>
</view-state>
<view-state id="step2" view="step2">
<transition on="previous" to="step1"/>
<transition on="finish" to="success"/>
<transition on="cancel" to="cancel"/>
</view-state>
<end-state id="success" view="flows/success"/>
<end-state id="cancel" view="flows/cancel"/>
</flow>
I can successfully navigate to the views.
And my jsp is:
<html>
<head>
<title>spring mvc web flow</title>
<link rel="stylesheet" href="<c:url value="/resources/css/demo_page.css"/>" type="text/css"></link>
<link rel="stylesheet" href="<c:url value="/resources/css/demo_table.css"/>" type="text/css"></link>
</head>
<body id="dt_example">
<div id="container">
<div>
<p class="notice">This is step 1 of the web flow</p>
<form id="step1" action="${flowExecutionUrl}" method="POST">
<button id="cancel" type="submit" name="_eventId_cancel">Cancel</button>
<button id="next" type="submit" name="_eventId_next">Next >></button>
Next
<c:out value="${flowExecutionUrl}"/>
</form>
</div>
<%# include file="/WEB-INF/view/footer.jsp" %>
</div>
</body>
</html>
Ok, got it...
To start the flow, you need to use the flow id in the url. So in my case use the url 'http://localhost:8080/SpringMVC/flow' for the flow with the id of 'flow'.
I was assuming the flow starts when you point to the view.

Spring 3.0.5 / Tiles 2.2 Error

I have a large application used in a production environment. My tiles setup is complex, with many tiles per page. The application works great with the exception of one thing. After starting the server the first page load throws an exception, an error in
apache.commons.digester.Digester at line 789/Digester.getParser
It throws this:
UnsupportedOperationException:: This parser does not support specification "null" version null"
The amazing thing is, this error only happens on the first page load, all subsequent loads work just fine. Looking for help with this, let me know what info you need. Thanks in advance.
This is the nested stack trace:
ERROR 08-12-11 15:30:05 (apache.commons.digester.Digester:789) ***Digester.getParser: ***
java.lang.UnsupportedOperationException: This parser does not support specification "null" version "null"
at javax.xml.parsers.SAXParserFactory.setXIncludeAware(SAXParserFactory.java:448)
at org.apache.commons.digester.Digester.getFactory(Digester.java:534)
at org.apache.commons.digester.Digester.getParser(Digester.java:786)
at org.apache.commons.digester.Digester.getXMLReader(Digester.java:1058)
at org.apache.commons.digester.Digester.parse(Digester.java:1887)
at org.apache.tiles.definition.digester.DigesterDefinitionsReader.read(DigesterDefinitionsReader.java:329)
at org.apache.tiles.definition.dao.BaseLocaleUrlDefinitionDAO.loadDefinitionsFromURL(BaseLocaleUrlDefinitionDAO.java:276)
at org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.loadDefinitionsFromURLs(CachingLocaleUrlDefinitionDAO.java:251)
at org.apache.tiles.definition.dao.ResolvingLocaleUrlDefinitionDAO.loadDefinitionsFromURLs(ResolvingLocaleUrlDefinitionDAO.java:65)
at org.apache.tiles.definition.dao.ResolvingLocaleUrlDefinitionDAO.loadParentDefinitions(ResolvingLocaleUrlDefinitionDAO.java:58)
at org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.loadDefinitionsFromURLs(CachingLocaleUrlDefinitionDAO.java:239)
at org.apache.tiles.definition.dao.ResolvingLocaleUrlDefinitionDAO.loadDefinitionsFromURLs(ResolvingLocaleUrlDefinitionDAO.java:65)
at org.apache.tiles.definition.dao.ResolvingLocaleUrlDefinitionDAO.loadParentDefinitions(ResolvingLocaleUrlDefinitionDAO.java:58)
at org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.loadDefinitionsFromURLs(CachingLocaleUrlDefinitionDAO.java:239)
at org.apache.tiles.definition.dao.ResolvingLocaleUrlDefinitionDAO.loadDefinitionsFromURLs(ResolvingLocaleUrlDefinitionDAO.java:65)
at org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.loadDefinitions(CachingLocaleUrlDefinitionDAO.java:222)
at org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.checkAndloadDefinitions(CachingLocaleUrlDefinitionDAO.java:204)
at org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.getDefinitions(CachingLocaleUrlDefinitionDAO.java:154)
at org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.getDefinition(CachingLocaleUrlDefinitionDAO.java:123)
at org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.getDefinition(CachingLocaleUrlDefinitionDAO.java:54)
at org.apache.tiles.definition.UnresolvingLocaleDefinitionsFactory.getDefinition(UnresolvingLocaleDefinitionsFactory.java:105)
at org.apache.tiles.impl.BasicTilesContainer.getDefinition(BasicTilesContainer.java:364)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:618)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:321)
at org.springframework.web.servlet.view.tiles2.TilesView.renderMergedOutputModel(TilesView.java:124)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1047)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:817)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3498)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
at weblogic.servlet.security.internal.AuthFilterChain$LastFilter.doFilter(AuthFilterChain.java:45)
at weblogic.servlet.security.internal.AuthFilterChain.doFilter(AuthFilterChain.java:37)
at com.bea.common.security.internal.service.NegotiateIdentityAsserterServiceImpl.callChain(NegotiateIdentityAsserterServiceImpl.java:145)
at com.bea.common.security.internal.service.NegotiateIdentityAsserterServiceImpl.process(NegotiateIdentityAsserterServiceImpl.java:132)
at sun.reflect.GeneratedMethodAccessor679.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.bea.common.security.internal.utils.Delegator$ProxyInvocationHandler.invoke(Delegator.java:57)
at $Proxy19.process(Unknown Source)
at weblogic.security.providers.authentication.NegotiateIdentityAsserterServletAuthenticationFilter.doFilter(NegotiateIdentityAsserterServletAuthenticationFilter.java:35)
at weblogic.servlet.security.internal.AuthFilterChain.doFilter(AuthFilterChain.java:37)
at weblogic.servlet.security.internal.SecurityModule$ServletAuthenticationFilterAction.run(SecurityModule.java:612)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.security.internal.SecurityModule.invokeAuthFilterChain(SecurityModule.java:501)
at weblogic.servlet.security.internal.CertSecurityModule.checkUserPerm(CertSecurityModule.java:97)
at weblogic.servlet.security.internal.SecurityModule.checkAccess(SecurityModule.java:106)
at weblogic.servlet.security.internal.ServletSecurityManager.checkAccess(ServletSecurityManager.java:82)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2116)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Full Stack Trace (Errors above are nested within this exception):
GET /*****_Cust_Search/CustomerDetail?customerId=9 HTTP/1.1
Connection: keep-alive
User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.107 Safari/535.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3
Cookie: nde-textsize=16px; JSESSIONID_CUSTDETAIL=Bnx0TByHMyvvyDBGb0p9TgCDy1h0n2hlzpckxhdYTsCQ5nJLVSzB!1674277528; ADMINCONSOLESESSION=Gh8nTD9Zpcn26tJBNLVl6q1ZqpQ1jrKTT27ZDL6yLvvvLLC2gjwZ!-975699351; JSESSIONID_CUST=l6GGTGKFYQV1cZ8cnJs2G2891JWclP6FnsDr1vL8bPXvTQpJjn9H!-975699351; JSESSIONID_INSURANCEDETAIL=J1lvTGKQ9G13SM8vYMzG1QPB2R939HQDMgHyJM1GpLG6fyvTJHVX!-975699351; JSESSIONID=gpGtTGYfTKwqh9dG6Q1T305LnbHpGJr6WVNHbx6TQwglXc9lPqgL!-975699351
]] Root cause of ServletException.
java.lang.NullPointerException
at org.apache.commons.digester.Digester.getXMLReader(Digester.java:1058)
at org.apache.commons.digester.Digester.parse(Digester.java:1887)
at org.apache.tiles.definition.digester.DigesterDefinitionsReader.read(DigesterDefinitionsReader.java:329)
at org.apache.tiles.definition.dao.BaseLocaleUrlDefinitionDAO.loadDefinitionsFromURL(BaseLocaleUrlDefinitionDAO.java:276)
at org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.loadDefinitionsFromURLs(CachingLocaleUrlDefinitionDAO.java:251)
at org.apache.tiles.definition.dao.ResolvingLocaleUrlDefinitionDAO.loadDefinitionsFromURLs(ResolvingLocaleUrlDefinitionDAO.java:65)
at org.apache.tiles.definition.dao.ResolvingLocaleUrlDefinitionDAO.loadParentDefinitions(ResolvingLocaleUrlDefinitionDAO.java:58)
at org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.loadDefinitionsFromURLs(CachingLocaleUrlDefinitionDAO.java:239)
at org.apache.tiles.definition.dao.ResolvingLocaleUrlDefinitionDAO.loadDefinitionsFromURLs(ResolvingLocaleUrlDefinitionDAO.java:65)
at org.apache.tiles.definition.dao.ResolvingLocaleUrlDefinitionDAO.loadParentDefinitions(ResolvingLocaleUrlDefinitionDAO.java:58)
at org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.loadDefinitionsFromURLs(CachingLocaleUrlDefinitionDAO.java:239)
at org.apache.tiles.definition.dao.ResolvingLocaleUrlDefinitionDAO.loadDefinitionsFromURLs(ResolvingLocaleUrlDefinitionDAO.java:65)
at org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.loadDefinitions(CachingLocaleUrlDefinitionDAO.java:222)
at org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.checkAndloadDefinitions(CachingLocaleUrlDefinitionDAO.java:204)
at org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.getDefinitions(CachingLocaleUrlDefinitionDAO.java:154)
at org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.getDefinition(CachingLocaleUrlDefinitionDAO.java:123)
at org.apache.tiles.definition.dao.CachingLocaleUrlDefinitionDAO.getDefinition(CachingLocaleUrlDefinitionDAO.java:54)
at org.apache.tiles.definition.UnresolvingLocaleDefinitionsFactory.getDefinition(UnresolvingLocaleDefinitionsFactory.java:105)
at org.apache.tiles.impl.BasicTilesContainer.getDefinition(BasicTilesContainer.java:364)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:618)
at org.apache.tiles.impl.BasicTilesContainer.render(BasicTilesContainer.java:321)
at org.springframework.web.servlet.view.tiles2.TilesView.renderMergedOutputModel(TilesView.java:124)
at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1047)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:817)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3498)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
This is the root-context.xml.
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<!-- Root Context: defines shared resources visible to all other web components -->
<bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles2.TilesConfigurer">
<property name="definitions">
<list>
<value>/WEB-INF/tiles/Templates.xml</value>
</list>
</property>
<property name="preparerFactoryClass" value="org.springframework.web.servlet.view.tiles2.SpringBeanPreparerFactory"/>
</bean>
</beans>
This is the servlet-context.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns="http://www.springframework.org/schema/mvc"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:beans="http://www.springframework.org/schema/beans"
xsi:schemaLocation="
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<!-- DispatcherServlet Context: defines this servlet's request-processing infrastructure -->
<!-- Enables the Spring MVC #Controller programming model -->
<annotation-driven />
<!-- Resolves views selected for rendering by #Controllers to .jsp resources in the /WEB-INF/views directory -->
<!-- <beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">-->
<!-- <beans:property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>-->
<!-- <beans:property name="prefix" value="/WEB-INF/views/" />-->
<!-- <beans:property name="suffix" value=".jsp" />-->
<!-- </beans:bean>-->
<!-- Imports user-defined #Controller beans that process client requests -->
<beans:import resource="controllers.xml" />
<beans:bean class="org.springframework.web.servlet.view.ResourceBundleViewResolver">
<beans:property name="basename" value="tiles"/>
</beans:bean>
<beans:bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
<beans:property name="basenames">
<beans:list>
<beans:value>customer</beans:value>
</beans:list>
</beans:property>
</beans:bean>
</beans:beans>
controllers.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<!-- Scans within the base package of the application for #Components to configure as beans -->
<context:component-scan base-package="redacted.controllers" />
</beans>
tiles.properties
CustomerTile.(class)=org.springframework.web.servlet.view.tiles2.TilesView
CustomerTile.url=CustomerTile
CustomerSearchForm.(class)=org.springframework.web.servlet.view.tiles2.TilesView
CustomerSearchForm.url=CustomerSearchForm
CustomerSearchResults.(class)=org.springframework.web.servlet.view.tiles2.TilesView
CustomerSearchResults.url=CustomerSearchResults
EditCustomer.(class)=org.springframework.web.servlet.view.tiles2.TilesView
EditCustomer.url=EditCustomer
NewCustomer.(class)=org.springframework.web.servlet.view.tiles2.TilesView
NewCustomer.url=NewCustomer
(My Tile Templates) templates.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 2.1//EN"
"http://tiles.apache.org/dtds/tiles-config_2_1.dtd">
<tiles-definitions>
<definition name="baseLayout" template="/WEB-INF/tiles/main-container-tile.jsp">
<put-attribute name="title" value="AMHOM" />
<put-attribute name="header" value="normalheader" />
<put-attribute name="body" value="/WEB-INF/tiles/body.jsp" />
<put-attribute name="footer" value="/WEB-INF/tiles/footer-tile.jsp" />
</definition>
<definition name="baseLayout2" template="/WEB-INF/tiles/main-container-tile.jsp">
<put-attribute name="title" value="AMHOM" />
<put-attribute name="header" value="custdetailheader" />
<put-attribute name="body" value="/WEB-INF/tiles/body.jsp" />
<put-attribute name="footer" value="/WEB-INF/tiles/footer-tile.jsp" />
</definition>
<definition name="baseLayout3" template="/WEB-INF/tiles/main-container-tile.jsp">
<put-attribute name="title" value="AMHOM" />
<put-attribute name="header" value="editcustheader" />
<put-attribute name="body" value="/WEB-INF/tiles/body.jsp" />
<put-attribute name="footer" value="/WEB-INF/tiles/footer-tile.jsp" />
</definition>
<definition name="normalheader" template="/WEB-INF/tiles/header-tile.jsp">
<put-attribute name="menutabs" value="/WEB-INF/tiles/tabs.jsp" />
</definition>
<definition name="notabsheader" template="/WEB-INF/tiles/header-tile.jsp">
<put-attribute name="menutabs" value="/WEB-INF/tiles/notabs.jsp" />
</definition>
<definition name="custdetailheader" template="/WEB-INF/tiles/header-tile.jsp">
<put-attribute name="menutabs" value="/WEB-INF/tiles/custdetail_tabs-tile.jsp" />
</definition>
<definition name="editcustheader" template="/WEB-INF/tiles/header-tile.jsp">
<put-attribute name="menutabs" value="/WEB-INF/tiles/editcust_tabs-tile.jsp" />
</definition>
<definition name="completecust" template="/WEB-INF/tiles/custdetail_complete-tile.jsp">
<put-attribute name="navigation" value="/WEB-INF/tiles/custdetail_cpapnav-tile.jsp" />
<put-attribute name="customertile" value="/WEB-INF/tiles/custdetail_content-tile.jsp" />
<put-attribute name="diagtile" value="/WEB-INF/tiles/custdetail_diagnosis-tile.jsp" />
<put-attribute name="resptile" value="/WEB-INF/tiles/custdetail_responsibleparty-tile.jsp" />
<put-attribute name="doctortile" value="/WEB-INF/tiles/custdetail_doctor-tile.jsp" />
<put-attribute name="insurancetile" value="/WEB-INF/tiles/custdetail_insurance-tile.jsp" />
</definition>
<definition name="customersearch" template="/WEB-INF/tiles/customersearch_complete-tile.jsp">
<put-attribute name="errors-tile" value="/WEB-INF/tiles/customersearchform_errors-tile.jsp" />
<put-attribute name="content-tile" value="/WEB-INF/tiles/customersearchform_content-tile.jsp" />
</definition>
<definition name="custsearchresults" template="/WEB-INF/tiles/custsearchresults_complete-tile.jsp">
<put-attribute name="errors-tile" value="/WEB-INF/tiles/customersearchform_errors-tile.jsp" />
<put-attribute name="content-tile" value="/WEB-INF/tiles/custsearchresults_content-tile.jsp" />
</definition>
<definition name="editcust" template="/WEB-INF/tiles/editcust_complete-tile.jsp">
<put-attribute name="navigation" value="/WEB-INF/tiles/custdetail_cpapnav-tile.jsp" />
<put-attribute name="editcustomertile" value="/WEB-INF/tiles/editcust_content-tile.jsp" />
</definition>
<definition name="newcust" template="/WEB-INF/tiles/newcust_complete-tile.jsp">
<put-attribute name="navigation" value="" />
<put-attribute name="newcustomertile" value="/WEB-INF/tiles/newcust_content-tile.jsp" />
</definition>
<definition name="CustomerSearchForm" extends="baseLayout">
<put-attribute name="title" value="" />
<put-attribute name="appName" value="Customer Search" />
<put-attribute name="body" value="customersearch" />
</definition>
<definition name="CustomerSearchResults" extends="baseLayout">
<put-attribute name="title" value="" />
<put-attribute name="appName" value="Customer Search" />
<put-attribute name="body" value="custsearchresults" />
</definition>
<definition name="CustomerTile" extends="baseLayout2">
<put-attribute name="title" value="Customer Display" />
<put-attribute name="appName" value="Customer Display" />
<put-attribute name="body" value="completecust" />
</definition>
<definition name="EditCustomer" extends="baseLayout3">
<put-attribute name="title" value="Edit Customer" />
<put-attribute name="appName" value="Edit Customer" />
<put-attribute name="body" value="editcust" />
</definition>
<definition name="NewCustomer" extends="baseLayout3">
<put-attribute name="title" value="New Customer" />
<put-attribute name="appName" value="New Customer" />
<put-attribute name="body" value="newcust" />
</definition>
</tiles-definitions>
I had this problem today so thought I'd add a post, the problem was because of AppSensor (actually its ESAPI 2.0GA dependency), which comes with two different versions of xerces in its includes (2.6.1 from xom depenency, and 2.8.1 from antisamy dependency), but 2.6.1 comes before 2.8.1 so 2.8.1 is not included and the exception happens.
Fixed by adding a 2.8.1 dependency just before the AppSensor dependency in my POM:
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.8.1</version>
</dependency>
<dependency>
<groupId>org.owasp.appsensor</groupId>
<artifactId>AppSensor</artifactId>
<version>${appsensor.version}</version>
</dependency>
There is some issue with weblogic windows installation.
Set this value in your setDomainEnv.cmd and restart the server.
set JAVA_OPTIONS=%JAVA_OPTIONS% -Djavax.xml.parsers.SAXParserFactory=com.sun.org.apache.xerces.internal.jaxp.SAXParserFactoryImpl
Spring 3.2.1 with tiles 2.2.2 caused the same error. It was solved by updating xerxesimpl. Here is a snippet of the pom.xml
<properties>
<java-version>1.6</java-version>
<org.slf4j.version>1.5.8</org.slf4j.version>
<log4j.version>1.2.16</log4j.version>
<xercesImpl.version>2.9.1</xercesImpl.version>
<org.springframework-version>3.1.2.RELEASE</org.springframework-version>
<tiles.core.api.servlet.jsp.version>2.2.2</tiles.core.api.servlet.jsp.version>
</properties>
You can also get this error if you do something stupid like duplicate the tag at the top of your file:
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE tiles-definitions PUBLIC
"-//Apache Software Foundation//DTD Tiles Configuration 3.0//EN"
"http://tiles.apache.org/dtds/tiles-config_3_0.dtd">
<tiles-definitions>
<tiles-definitions>
<definition name="base.page.definition" template="/WEB-INF/layout/basePageLayout.jsp">
...
Hopefully your eyes are sharper than mine and you won't have to come all the way to SO to realize your sloppines....:)

Resources