Domain properties in Glassfish

You can make properties files available to you WAR and EAR applications by putting the file in the folder glassfish/domains/${glassfish.domain.name}/lib/classes

You can use these in your spring configuration by prefixing the resource name with classpath:. For example:

<beans:bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <beans:property name="location" value="classpath:some.properties"/>
</beans:bean>

Custom AuthenticationProvider in Spring Security

In your application context you need

<beans:beans   xmlns="http://www.springframework.org/schema/security"
               xmlns:beans="http://www.springframework.org/schema/beans"
               xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xsi:schemaLocation="http://www.springframework.org/schema/beans
                                   http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
                                   http://www.springframework.org/schema/security
                                   http://www.springframework.org/schema/security/spring-security-2.0.4.xsd"> 
   <http>
      [...]
   </http>
   <beans:bean id="myAuthenticationProvider"
                       class="com.example.security.MyAuthenticationProvider">
      <custom-authentication-provider/>
   </beans:bean>

If you are using username and password authentication, your bean can then extend the abstract base class that comes with Spring:

org.springframework.security.providers.dao.AbstractUserDetailsAuthenticationProvider

Struts2 and Spring Integration

It is possible to use Spring to create Struts2 actions. Here are some snippets which make it work.

in your web.xml

<listener>
   <listener-class>
      org.springframework.web.context.ContextLoaderListener
   </listener-class>
</listener>
<filter>
   <filter-name>struts2</filter-name>
   <filter-class>
      org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
   </filter-class>
</filter>
<filter-mapping>
   <filter-name>struts2</filter-name>
   <url-pattern>/*</url-pattern>
</filter-mapping>

In your struts.xml

<constant name="struts.objectFactory" value="spring" />

In your pom.xml

<dependency>
   <groupId>org.apache.struts</groupId>
   <artifactId>struts2-core</artifactId>
   <version>2.1.6</version>
</dependency>
<dependency>
   <groupId>org.apache.struts</groupId>
   <artifactId>struts2-spring-plugin</artifactId>
   <version>2.1.6</version>
</dependency>
<dependency>
   <groupId>org.springframework</groupId>
   <artifactId>spring</artifactId>
   <version>2.5.5</version>
</dependency>