You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@isis.apache.org by "Dan Haywood (JIRA)" <ji...@apache.org> on 2014/09/25 17:06:34 UTC
[jira] [Resolved] (ISIS-869) Domain service (probably isisaddons)
to wrap HttpSession.
[ https://issues.apache.org/jira/browse/ISIS-869?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dan Haywood resolved ISIS-869.
------------------------------
Resolution: Fixed
Created a new addons service at [1]
[1] https://github.com/isisaddons/isis-module-servletapi.
> Domain service (probably isisaddons) to wrap HttpSession.
> ---------------------------------------------------------
>
> Key: ISIS-869
> URL: https://issues.apache.org/jira/browse/ISIS-869
> Project: Isis
> Issue Type: New Feature
> Components: Add-ons
> Affects Versions: core-1.6.0
> Reporter: Dan Haywood
> Assignee: Dan Haywood
> Priority: Minor
> Fix For: core-1.7.0
>
>
> 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() {
> return WebApplication.get().getServletContext();
> }
> }
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)