[Opensource] [Expresso 5 Design Architecture] ControllerResponse.findForward

Peter A. J. Pilgrim peterp at xenonsoft.demon.co.uk
Mon Oct 14 10:26:33 PDT 2002


Hi

I am considering an Expresso 5+/6 enhancemnet at the mo ..
Current we can set a Struts ActionForward using `ControllerResponse#setStyle'
method. I had a little a problem with the name , but I was to live
with it, but then it struck me that Expresso restrict the power of
pure Struts Action API. Namely, it is possible to dynamically create
your own `ActionForward' and then request dispatch forward on it.
In other words a pure Struts writer normally writes

	return mapping.findForward( "<forward-pathname>" )

but she could easily invent an forward of her choice like this

	return  new ActionForward( "whatever URL I like" );

Unfortunately you cant do this with the current Expresso API so I propose a 
little enhancement like


package com.jcorporate.expresso.core.controller

class  ControllerResponse {

	ActionMapping   getMapping() { }

	ActionForward	ControllerResponse.findForward( String style ) { }

	void		ControllerResponse.setForward( ActionForward ) { }

}

This would also allow us the oppurtunity to expose the `ActionMapping'.
It would also be attractive to pure Struts users.

However, the trouble is that when Mike Nash originally integrates Struts
  in to EF he wanted to hide the Struts / Servlets from the controller functionally.
He wanted to able to run Controller outside the HTTP Java Servlet enviroment.

So what do we do, then ?

One idea I suppose is to introduce a special subclass
`ServletControllerResponse' and then heavy HTTP specific Controller can
just cast downwards.

	ControllerResponse myResponse = ...
	ServletControllerResponse theRealthing =
		(ServletControllerResponse) myResponse


Ideas?

-- 
Peter Pilgrim

The e-Commerce team keeps losing game after game.
Coach, what are you gonna do? Need a new [IT] striker?
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
|  ``http://www.xenonsoft.demon.co.uk/no-it-striker.html''  |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Follow the link to my on-line resume and interview videos.




More information about the Opensource mailing list