struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Krah <tk...@fachschaft.imn.htwk-leipzig.de>
Subject Re: Portlet, DirectRenderFromEventAction - how to change the interceptor stack?
Date Fri, 24 Oct 2008 09:27:44 GMT
Am Freitag, 24. Oktober 2008 11:09:43 schrieb Torsten Krah:
> PortletActionContext.getActionRequest().getPortletSession()

Some more thoughts about this.
I think this is a design error in struts2.


    public static ActionRequest getActionRequest() {
        if (!isEvent()) {
            throw new IllegalStateException(
                    "ActionRequest cannot be obtained in render phase");
        }
        return (ActionRequest) getContext().get(REQUEST);
    }


Code is done like this, thats ok because i should not be able to make state 
changes, it seems good to not allow access if this is render phase.
However, PRG does allow transfering objects in the session (ActionErrors, 
Messages and FieldErrors for example have to be put there to show them on the 
next action - have to be "handwritten" interceptor or something).

But the only way i see to get at the portlet global session is via the 
ActionRequest calling getPortletSession (it is the only one, isn't it?) - but 
if i cannot call getActionRequest, how should i get my session object?
This is confusing - implementing SessionAware does not help, because the only 
thing i get is the session applied to my portlet, but not the global session 
(APP_SCOPE) i need to share stuff between portlet/servlets.
Some hints? File a jira report?

-- 
Bitte senden Sie mir keine Word- oder PowerPoint-Anhänge.
Siehe http://www.gnu.org/philosophy/no-word-attachments.de.html

Really, I'm not out to destroy Microsoft. That will just be a 
completely unintentional side effect."
	-- Linus Torvalds

Mime
View raw message