I want to render the JSP after the the processAction() method has been called out of an other method. I am using Liferay 6.2 and JBoss 7.1.1.
That's the method that have to call the processAction() and the doView() method:
@Override
public void update(Observable arg0, Object arg1) {
if(actualSite.equals("/views/measurement.jsp")) {
this.x = (String) arg1;
try {
this.processAction(aRequest, aResponse); //works
this.doView(rRequest, rResponse); //doesn't work
} catch (IOException e) {
e.printStackTrace();
} catch (PortletException e) {
e.printStackTrace();
}
}
}
It works fine for processAction(), but for doView() I get this error:
[org.apache.jasper.runtime.JspFactoryImpl] (Thread-108) Exception initializing page context: java.lang.IllegalStateException: Page needs a session and none is available at org.apache.jasper.runtime.PageContextImpl._initialize(PageContextImpl.java:148) [jbossweb-7.0.13.Final.jar:] at org.apache.jasper.runtime.PageContextImpl.initialize(PageContextImpl.java:124) [jbossweb-7.0.13.Final.jar:] at org.apache.jasper.runtime.JspFactoryImpl.internalGetPageContext(JspFactoryImpl.java:106) [jbossweb-7.0.13.Final.jar:] at org.apache.jasper.runtime.JspFactoryImpl.getPageContext(JspFactoryImpl.java:62) [jbossweb-7.0.13.Final.jar:] at org.apache.jsp.views.measurement_jsp._jspService(measurement_jsp.java:52) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) [jbossweb-7.0.13.Final.jar:] at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final] at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:369) [jbossweb-7.0.13.Final.jar:] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:326) [jbossweb-7.0.13.Final.jar:] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:253) [jbossweb-7.0.13.Final.jar:] at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329) [jbossweb-7.0.13.Final.jar:] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:] at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilterChain.doFilter(InvokerFilterChain.java:116) [portal-service.jar:] at com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter.doFilter(InvokerFilter.java:96) [portal-service.jar:] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280) [jbossweb-7.0.13.Final.jar:] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248) [jbossweb-7.0.13.Final.jar:] at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:840) [jbossweb-7.0.13.Final.jar:] at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:720) [jbossweb-7.0.13.Final.jar:] at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:657) [jbossweb-7.0.13.Final.jar:] at com.liferay.portlet.PortletRequestDispatcherImpl.dispatch(PortletRequestDispatcherImpl.java:331) at com.liferay.portlet.PortletRequestDispatcherImpl.include(PortletRequestDispatcherImpl.java:112) at com.liferay.util.bridges.mvc.MVCPortlet.include(MVCPortlet.java:371) [util-bridges.jar:] at com.liferay.util.bridges.mvc.MVCPortlet.include(MVCPortlet.java:387) [util-bridges.jar:] at de.pax.qm.measurement.Controller.doView(Controller.java:74) [classes:] at de.pax.qm.measurement.Controller.update(Controller.java:83) [classes:] at java.util.Observable.notifyObservers(Observable.java:142) [rt.jar:1.6.0_45]
I look forward for your advice.
processAction
anddoView
method like this? These are life-cycle methods and not meant to be used this way. – Prakash K