In my project, I have several pages controlled by Spring web flow that are integrated with other Spring MVC part of project. On some of this pages I want to display popups. I did some configuration based on, swf documentation pdf, and some springforum posts, but when I want to render popup I get plain jsp page instead of popup. I don't know is this a configuration problem or my misunderstanding of this spring-js with dojo functionality. Any help is appreciated. And here is my configuration and other files:
web.xml:
----------------------------------------
here I have my servlets: dispatcher, dwr and resource (from swf documentation example)
Code:<servlet> <servlet-name>dispatcher</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet> <servlet-name>dwr-invoker</servlet-name> <servlet-class>org.directwebremoting.spring.DwrSpringServlet</servlet-class> <init-param> <param-name>debug</param-name> <param-value>true</param-value> </init-param> <load-on-startup>2</load-on-startup> </servlet> <servlet> <servlet-name>Resource Servlet</servlet-name> <servlet-class>org.springframework.js.resource.ResourceServlet</servlet-class> <load-on-startup>3</load-on-startup> </servlet>
and here is mappings
1st problem) in my project tree I have already directory recources (with css, and js and other stuff). where I enable this mapping my resources are not available. Is there any way to declare other mappings than /resources/* for resources related with spring-js and dojo ?:Code:<servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>*.html</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>dwr-invoker</servlet-name> <url-pattern>/dwr/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>Resource Servlet</servlet-name> <url-pattern>/resources/*</url-pattern> </servlet-mapping>
here is fragment of my swf flow configuration xml file:Code:<script type="text/javascript" src="<c:url value="/resources/dojo/dojo.js" />"> </script> <script type="text/javascript" src="<c:url value="/resources/spring/Spring.js" />"> </script> <script type="text/javascript" src="<c:url value="/resources/spring/Spring-Dojo.js" />"> </script
from "selectionSummary" state on "gotoBtDetails" event user goes to
btDetails state which is popup view:
"selectionSummary"
on selectionSummary page I have this link:Code:<view-state id="selectionSummary" view="configurator/selection-summary" model="configuratorDto"> <on-entry> ...some evaluations... </on-entry> <transition on="gotoBtDetails" to="btDetails"/> ...some other transition... </view-state> <view-state id="btDetails" view="configurator/details-popup" popup="true"> <on-entry> <render fragments="detailsFragment" /> </on-entry> <transition on="closeDetails" to="employerSelection"/> </view-state>
the popup jsp file:Code:<a href="${flowExecutionUrl}&_eventId=gotoBtDetails">popup link</a>
Code:<%@ page contentType="text/html; charset=UTF-8" language="java" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>Web</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="<c:url value="/resources/dojo/dojo.js" />"> </script> <script type="text/javascript" src="<c:url value="/resources/spring/Spring.js" />"> </script> <script type="text/javascript" src="<c:url value="/resources/spring/Spring-Dojo.js" />"> </script> <link type="text/css" rel="stylesheet" href="<c:url value="/resources/dijit/themes/tundra/tundra.css" />" /> </head> <body> <div>Some text before div with id (popup)</div> <div id="detailsFragment" class="detailsFragment"> Popup page </div> </body> </html>
and here is my dispatcher servlet conf file:
2nd problem: When i click popup link, plain jsp page appears with text form jspCode:<dwr:configuration/> <dwr:controller id="dwrController" debug="true"/> <bean id="flowController" class="org.springframework.webflow.mvc.servlet.FlowController"> <property name="flowExecutor" ref="flowExecutor"/> </bean> <bean id="defaultController" class="org.springframework.web.servlet.mvc.UrlFilenameViewController" /> <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"> <property name="maxUploadSize" value="5000000" /> <property name="maxInMemorySize" value="5000000" /> </bean> <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="viewClass"><value>org.springframework.web.servlet.view.JstlView</value></property> <property name="prefix"><value>/WEB-INF/jsp/</value></property> <property name="suffix"><value>.jsp</value></property> </bean> <bean id="hibernateInterceptor" class="org.springframework.orm.hibernate3.support.OpenSessionInViewInterceptor"> <property name="sessionFactory" ref="commonSessionFactory" /> <property name="flushModeName" value="FLUSH_NEVER" /> </bean> <bean id="dwrHandlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="order" value="1" /> <property name="alwaysUseFullPath" value="true"/> <property name="interceptors"> <list> <ref bean="hibernateInterceptor"/> </list> </property> <property name="mappings"> <value> /subscription-configurator.html=flowController /engine.js=dwrController /util.js=dwrController /interface.js=dwrController /call/**=dwrController /interface/**=dwrController /dwr/**=dwrController </value> </property> </bean> <bean id="controllerClassNameHandlerMapping" class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping"> <property name="order" value="2" /> <property name="interceptors"> <list> <ref bean="hibernateInterceptor"/> </list> </property> </bean> <bean id="beanNameUrlHandlerMapping" class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"> <property name="order" value="3" /> <property name="detectHandlersInAncestorContexts" value="true"/> <property name="interceptors"> <list> <ref bean="hibernateInterceptor"/> </list> </property> </bean> <bean id="simpleUrlHandlerMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="order" value="4" /> <property name="interceptors"> <list> <ref bean="hibernateInterceptor"/> </list> </property> <property name="mappings"> <value> </value> </property> </bean> <bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource"> <property name="basename" value="classpath:messages_pl"/> <property name="defaultEncoding" value="UTF-8"/> <property name="useCodeAsDefaultMessage" value="true" /> </bean> <flow:flow-executor id="flowExecutor" flow-registry="flowRegistry" /> <flow:flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices" base-path="/WEB-INF/flows/"> <flow:flow-location id="subscription-configurator" path="configurator-flow.xml" /> </flow:flow-registry> <flow:flow-builder-services id="flowBuilderServices" view-factory-creator="viewFactoryCreator"/> <bean id="viewFactoryCreator" class="org.springframework.webflow.mvc.builder.MvcViewFactoryCreator"> <property name="viewResolvers"> <list> <ref bean="viewResolver"/> </list> </property> </bean>
instead of popup, and when I use firebug to look if this popup page resources are available, there is some status message that indicates that this resource is not available.Code:Some text before div with id (popup) Popup page
>>>"The requested resource (/tp-web/resources/dojo/dojo.js) is not available."<<<
dojo.js, Spring.js, Spring-Dojo.js. This files are in spring-js.jar file in classpath. Should I extract them to external folder.
3rd problem (related with 1st): When i enable Resource servlet my resources in "resources" folder in project tree are also unavailable.
Questions Summary:
Q1: Where sould be placed dojo.js, Spring.js and Spring-Dojo.js files to be available.
Q2: If I have "resources" folder in my project tree (/.../src/main/webapp/resources/) and /resources/* mapping in enabled Resource Servlet why resources from this file are unavailable.
Q3: Is there any step by step example with spring-js usage and configuration ?
I use in my project Spring 2.5.6 and SWF 2.0.9
Thanks for any help


Reply With Quote
