Re: struts 2 portlet interceptor issue
Instead of writing interceptors I decided to go with the suggestion you made, which is use the raw session with the use of portlet:defineObjects/ but what I want to know is how can I access the jsp expression variables inside the s:property and s:if tags. We primarily use struts tags, because of this I thought of use s:set tag to assign the portlet application scope variable and use there after but it failed pls see the below failed attempt. portlet:defineObjects/ % UserSession userSession =(UserSession)renderRequest.getPortletSession().getAttribute(UserSessionForApplication,PortletSession.APPLICATION_SCOPE); String loginId= userSession.getLoginId(); % s:set name=studentId value='%=loginId%' / s:set name=studentId2 value=#attri.loginId / s:property value=studentId/ br s:property value=studentId2/ br none of the above printed the value, how to proceed on this Note: UserSession is one of our custom classes Nils-Helge Garli wrote: action name=testAction class=test.MyAction interceptor-ref name=sessionScopeHandler/interceptor-ref result/jsp/test/test.jsp/result /action With this configuration, your sessionScopeHandler will be the only interceptor running for this action. You either need to include the portletDefaultStack or set up your own stack that also includes the framework interceptors that does the introspection magic. Nils-H - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org -- View this message in context: http://www.nabble.com/struts-2-portlet-interceptor-issue-tp24799881p24819616.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
struts 2 portlet interceptor issue
Hi, I wrote a interceptor as follows but looks like variables/parameters in the action class are not populated as part of the form submission. Which means introspection does not seem to work it gives null values, I only defined the interceptor not modified the default stack, pls advice how to get the introspection also working, my interceptor and struts.xml roughly looks as follows. public class PortletApplicationScopeHandler extends AbstractInterceptor { public String intercept(ActionInvocation invocation) throws Exception { invocation.addPreResultListener(new PreResultListener(){ @SuppressWarnings(unchecked) public void beforeResult(ActionInvocation invocation, String resultCode) { //some logic here before it goes to the target jsp // } } ); return invocation.invoke(); } } and in my struts.xml the interceptor looks as follows package name=myStuff extends=struts-portlet-default namespace=/myStuff interceptors interceptor name=sessionScopeHandler class=test.interceptor.PortletApplicationScopeHandler / /interceptors action name=testAction class=test.MyAction interceptor-ref name=sessionScopeHandler/interceptor-ref result/jsp/test/test.jsp/result /action ... .. -- View this message in context: http://www.nabble.com/struts-2-portlet-interceptor-issue-tp24799881p24799881.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: struts 2 portlet interceptor issue
action name=testAction class=test.MyAction interceptor-ref name=sessionScopeHandler/interceptor-ref result/jsp/test/test.jsp/result /action With this configuration, your sessionScopeHandler will be the only interceptor running for this action. You either need to include the portletDefaultStack or set up your own stack that also includes the framework interceptors that does the introspection magic. Nils-H - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org