Details
-
New Feature
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
core-1.6.0
-
None
Description
as per mailing list discussion:http://markmail.org/message/l4yh5cfu7dz2kn33
~~~~~~~~~~~~~
1. Assuming you want to access the ServletContext from your domain model:
add to dom/pom.xml (so that ServletContext is on classpath):
<dependency>
<groupId>org.apache.geronimo.specs</groupId>
<artifactId>geronimo-servlet_2.5_spec</artifactId>
<optional>true</optional>
</dependency>
2. in dom project, define interface:
package dom;
import javax.servlet.ServletContext;
import org.apache.isis.applib.annotation.Programmatic;
public interface ServletContextProvider
{ @Programmatic public ServletContext getServletContext(); }3. in webapp project, define implementation:
package webapp;
import dom.ServletContextProvider;
import javax.servlet.ServletContext;
import org.apache.wicket.protocol.http.WebApplication;
import org.apache.isis.applib.annotation.DomainService;
import org.apache.isis.applib.annotation.Programmatic;
@DomainService
public class ServletContextService implements ServletContextProvider {
@Programmatic
public ServletContext getServletContext()
}