You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bob Jensen <Bo...@oracle.com> on 2003/09/22 21:48:55 UTC

Struts reusable jsp design question?

Warning I am new to Struts, so I appoligize if this has been addressed
before, however I
have not found a discussion on this.

I want to create a jsp that is reusable from several jsps, for this
discussion I will call it Resuable.jsp.

Here is the problem I am trying to solve.

CallerOne.jsp requires 3 pieces of data(key1, key2, key3), so I have
CallerOnePreparePageAction that prepares the data for the jsp.

CallerOne.jsp calls ResuablePreparePageAction passing in the data needed by
Reusable.jsp.
Reusable.jsp call ReusableAction to perform its task.  If successful
ReusableAction  needs to return
to who ever called it and needs to pass back the required pieces of
data needed by the caller, in this case (key1, key2, key3).

I want this to work if CallerTwo.jsp that requires, 4 different pieces of
information calls Reusable.jsp as well.

Some ideas:
I could require that the return action, and a list of return fields be
specified, but that would seem to require building
hidden fields on the Reusable.jsp and building a dynamic forward in
ReusableAction.

I could put the caller's form bean in session scope, and pass in the return
action, but what about multiple browser
windows being opened on the caller?

Is there a Struts best practices approach to this problem?

thanks in advance,
Bob













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


RE: Struts reusable jsp design question?

Posted by Mike Jasnowski <mj...@bea.com>.
Have you looked at Tiles?

-----Original Message-----
From: Bob Jensen [mailto:Bob.Jensen@oracle.com]
Sent: Monday, September 22, 2003 3:49 PM
To: struts-user@jakarta.apache.org
Subject: Struts reusable jsp design question?


Warning I am new to Struts, so I appoligize if this has been addressed
before, however I
have not found a discussion on this.

I want to create a jsp that is reusable from several jsps, for this
discussion I will call it Resuable.jsp.

Here is the problem I am trying to solve.

CallerOne.jsp requires 3 pieces of data(key1, key2, key3), so I have
CallerOnePreparePageAction that prepares the data for the jsp.

CallerOne.jsp calls ResuablePreparePageAction passing in the data needed by
Reusable.jsp.
Reusable.jsp call ReusableAction to perform its task.  If successful
ReusableAction  needs to return
to who ever called it and needs to pass back the required pieces of
data needed by the caller, in this case (key1, key2, key3).

I want this to work if CallerTwo.jsp that requires, 4 different pieces of
information calls Reusable.jsp as well.

Some ideas:
I could require that the return action, and a list of return fields be
specified, but that would seem to require building
hidden fields on the Reusable.jsp and building a dynamic forward in
ReusableAction.

I could put the caller's form bean in session scope, and pass in the return
action, but what about multiple browser
windows being opened on the caller?

Is there a Struts best practices approach to this problem?

thanks in advance,
Bob













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



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