struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andy Foster" <a...@fostersontheweb.com>
Subject Strtus and Portlets
Date Mon, 03 Jul 2006 08:28:53 GMT
Hi all,

I am about to develop a new struts app that will be ported afterwards to be
used in a portlet and I plan to use the struts bridge support. I want to try
and ensure that I don't break the bridge with my normal conceptual design
before I start building anything. The pattern I use is to break up
processing of the request from the display of the next page and to handle a
form that has multiple submit buttons that need to perform different actions
(yes that good old problem)

I usually implement this pattern in struts-config to separate out concerns:

1) Page always calls a redirect action that takes the submitaction attribute
in the form and finds the forward using the submitaction as the key.
2) The process action then processes the request and on success calls a
display action to render the next page
3) The display action finally calls a go action that is the simple redirect
to the JSP

<action 
	path="/logon_redirect"
	name="logonForm"
	type="org.xxx.RelayAction"
	scope="request"
	validate="false">			 
		<forward name="logon" path="/process_logon.ask"/>    
		<forward name="cancel" path="/go_welcome.ask"/>

</action>

<action 
	path="/process_logon"
	name="logonForm"
	type="org.xxx.LogonAction"
	scope="request"
	input="/go_logon.ask" 
	validate="true">
		<forward name="success" path="/display_briefcase.ask"/>
</action>

<action 
	path="/display_briefcase" 
	name="briefcaseForm"
	type="org.xxx.GetBriefcaseAction"
	scope="request"
	validate="false">
		<forward name="success" path="/go_briefcase.ask"/> </action>

<action
      path="/ go_briefcase.ask "
      forward="/jsp/briefcase.jsp">
</action>


This is obviously action chaining and I'm aware that this can cause issues
in portlets and the bridge due to the separation of ActionRequests and
ActionResponse interfaces. I have read the website and if I'm reading
correctly the bridge would separate ActionRequests from ActionResponse
processing on the first action forward, in this case on my redirect meaning
the process would be part of the render which is not what I want.

Am I correct or will the above work OK?
What changes may I have to make to ensure I integrate with the bridge
seamlessly?

Regards

Andy Foster




Mime
View raw message