synyx GmbH & Co. KG Homepage Welcome Guest   | Login
  Search  
  Index  | Recent Threads  | Who's Online  | User List  | Register  | Search  | Help  | RSS feeds


Quick Go »
Thread Status: Normal
Total posts in this thread: 2
[Add To My Favorites] [Watch this Thread]
Author
Previous Thread This topic has been viewed 3463 times and has 1 reply Next Thread
Male Sonix
Newbie



Joined: Oct 4, 2007
Posts: 20
Status: Offline

Integrating struts2 and openCMS

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
[Sep 16, 2008 11:12:23 AM] Show Printable Version of Post        Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
Male haifeng
Stranger



Joined: Nov 25, 2008
Posts: 1
Status: Offline

Re: Integrating struts2 and openCMS

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
[Nov 25, 2008 1:12:53 PM] Show Printable Version of Post        Hidden to Guest [Link] Report threatening or abusive post: please login first  Go to top 
[Show Printable Version of Thread]