An Isis app is a Wicket app, so you can use the Wicket API to write a
little domain service.
Here's one way:
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();
}
}
On 10 September 2014 13:13, <[email protected]> wrote:
> How can we reload the .properties without restarting the server or without
> reloading the webapp as we do it in using ServletContext?
> If not how can we access to ServletContext from Isis API. Because it has
> method getResourceAsStream(). This This allows you update the file without
> having to reload the webapp as required.
>
> Waiting for your feedback.
>
> Thanks
> Ranganath
>
> The information contained in this electronic message and any attachments
> to this message are intended for the exclusive use of the addressee(s) and
> may contain proprietary, confidential or privileged information. If you are
> not the intended recipient, you should not disseminate, distribute or copy
> this e-mail. Please notify the sender immediately and destroy all copies of
> this message and any attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient
> should check this email and any attachments for the presence of viruses.
> The company accepts no liability for any damage caused by any virus
> transmitted by this email.
>
> www.wipro.com
>