Does some body has an example of SiteMesh 3 with Struts2 ?

796 views
Skip to first unread message

Alfabeto

unread,
Jun 6, 2011, 12:13:48 AM6/6/11
to SiteMesh 3 Users
Hello People

Does some body has an example of SiteMesh 3 with Struts2 ?

I've just need the web.xml configurations file.

I've tried everything but it didn't worked.

Greetings

Joe Walnes

unread,
Jun 17, 2011, 10:16:54 AM6/17/11
to sitemes...@googlegroups.com
Here's a minimal example of SM3 running on it's own (with web.xml):

I'm afraid I don't have any Struts2 examples. Are there any Struts2 users on the list who can help?

Christian Grobmeier

unread,
Jun 17, 2011, 12:29:12 PM6/17/11
to sitemes...@googlegroups.com
> I'm afraid I don't have any Struts2 examples. Are there any Struts2 users on
> the list who can help?

I am using Struts 2 with SM2. Having tried to upgrade to v3, but
stopped when I saw that there is some work at the Sitemesh plugin
necessary:
http://struts.apache.org/2.2.3/docs/sitemesh-plugin.html

guess one needs to write a new plugin for integrating S3

Cheers
Christian

>
> On Sun, Jun 5, 2011 at 11:13 PM, Alfabeto <marcelo...@gmail.com> wrote:
>>
>> Hello People
>>
>> Does some body has an example of  SiteMesh 3 with Struts2 ?
>>
>> I've just need the web.xml configurations file.
>>
>> I've tried everything but it didn't worked.
>>
>> Greetings
>

--
http://www.grobmeier.de

xtian

unread,
Jun 23, 2011, 4:26:45 AM6/23/11
to SiteMesh 3 Users
I'm using Sitemesh 3 in Struts 2 with no problem other than the
upload.

This is my web.xml (using Struts 2, Spring, Spring Security,
Hibernate):

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://
java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>MyApp</display-name>
<listener>
<listener-
class>org.springframework.web.context.ContextLoaderListener</listener-
class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/
applicationContext.xml,classpath*:applicationContextDev.xml</param-
value>
</context-param>
<listener>
<listener-
class>org.apache.struts2.dispatcher.ng.listener.StrutsListener</
listener-class>
</listener>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</
filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>openSessionInViewFilter</filter-name>
<filter-
class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</
filter-class>
</filter>
<filter-mapping>
<filter-name>openSessionInViewFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>org.sitemesh.config.ConfigurableSiteMeshFilter</
filter-class>
</filter>
<filter>
<filter-name>struts-prepare</filter-name>
<filter-
class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter</
filter-class>
</filter>
<filter>
<filter-name>struts-execute</filter-name>
<filter-
class>org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter</
filter-class>
</filter>

<filter-mapping>
<filter-name>struts-prepare</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>struts-execute</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>


</web-app>



Hope this helps.

Xtian
Reply all
Reply to author
Forward
0 new messages