Re: [NEWBIE] Local forward with html:link?

2004-09-30 Thread Adam Hardy
You can take 2 approaches.
You can split the page into tiles, one tile contains the form input 
elements and is nested inside the other tile which contains the form and 
the buttons. Then you re-use the first tile and swop the second tile 
depending on your mapping.

Alternatively you can have a dispatch action. This would be the action 
of the submit, and it would direct execution within struts to your 
desired method within your action.

HTH
Adam
On 09/29/2004 04:02 PM fjalvingh wrote:
I have no issue with the action: it indeed has no knowledge about the
actual views being used which is OK. It means I'm able to re-use
actions if I want to.
The JSP pages however seem to know way to much about navigation. They
know this because they directly refer to an action path. This seems to
make it impossible to re-use the same JSP page in a different context.
As an example take a JSP page that is used to display a product. I
should be able to use this page from a flow where all products are
shown, and from a flow where products are searched, and from a flow
where products are edited. The JSP page has a number of predefined
"exits" like "previous", "next", "edit", "back". The presentations for
these exits should be visible only for contexts where they have
meaning (where they are mapped to some action).
To make this page reusable I need to be able to connect each "exit" to
a different action depending on the context that the page is used in.
I would have expected that I could "wire" these entries using the
action spec the page returns to. As I now start to understand this is
possible but by hand- by making a special controller OR a new base
class for Actions which uses a parameter to dispatch to a specified
forward. But I still need to hard connect a JSP page to a controller
as the target and this makes re-use of the page hardly possible. Am I
right in this?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: [NEWBIE] Local forward with html:link?

2004-09-29 Thread fjalvingh
I have no issue with the action: it indeed has no knowledge about the
actual views being used which is OK. It means I'm able to re-use
actions if I want to.

The JSP pages however seem to know way to much about navigation. They
know this because they directly refer to an action path. This seems to
make it impossible to re-use the same JSP page in a different context.
As an example take a JSP page that is used to display a product. I
should be able to use this page from a flow where all products are
shown, and from a flow where products are searched, and from a flow
where products are edited. The JSP page has a number of predefined
"exits" like "previous", "next", "edit", "back". The presentations for
these exits should be visible only for contexts where they have
meaning (where they are mapped to some action).

To make this page reusable I need to be able to connect each "exit" to
a different action depending on the context that the page is used in.

I would have expected that I could "wire" these entries using the
action spec the page returns to. As I now start to understand this is
possible but by hand- by making a special controller OR a new base
class for Actions which uses a parameter to dispatch to a specified
forward. But I still need to hard connect a JSP page to a controller
as the target and this makes re-use of the page hardly possible. Am I
right in this?



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [NEWBIE] Local forward with html:link?

2004-09-28 Thread Duncan Mills
No I wouldn't say that putting "/bookEdit.do" in the JSP gives it any 
knowledge of the navigation sequence.  By definition an Action is an 
abstraction, the page knows nothing of the implementation, which is the 
point of having the controller.
Forwards themselves are attributes of the ActionMapping not the .JSP, so 
logically using the forward parameter you are binding the .JSP to a 
particular Action in any case and it's no different from using an action 
reference directly.  Maybe you ought to look at some kind of generic 
router or some of the DispatchActions if you want a more abstracted 
"Event" driven model in your links - I think that's a valid route to go 
and it's something we done a lot. 
Within the specialised data binding aware actions that we (Oracle) 
supply as part of our Application Development Framework (ADF), the 
DataForwardAction, which is used as a displayer and event hander for 
data bound pages, has a just such an eventing model.
A link can use an event= url parameter which by default will cause 
a forward with the same  to be returned, of course that is coupled 
with the ability to implement your own code to react to that event as 
well.  However, it does mean that the same page can be re-used because 
it's now working on a named event basis, and then it's  up to the 
handling action to process the event as makes sense in the context that 
the .JSP is being used.
As I say this is just one possible implementation...

Regards
Duncan Mills
fjalvingh wrote:
I know that, but specifying "/bookEdit.do" in the JSP means that the
JSP has knowledge of where to go next. I want this knowledge to be
embedded in the struts-config.xml, not in the pages. So the JSP page
just specifies "exits", and the struts-config.xml "wires" those exits
to actions.
Thanks for your answer though ;-)
Frits
 

Not a 100% percent I undestand what you propose to do, but could you not
just say:
edit
Or am I missing something here?
HÃ¥kon
--
We shall fight on the beaches,
we shall fight on the landing grounds,
we shall fight in the fields and in the streets,
we shall fight in the hills;
we shall never surrender
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
   


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]