[prev in list] [next in list] [prev in thread] [next in thread] 

List:       struts-user
Subject:    RE: Strtus and Portlets
From:       "Andy Foster" <andy () fostersontheweb ! com>
Date:       2006-06-30 14:39:33
Message-ID: 20060630144001.7877910FB015 () asf ! osuosl ! org
[Download RAW message or body]

There is actually an apache struts portlet bridge and it is this that puts
some limitations on how you define struts-config and your actions.

http://portals.apache.org/bridges/multiproject/portals-bridges-struts/ 

It is this bridge and my pattern that I want to double check

Regards

Andy

-----Original Message-----
From: Paul Benedict [mailto:paul4christ79@yahoo.com] 
Sent: 30 June 2006 15:28
To: Struts Users Mailing List
Subject: Re: Strtus and Portlets

Portlets use the Portlet API. Struts uses the Servlet API. The Portlet API
is nothing but a facade over the servlet api. I do not have any experience
with Struts  in a portlet, but I envision it is not possible because every
portlet instance as container-encoded request parameter names. And
everything must be an include, not a forward.

Andy Foster <andy@fostersontheweb.com> wrote: 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


 path="/logon_redirect"
 name="logonForm"
 type="org.xxx.RelayAction"
 scope="request"
 validate="false">    
      
  




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



 path="/display_briefcase" 
 name="briefcaseForm"
 type="org.xxx.GetBriefcaseAction"
 scope="request"
 validate="false">
   


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



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



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org

 		
---------------------------------
Yahoo! Music Unlimited - Access over 1 million songs.Try it free. 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic