转:http://www.javalobby.org/java/forums/t53875.html
------------------------------------------------------------------
Integration of Struts application with OpenCms
At 10:20 AM on Nov 24, 2005, Krishnan wrote:
Fresh Jobs for Developers Post a job opportunity
»
Mint Software seeks a Java Architect / Sr. Engineer for Stanford/Princeton/Duke Consumer Finance Startup in Mountain View, CA
»
InterSystems seeks a North American Sales Engineer for End User Health Care in San Diego
»
Intersystems seeks a Sales Engineer in San Diego, DC, Chicago, Cambridge
I have a struts application which I need to integrate with OpenCms 6.0.
The Struts application works separately fine. But how do I bring the Jsp's available in the Struts application into OpenCms so that the front-end is available in OpenCms and the controller and validations are available in Struts.
How do I need to configure the web.xml/struts-config.xml so that both can be integrated easily?
Is there any guide which will help me in doing this?
Regards
Krishnan
---------------------------------------------------------------------------------------------------------------
Re: Integration of Struts application with OpenCms
In web.xml of Opencms Specify the servlet name and class of apache struts ActiionServlet. You can follow the below xml code snippet. servlet name is action, servlet class will be org.apache.action.ActionServlet.
Then you have init parameters of your struts-config.xml param name is config, param-vlaue will be your struts-config.xml's path. for eg. /WEB-INF/struts-config/struts-config.xml
action
org.apache.struts.action.ActionServlet
config
/WEB-INF/struts-config/struts-config.xml
And about struts-config.xml as in your normal struts application follw the same methodology. But when you are about to give the action forward to the specified jsp of Opencms 6 you have to take care of two conditions,
1. Offline
2. Online
/WEB-INF/jsp is the root folder which contains all the jsp's of Opencms. When you are working offline in Opencms 6 you have to specify the offline jsp forwards. When you publish your project in Opencms 6 all your offline content will be turned out to online content. at that time you have to specify the offline jsp forwards.
Obviously when you go live with your website created by Opencms 6 all offline content will be online.
Sharan