javascript
OpenCMS integration with Spring MVC--reference
ref from:http://blogs.indrajitpingale.com/?p=8
http://blog.shinetech.com/2013/04/09/integrating-springmvc-with-opencms/
It is assumed that you have successfully deploted OpenCMS 8.x on either Tomcat or JBoss (How to deploy OpenCMS on JBoss?). Also, it is assumed that your are hands-on on Spring MVC.
So there are 6 part of Spring MVC application.
?
Steps to deploy Spring MVC application in openCMS.
?
?| <!-- Begin: OpenCmsSpring Integration -->??? <context-param>? ???<param-name>contextConfigLocation</param-name>? ???<param-value>/WEB-INF/OpenCmsSpring-service.xml</param-value>? </context-param>?? <filter>? ???<filter-name>CharacterEncoding</filter-name>? ???<filter-class>? ????????org.springframework.web.filter.CharacterEncodingFilter? ???</filter-class>? ???<init-param>? ????????<param-name>encoding</param-name>? ????????<param-value>UTF-8</param-value>? ???</init-param>? ???<init-param>? ????????<param-name>forceEncoding</param-name>? ????????<param-value>true</param-value>? ???</init-param>? </filter>??? <!-- End: OpenCmsSpring Integration --> |
under following
| <context-param>? ??<param-name>DefaultWebApplication</param-name>? ??<param-value>ROOT</param-value>? </context-param> |
| <!-- Begin: OpenCmsSpring Integration -->??? <listener>? ????<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>? </listener>???? <servlet>? ????<servlet-name>OpenCmsSpring</servlet-name>? ????<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>? ????<load-on-startup>1</load-on-startup>? </servlet>? <!-- End: OpenCmsSpring Integration --> |
under following
| <listener>? ????<listener-class>org.opencms.main.OpenCmsListener</listener-class>? </listener> |
| <!-- Begin: OpenCmsSpring Integration -->? <servlet-mapping>? ????<servlet-name>OpenCmsSpring</servlet-name>? ????<url-pattern>*.htm</url-pattern>? </servlet-mapping>? <filter>? ????<filter-name>RewriteFilter</filter-name>? ????<filter-class>com.ipingale.filter.RewriteFilter</filter-class>? </filter>? <filter-mapping>? ????<filter-name>RewriteFilter</filter-name>? ????<url-pattern>/*</url-pattern>? </filter-mapping>? <filter-mapping>? ????<filter-name>CharacterEncoding</filter-name>? ????<url-pattern>/*</url-pattern>? </filter-mapping>??? <!-- End: OpenCmsSpring Integration --> |
under following
| <servlet-mapping>? ????<servlet-name>OpenCmsWebDavServlet</servlet-name>? ????<url-pattern>/webdav/*</url-pattern>? </servlet-mapping> |
?
?| <!-- Begin: Spring Integration -->? <taglib>? ????<taglib-uri>/spring</taglib-uri>? ????<taglib-location>/WEB-INF/spring.tld</taglib-location>? </taglib>? <taglib>? ????<taglib-uri>/form</taglib-uri>? ????<taglib-location>/WEB-INF/spring-form.tld</taglib-location>? </taglib>?? <!-- End: Spring Integration --> |
under following
| <taglib>? ????<taglib-uri>http://www.opencms.org/taglib/cms</taglib-uri>? ????<taglib-location>/WEB-INF/opencms.tld</taglib-location>? </taglib> |
Before:
?
?| <link href="css/style.css" rel="stylesheet" type="text/css" /> |
After:
?| <link href="<cms:link>/system/modules/com.ipingale.demo.module/resources/css/style.css</cms:link>" rel="stylesheet" type="text/css" /> |
| <%@ taglib prefix="cms" uri="http://www.opencms.org/taglib/cms" %> |
That’s it you are ready now.
Click on your start page (index.spg) and here you go.
?
You can download working example from below location.
https://drive.google.com/file/d/0B3Qu76R8MDYwclFWQV9Da3JqMDQ/edit?usp=sharing
Or
http://www.sendspace.com/file/x2sipm
?
References:
http://blog.shinetech.com/2013/04/09/integrating-springmvc-with-opencms/
http://opencms.996256.n3.nabble.com/OpenCms-and-Spring-MVC-preview-and-direct-edit-of-resources-td22555.html
?
Thanks to?Mathias Lin !!!
This entry was posted in?OpenCMS,?Spring-MVC?on?February 4, 2014.
轉(zhuǎn)載于:https://www.cnblogs.com/davidwang456/p/3663357.html
總結(jié)
以上是生活随笔為你收集整理的OpenCMS integration with Spring MVC--reference的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 安装opencms时遇到问题及解决方法
- 下一篇: Understanding transi