struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Moore" <tmo...@blackboard.com>
Subject RE: ActionForward integration question
Date Mon, 01 Apr 2002 22:44:12 GMT
If I understand your problem correctly, it would seem like the easiest
thing to do is create a base Action class that all of your actions
extend which captures the return values and does whatever it needs:

public class MyAction extends Action {
  public ActionForward execute( ... ) throws Exception {
    ActionForward forward = myExecute( ... );
    return mungeForward( forward );
  }

  public abstract ActionForward myExecute( ... ) throws Exception;

  private ActionForward mungeForward( ActionForward forward )
  {
    ....
  }
}

That's the basic idea...
-- 
Tim Moore / Blackboard Inc. / Software Engineer
1899 L Street, NW / 5th Floor / Washington, DC 20036
Phone 202-463-4860 ext. 258 / Fax 202-463-4863


> -----Original Message-----
> From: Heath Chiavettone [mailto:HChiavettone@ariba.com] 
> Sent: Monday, April 01, 2002 4:55 PM
> To: 'struts-dev@jakarta.apache.org'
> Subject: ActionForward integration question
> 
> 
> It seems that I may have biased this question with the title 
> I used on the struts-users list since I didn't get any 
> answers.  So perhaps you dev guys might be able to help me:  
> Here is my question:
> 
>  
> 
> We have a resource management scheme that will take a 
> relative pathed resource, and for a particular user (based on 
> some session variables) will resolve this relative pathed 
> resource into an absolute resource (i.e. if the user belongs 
> to "ACME" company, we will resolve the resource
> 
> jsp/SomePage.jsp into /brands/acme/jsp/SomePage.jsp).  I want 
> to be able to define my <forward> definitions as relative 
> paths, and somehow insert our resource manager in between the 
> returning of the (relative) ActionForward from the 
> Action.execute() call and the actual RequestDispatcher 
> "forwarding" mechanism.  The only method parameter I would 
> need to be able to resolve the resource is the HttpServletRequest.
> 
>  
> 
> Is this scheme even possible in Struts 1.1?
> 
>  
> 
> If not, is there an alternate to this that doesn't involve me 
> having forwards for every possible configuration?
> 
>  
> 
> Thanks,
> 
>  
> 
> Heath
> 
> 

--
To unsubscribe, e-mail:   <mailto:struts-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-dev-help@jakarta.apache.org>


Mime
View raw message