|
|
Index
| Recent Threads
| Who's Online
| User List
| Register
| Search
| Help
| |
![]() |
OpenCms Forum » List all forums » Forum: Tutorials / HowTo's for OpenCms 7 » Thread: Integrating struts2 and openCMS |
|
Thread Status: Normal Total posts in this thread: 2 |
[Add To My Favorites] [Watch this Thread] |
| Author |
|
|
Newbie
|
I want to give You are short overview how i integrated Struts2 with openCMS 7.05. Just a few steps are required to integrate struts2 and opencms. 1. Download and copy the different struts.jar's to the $tomcat/opencms/WEB-INF/lib directory. 2. Add the struts2 filters to the web.xml of openCMS. This should look like following: <!-- ...... --> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <listener> <listener-class>org.opencms.main.OpenCmsListener</listener-class> </listener> <!-- ...... --> 3. Now you have to modify the results of your struts2 actions to point to the pages in openCMS. this looks like following. <action name="actionName" class="de.test.company.marktplace.action.car.SaveAction" method="save"> <interceptor-ref name="myAppStack"></interceptor-ref> <result name="input">/opencms/company_marktplace/save.html</result> <result name="success">/opencms/company_marktplace/save.html</result> </action> 4. You need to copy the classes to $tomcat/opencms/WEB-INF/classes and restart the server. Its also possible to create a module with this stuff and export it to opencms. So, now you should be able to use struts2 in opencms. The integration of spring is similar to this. you need the libs, the stuff in the web.xml and the applicationcontext.xml Hope this is usefull for some one ;-) SoniX |
||
|
|
Stranger
|
Hi,i come from china,i follow your steps to configuration,but i have a problem,it conn't upload if i use <url-pattern>/*</url-pattern> but i remove it ,it's OK. i don't know why? Do you help me to solution this question? Thank you |
||
|
| [Show Printable Version of Thread] |