Modified: incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/etc/web.xml URL: http://svn.apache.org/viewvc/incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/etc/web.xml?rev=630398&r1=630397&r2=630398&view=diff ============================================================================== --- incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/etc/web.xml (original) +++ incubator/jspwiki/branches/JSPWIKI_2_9_STRIPES_BRANCH/etc/web.xml Fri Feb 22 22:48:11 2008 @@ -13,19 +13,85 @@ [EMAIL PROTECTED] </description> <display-name>JSPWiki</display-name> + + <!-- Resource bundle default location --> + <context-param> + <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name> + <param-value>templates.default</param-value> + </context-param> - <!-- - This is new in 2.4. This defines a servlet filter which filters all requests. - --> - + <!-- All JSPs need to be checked for proper user access. --> <filter> <filter-name>WikiServletFilter</filter-name> <filter-class>com.ecyrd.jspwiki.ui.WikiServletFilter</filter-class> </filter> + + <!-- Configuration of the Stripes Filter. The Stripes MVC framework provides + essential request routing, form processing and type conversion services + for JSPWiki. --> + <filter> + <description> + Configures the Stripes framework. + </description> + <display-name>Stripes Filter</display-name> + <filter-name>StripesFilter</filter-name> + <filter-class>net.sourceforge.stripes.controller.StripesFilter</filter-class> + <!-- WikiRuntimeConfiguration replaces the default Stripes RuntimeConfiguration. + It starts up the WikiEngine and the WikiTypeConverterFactory that + marshals request parameters into properly resolved WikiPage and Group objects.--> + <init-param> + <param-name>Configuration.Class</param-name> + <param-value>com.ecyrd.jspwiki.ui.WikiRuntimeConfiguration</param-value> + </init-param> + <!-- Look for ActionBean implementations in the JSPWiki JAR. If you have custom + ActionBeans you want JSPWiki to use, specify them here (comma-delimited). --> + <init-param> + <param-name>ActionResolver.UrlFilters</param-name> + <param-value>WEB-INF/lib/JSPWiki.jar</param-value> + </init-param> + <!-- WikiActionBeanContext replaces the default Stripes ActionBeanContext. This class + contains references to the WikiEngine and WikiSesion. A new instance of + WikiActionBeanContext is automatically injected into every ActionBean. --> + <init-param> + <param-name>ActionBeanContext.Class</param-name> + <param-value>com.ecyrd.jspwiki.action.WikiActionBeanContext</param-value> + </init-param> + <!-- In addition to the normal Stripes BeforeAfterMethodInterceptor, we add the + WikiInterceptor, which fires after the ActionBean is resolved. The interceptor + checks that the WikiEngine is initialized correctly, and that the user has + correct access to the ActionBean.--> + <init-param> + <param-name>Interceptor.Classes</param-name> + <param-value>com.ecyrd.jspwiki.ui.WikiInterceptor, + net.sourceforge.stripes.controller.BeforeAfterMethodInterceptor</param-value> + </init-param> + <!-- We override Stripes' normal resource bundle to use ours instead. --> + <init-param> + <param-name>LocalizationBundleFactory.FieldNameBundle</param-name> + <param-value>templates.default</param-value> + </init-param> + <init-param> + <param-name>LocalizationBundleFactory.ErrorMessageBundle</param-name> + <param-value>templates.default</param-value> + </init-param> + <!-- Lastly, we define a set of custom ExceptionHandlers that deal with any + custom exceptions caught by Stripes. --> + <init-param> + <param-name>ExceptionHandler.Class</param-name> + <param-value>net.sourceforge.stripes.exception.DefaultExceptionHandler</param-value> + </init-param> + </filter> + + <!-- + This is new in 2.4. This defines a servlet filter which filters all requests. + --> + + <!-- <filter> <filter-name>WikiJSPFilter</filter-name> <filter-class>com.ecyrd.jspwiki.ui.WikiJSPFilter</filter-class> </filter> + --> <filter-mapping> <filter-name>WikiServletFilter</filter-name> @@ -51,6 +117,19 @@ <filter-name>WikiServletFilter</filter-name> <url-pattern>/JSON-RPC</url-pattern> </filter-mapping> + <filter-mapping> + <filter-name>StripesFilter</filter-name> + <url-pattern>*.jsp</url-pattern> + <dispatcher>REQUEST</dispatcher> + </filter-mapping> + + <filter-mapping> + <filter-name>StripesFilter</filter-name> + <servlet-name>StripesDispatcher</servlet-name> + <dispatcher>REQUEST</dispatcher> + </filter-mapping> + + <!-- <filter-mapping> <filter-name>WikiJSPFilter</filter-name> <url-pattern>/wiki/*</url-pattern> @@ -59,7 +138,8 @@ <filter-name>WikiJSPFilter</filter-name> <url-pattern>*.jsp</url-pattern> </filter-mapping> - + --> + <!-- HttpSessionListener used for managing WikiSession's. --> @@ -67,6 +147,15 @@ <listener-class>com.ecyrd.jspwiki.auth.SessionMonitor</listener-class> </listener> + <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> + <!-- Configuration of the Stripes dispatcher Servlet. --> + <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --> + <servlet> + <servlet-name>StripesDispatcher</servlet-name> + <servlet-class>net.sourceforge.stripes.controller.DispatcherServlet</servlet-class> + <load-on-startup>1</load-on-startup> + </servlet> + <!-- Now, let's define the XML-RPC interfaces. You probably don't have to touch these. @@ -120,8 +209,10 @@ <!-- Maps short URLS to JSPs; also, detects webapp shutdown. --> <servlet> <servlet-name>WikiServlet</servlet-name> - <servlet-class>com.ecyrd.jspwiki.WikiServlet</servlet-class> + <servlet-class>com.ecyrd.jspwiki.WikiServlet</servlet-class> + <!-- <load-on-startup>1</load-on-startup> + --> </servlet> <servlet> @@ -138,6 +229,21 @@ <servlet-class>com.ecyrd.jspwiki.attachment.AttachmentServlet</servlet-class> </servlet> + <servlet-mapping> + <servlet-name>StripesDispatcher</servlet-name> + <url-pattern>/dispatcher</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>StripesDispatcher</servlet-name> + <url-pattern>/action/*</url-pattern> + </servlet-mapping> + + <servlet-mapping> + <servlet-name>StripesDispatcher</servlet-name> + <url-pattern>*.action</url-pattern> + </servlet-mapping> + <!-- PLACEHOLDER FOR PRE-COMPILED JSP SERVLETS --> <!-- @@ -200,6 +306,22 @@ <error-code>403</error-code> <location>/error/Forbidden.html</location> </error-page> + + <!-- Taglibs --> + <!-- + <taglib> + <taglib-location>/WEB-INF/jstl-core.tld</taglib-location> + <taglib-uri>http://java.sun.com/jstl/core</taglib-uri> + </taglib> + <taglib> + <taglib-location>/WEB-INF/jstl-fmt.tld</taglib-location> + <taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri> + </taglib> + --> + <taglib> + <taglib-location>/WEB-INF/stripes.tld</taglib-location> + <taglib-uri>http://stripes.sourceforge.net/stripes.tld</taglib-uri> + </taglib> <!-- REMOVE ME TO ENABLE JDBC DATABASE <resource-ref>
