Actually, the problem so far not with this part. As I did it before.
The problem is, I need to access ServletContext from SampleFilter which is you know is extended from org.exoplatform.web.filter.Filter which has only one method doFilter, even initiate method won't be executed. (We can get ServletContext from FilterConfig.getServletContext()).
So, what alternative that's eXo could offer us to handle this peice ?
The problem as following:
I need to do simple integration between java and php by implement php-java-bridge. The main purpose, is just to passing parameter from login jsp page to php corresponding one.
This process should be handle during Servlet (PortalLoginController), but I had got recomendation to adopt SampleFilter for this instead of modify web.xml related files to obtain continuse support.
I did this, follow the procedure step by step. But, ServletContext won't be accessable.
The piece of code is:
HttpServletRequest httpRequest = (HttpServletRequest)request; HttpServletResponse httpResponse = (HttpServletResponse)response; RemoteHttpServletContextFactory ctx = new RemoteHttpServletContextFactory(getServlet(), getFilterConfig().getServletContext(), httpRequest, httpRequest, httpResponse);
Besides, at the end of this code I do simple function
your support is really appreciated.
Khaldoun Khashan wrote:
I'll try this and refer you back.
But, do their any stucks while implementing ctx.handleRequests(httpRequest.getInputStream(),httpResponse.getOutputStream());
I mean, any conflict between this and eXo container lifecycle.?
There might be conflict ( kind of IllegalStateException as both getOutputStream()/getWriter() are invoked on httpResponse object)