From 21d314b9b8b34de48ada32aaff934cef9a7b0316 Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Thu, 28 Oct 2010 13:44:57 +0000 Subject: [PATCH] SWF-1411 SWF-1409 Documentation fixes --- spring-webflow-reference/src/portlet.xml | 4 +- spring-webflow-reference/src/spring-faces.xml | 14 +++- spring-webflow-reference/src/spring-js.xml | 78 ++++++++++++++++++- 3 files changed, 90 insertions(+), 6 deletions(-) diff --git a/spring-webflow-reference/src/portlet.xml b/spring-webflow-reference/src/portlet.xml index dc3117a9..ae7f5254 100644 --- a/spring-webflow-reference/src/portlet.xml +++ b/spring-webflow-reference/src/portlet.xml @@ -7,7 +7,7 @@ Introduction This chapter shows how to use Web Flow in a Portlet environment. - Web Flow has full support for JSR-168 portlets. + Spring Web Flow requires Portlet API 2.0 to run with. The booking-portlet-mvc sample application is a good reference for using Web Flow within a portlet. This application is a simplified travel site that allows users to search for and book hotel rooms. @@ -16,7 +16,7 @@ Configuring web.xml and portlet.xml The configuration for a portlet depends on the portlet container used. - The sample applications, included with Web Flow, are both configured to use Apache Pluto, the JSR-168 reference implementation. + The sample applications, included with Web Flow, are both configured to use Apache Pluto. In general, the configuration requires adding a servlet mapping in the web.xml file to dispatch request to the portlet container. diff --git a/spring-webflow-reference/src/spring-faces.xml b/spring-webflow-reference/src/spring-faces.xml index ddf5e20e..c911211c 100644 --- a/spring-webflow-reference/src/spring-faces.xml +++ b/spring-webflow-reference/src/spring-faces.xml @@ -11,7 +11,7 @@ 2.2 the JSF integration is supported with JSF 1.2 and JSF 2.0 including Sun Mojarra and Apache MyFaces. Please, note however that JSF 2 partial state saving is not yet supported with Apache MyFaces and needs to be disabled with the javax.faces.PARTIAL_STATE_SAVING - context parameter in web.xml + context parameter in web.xml. Spring Web Flow provides a Spring Security tag library for JSF 2 and JSF 1.2 environments. @@ -25,6 +25,12 @@ and RichFaces. The swf-booking-faces sample in the Spring Web Flow distribution is built on JSF 2 and PrimeFaces components. + + Spring Web Flow also supports using JSF in a portlet environment. + Spring Web Flow's portlet integration supports Portlets API 2.0 and JSF 1.2 only. + Currently JSF 2 is not supported in combination with portlets. + See for more on Spring Web Flow's portlet integration. + JSF Integration For Spring Developers @@ -100,10 +106,14 @@ ]]> - When using the Spring Faces components (JSF 1.2 only), you also need to configure a servlet for serving + When using the JSF 1.2 Spring Faces components, you also need to configure a servlet for serving CSS and JavaScript resources. This servlet must be mapped to /resources/* in order for the URL's rendered by the components to function correctly. + + Note that while the ResourceServlet is deprected in favor of the Spring 3 resources + element, it is still required for use with JSF 1.2 Spring Faces components. + diff --git a/spring-webflow-reference/src/spring-js.xml b/spring-webflow-reference/src/spring-js.xml index 10edfdf5..4342cfd3 100644 --- a/spring-webflow-reference/src/spring-js.xml +++ b/spring-webflow-reference/src/spring-js.xml @@ -17,7 +17,8 @@ Serving Javascript Resources - Spring JS provides a generic ResourceServlet to serve web resources such as JavaScript and CSS files from jar files, as well as the webapp root directory. + Spring JS provides a generic ResourceServlet to serve web resources such as JavaScript and CSS files from jar files, + as well as the webapp root directory. This servlet provides a convenient way to serve Spring.js files to your pages. To deploy this servlet, declare the following in web.xml: @@ -34,7 +35,80 @@ /resources/* ]]> - + + Note that starting with version 3.0.4, the Spring Framework includes + a replacement for the ResourceServlet (see the + Spring Framework documentation). + With the new <mvc:resources> element resource requests (.js, .css) are handled by the + DispatcherSevlet without the need for a separate ResourceServlet. + Here is the relevant portion of the Spring MVC configuration in + the mvc-booking sample: + + + + + + + + + ... + + +]]> + + + This incoming maps requests for /resources to resources found under + /META-INF/web-resources on the classpath. That's where Spring JavaScript resources + are bundled. However, you can modify the location attribute in the above configuration in order + to serve resources from any classpath or web application relative location. + + + Note that the full resource URL depends on how your DispatcherServlet is mapped. + In the mvc-booking sample we've chosen to map it with the default servlet mapping '/': + + + Spring MVC Dispatcher Servlet + org.springframework.web.servlet.DispatcherServlet + + + + Spring MVC Dispatcher Servlet + / + +]]> + + + That means the full URL to load Spring.js is /myapp/resources/spring/Spring.js. + If your DispatcherServlet was instead mapped to /main/* then the full + URL would be /myapp/main/resources/spring/Spring.js. + + + When using of the default servlet mapping it is also recommended to add this to your Spring MVC + configuration, which ensures that any resource requests not handled by your Spring MVC mappings + will be delegated back to the Servlet container. + + + + + ... + + + + +]]> + + Including Spring Javascript in a Page