Testing web.xml filters from IDE launch [message #1752886] |
Mon, 30 January 2017 11:06 |
|
Hi all,
is there a way to test/debub the behavior of a filter in web.xml from the IDE launch, that is, without having to deploy the RAP war into a Servlet container?
Thank you very much
Vincenzo
|
|
|
|
Re: Testing web.xml filters from IDE launch [message #1752908 is a reply to message #1752887] |
Mon, 30 January 2017 14:21 |
|
Thank you Ivan,
but I omitted to write that we are using the RAP Launcher.
We have RAP applications based on OSGi, with all the classic 3.x workbench, and we have always used the RAP Launcher up to now.
As far that I can see only the RWT Launcher provides a way to specify a web.xml.
Is it possible to use the RWT Launcher also in our scenario?
Thanks
Vincenzo
|
|
|
|
Re: Testing web.xml filters from IDE launch [message #1753973 is a reply to message #1753040] |
Mon, 13 February 2017 14:26 |
|
Thank you Ivan,
but maybe I could do with an intermediate solution where you can help us.
Let me explain.
In a classic JSP page I can do this:
getServletContext().getInitParameter("PARAM1")
and I can retrieve the PARAM1 value defined in web.xml like this
<context-param>
<param-name>PARAM1</param-name>
<param-value>TEST</param-value>
</context-param>
Now, in a RAP (with workbench) application, let's say I dare to do this:
RWT.getRequest().getServletContext().getInitParameter("PARAM1");
where does it look for in order to resolve the value?
Could I put some file with a given name in some internal RAP runtime folder in such a way it can resolve an find the value?
Thank you very much
Vincenzo
|
|
|
|
Re: Testing web.xml filters from IDE launch [message #1754072 is a reply to message #1754015] |
Tue, 14 February 2017 11:51 |
|
Thank you Chris,
it seems a good idea.
However now when if I try to set a parameter:
httpServlet.getServletContext().setInitParameter(...)
I get this error
java.lang.IllegalStateException
at org.eclipse.jetty.servlet.ServletContextHandler$Context.setInitParameter(ServletContextHandler.java:1132)
I also tried to do this in a JEE thread
RWT.requestThreadExec(new Runnable() {
@Override
public void run() {
httpServlet.getServletContext().setInitParameter("PARAM1", "AAA");
}
});
but the result it's the same.
|
|
|
|
Powered by
FUDForum. Page generated in 0.03526 seconds