You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Rick Reumann <ma...@reumann.net> on 2002/06/12 21:31:21 UTC

If several JSs share the same action mapping...?

How to do you deal with the input="?" parameter when setting up an
action mapping that different JSPs will share? I thought this "input"
declaration was so if you are using validation it knows which page to
return to with the validation errors. How is this accomplished when
you have different JSPs that could share this action mapping but also
need to be validated and thus I think also require the input field to
be supplied?

TIA

-- 

Rick
mailto:maillist@reumann.net

"Maybe in order to understand mankind, we have to look at the word
itself: 'Mankind'. Basically, it's made up of two separate words -
'mank' and 'ind'. What do these words mean ? It's a mystery, and
that's why so is mankind." 
  -Jack Handey


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re[4]: If several JSPs share the same action mapping...?

Posted by Rick Reumann <ma...@reumann.net>.
On Wednesday, June 12, 2002, 9:37:24 PM, Robert Taylor wrote:

RT> That's what the action mappings are for. I don't think it is
RT> necessarily bad to have a bunch of action mappings. IMHO, I would
RT> rather have multiple action mappings than a code kludge.

    Yea, I'm realizing that now. It makes it much easier to understand
    even if the code happens to be larger in size (in the struts-xml
    file that is). You and Ted have helped a lot thanks.

    --

    Rick


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Re[2]: If several JSPs share the same action mapping...?

Posted by Robert Taylor <rt...@mulework.com>.
Rick, if you have multiple JSPs all using the same action and need to
determine where to send the user upon a validation error, why not just
have several action mappings and explicitely define the appropriate input
path for each one. That's what the action mappings are for. I don't think
it is necessarily bad to have a bunch of action mappings. IMHO, I would
rather
have multiple action mappings than a code kludge. My advice would be to use
the framework. You can always use a tool to manage your struts-config file.

I do this very thing for my project. I have productized download screens
that
all use the same download action. If an error occurs, I need to send them
back
to the correct product download screen. Using multiple action mappings that
all
map to the same action but have different inputs defined has made this
extremely
easy. No kludge at all.

Just my .02.

robert

> -----Original Message-----
> From: Rick Reumann [mailto:maillist@reumann.net]
> Sent: Wednesday, June 12, 2002 5:58 PM
> To: Struts Users Mailing List; ted@husted.com
> Subject: Re[2]: If several JSPs share the same action mapping...?
>
>
> On Wednesday, June 12, 2002, 5:42:27 PM, Ted wrote:
>
> TH> The input property doesn't have to be a JSP. It could be another
> TH> action. If that action had another way, besides the input
> TH> property, to determine where to send control, it could return
> TH> whatever ActionForward needed.
>
>     Hmmm, actually I easily have a way to determine where to send
>     control since there already is a field in the DynaForm that ends
>     up dictating the initial page to go to in the first place. I
>     didn't know I could use an Action as an input property. If that's
>     the case then I would think, after I put an Action in the input
>     property, I could use this Action to check the field in the
>     DynaForm and call the appropriate ActionForward which would return
>     me to the correct page and display my validation errors?
>
>     ---
>
>     Rick
>
>
> TH> One nasty kludge would be to put the name of the JSP into the
> file as a
> TH> hidden property. The action would then know to look for that
> propery and
> TH> could create an ActionForward back to it. You could also try
> looking at
> TH> the refer header, but I don't know how reliable that would be.
>
>
> --
> To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re[2]: If several JSPs share the same action mapping...?

Posted by Rick Reumann <ma...@reumann.net>.
On Wednesday, June 12, 2002, 5:42:27 PM, Ted wrote:

TH> The input property doesn't have to be a JSP. It could be another
TH> action. If that action had another way, besides the input
TH> property, to determine where to send control, it could return
TH> whatever ActionForward needed.

    Hmmm, actually I easily have a way to determine where to send
    control since there already is a field in the DynaForm that ends
    up dictating the initial page to go to in the first place. I
    didn't know I could use an Action as an input property. If that's
    the case then I would think, after I put an Action in the input
    property, I could use this Action to check the field in the
    DynaForm and call the appropriate ActionForward which would return
    me to the correct page and display my validation errors?

    ---

    Rick
    

TH> One nasty kludge would be to put the name of the JSP into the file as a
TH> hidden property. The action would then know to look for that propery and
TH> could create an ActionForward back to it. You could also try looking at
TH> the refer header, but I don't know how reliable that would be. 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: If several JSPs share the same action mapping...?

Posted by Ted Husted <hu...@apache.org>.
The input property doesn't have to be a JSP. It could be another action.
If that action had another way, besides the input property, to determine
where to send control, it could return whatever ActionForward needed. 

One nasty kludge would be to put the name of the JSP into the file as a
hidden property. The action would then know to look for that propery and
could create an ActionForward back to it. You could also try looking at
the refer header, but I don't know how reliable that would be. 

-T.


Rick Reumann wrote:
> 
> On Wednesday, June 12, 2002, 4:50:15 PM, Ted wrote:
> 
> TH> Each JSP can have its own action-mapping, and own input settings, and
> TH> the rest of it, and all the action-mappings can share the same Action.
> 
>     Sorry if I was confusing, yes I meant JSPs sharing an
>     action-mapping. I was trying to avoid having to write the same
>     action-mapping over again for a few jsp's that are very similar
>     and will end up fowarding to the same page after validation. The
>     similar forms on each page will need to be validated though and I
>     was just trying to find a good way to accomplish this but ran into
>     a snag because the "input" has to be defined in the action-mapping
>     that they would all share, so how would the validation know which
>     page to return to if there were errors?
> 
> TH> Of course, action-mappings can also share JSPs, and so forth. There are
> TH> no 1:1's here.
> 
> TH> -T.
> 
> TH> Rick Reumann wrote:
> >>
> >> Sorry James, I don't think I described the situation to well and I'm
> >> sure there probably is a better way to handle this...
> >>
> >> Easiest way is an extreme example..
> >>
> >> What if you had 4 different JSPs that captured the same information in
> >> a form YET everything else on the page was radically different. Upon
> >> submission, though, you want to forward all the pages to the same
> >> Action and even possibly forward all of them to the same results page.
> >>
> >> The problem(I think) is you also want to validate the form
> >> information. I'm wondering how you would get the validation to know to
> >> return back to the correct JSP page if there were validation errors?
> >>
> >> I thought you needed to provide the input="yourJsp.jsp" so that it
> >> knew were to go back to, but if all 4 jsps shared this action mapping
> >> what would you put in the input="?" section? (maybe I'm totally wrong
> >> and the validation doesn't need that but I thought it did).
> >>
> >> Thanks for the help,
> >> Rick
> >>
> >
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

-- Ted Husted, Husted dot Com, Fairport NY US
-- Developing Java Web Applications with Struts
-- Tel: +1 585 737-3463
-- Web: http://husted.com/about/services

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re[2]: If several JSPs share the same action mapping...?

Posted by Rick Reumann <ma...@reumann.net>.
On Wednesday, June 12, 2002, 4:50:15 PM, Ted wrote:

TH> Each JSP can have its own action-mapping, and own input settings, and
TH> the rest of it, and all the action-mappings can share the same Action. 

    Sorry if I was confusing, yes I meant JSPs sharing an
    action-mapping. I was trying to avoid having to write the same
    action-mapping over again for a few jsp's that are very similar
    and will end up fowarding to the same page after validation. The
    similar forms on each page will need to be validated though and I
    was just trying to find a good way to accomplish this but ran into
    a snag because the "input" has to be defined in the action-mapping
    that they would all share, so how would the validation know which
    page to return to if there were errors?

TH> Of course, action-mappings can also share JSPs, and so forth. There are
TH> no 1:1's here.

TH> -T.

TH> Rick Reumann wrote:
>> 
>> Sorry James, I don't think I described the situation to well and I'm
>> sure there probably is a better way to handle this...
>> 
>> Easiest way is an extreme example..
>> 
>> What if you had 4 different JSPs that captured the same information in
>> a form YET everything else on the page was radically different. Upon
>> submission, though, you want to forward all the pages to the same
>> Action and even possibly forward all of them to the same results page.
>> 
>> The problem(I think) is you also want to validate the form
>> information. I'm wondering how you would get the validation to know to
>> return back to the correct JSP page if there were validation errors?
>> 
>> I thought you needed to provide the input="yourJsp.jsp" so that it
>> knew were to go back to, but if all 4 jsps shared this action mapping
>> what would you put in the input="?" section? (maybe I'm totally wrong
>> and the validation doesn't need that but I thought it did).
>> 
>> Thanks for the help,
>> Rick
>> 
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Two questions

Posted by Yaman Kumar <ya...@nous.soft.net>.
Hi Niall,
Thank you very much,
My first question is  Enabling calling) the reset method to an image that is
in jsp. "javascript:document.this.reset() " is called on image but not
working.
and I tried with several options by replacing "this" with form and myForm,
But
none of them are successful..

In short how can we enable submit and reset button functionality to
images?.

TIA
rayaku






-----Original Message-----
From: Niall Pemberton [mailto:niall.pemberton@btinternet.com]
Sent: Thursday, 13 June 2002 7:44 AM
To: Struts Users Mailing List
Subject: RE: Two questions


I didn't understand the first question.

You can forward in a jsp using the struts forward tag:

  <logic:forward name="sessionexpired"/>

Niall

> -----Original Message-----
> From: Yaman Kumar [mailto:yamank@nous.soft.net]
> Sent: 12 March 2002 23:04
> To: Struts Users Mailing List; ted@husted.com
> Subject: Two questions
>
>
> Hi,
> I have 2 questions
> 1.Regarding calling a method that is in ActionForm from a jsp.
>   Ex:	I have an image and i would like to enable reset method to
> image that
> is in MyActionForm class.
>
> 2. I have a forward that is in global-forwards and i would like
> to get that
> in a
> jsp page,
> Ex.
> <global-forwards>
> 	<forward name="sessionexpired" path="/InvalidSession.jsp"/>
> </global-forwards>
>
> Can I call  "sessionexpired" forward name in a jsp file rather
> than writing
> InvalidSession.jsp?, So that if i change path of this forward in
> future that
> should
> affect in whole web application.
>
> TIA
> rayaku
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Two questions

Posted by Niall Pemberton <ni...@btinternet.com>.
I didn't understand the first question.

You can forward in a jsp using the struts forward tag:

  <logic:forward name="sessionexpired"/>

Niall

> -----Original Message-----
> From: Yaman Kumar [mailto:yamank@nous.soft.net]
> Sent: 12 March 2002 23:04
> To: Struts Users Mailing List; ted@husted.com
> Subject: Two questions
>
>
> Hi,
> I have 2 questions
> 1.Regarding calling a method that is in ActionForm from a jsp.
>   Ex:	I have an image and i would like to enable reset method to
> image that
> is in MyActionForm class.
>
> 2. I have a forward that is in global-forwards and i would like
> to get that
> in a
> jsp page,
> Ex.
> <global-forwards>
> 	<forward name="sessionexpired" path="/InvalidSession.jsp"/>
> </global-forwards>
>
> Can I call  "sessionexpired" forward name in a jsp file rather
> than writing
> InvalidSession.jsp?, So that if i change path of this forward in
> future that
> should
> affect in whole web application.
>
> TIA
> rayaku
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Two questions

Posted by Yaman Kumar <ya...@nous.soft.net>.
Hi,
I have 2 questions
1.Regarding calling a method that is in ActionForm from a jsp.
  Ex:	I have an image and i would like to enable reset method to image that
is in MyActionForm class.

2. I have a forward that is in global-forwards and i would like to get that
in a
jsp page,
Ex.
<global-forwards>
	<forward name="sessionexpired" path="/InvalidSession.jsp"/>
</global-forwards>

Can I call  "sessionexpired" forward name in a jsp file rather than writing
InvalidSession.jsp?, So that if i change path of this forward in future that
should
affect in whole web application.

TIA
rayaku


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: If several JSPs share the same action mapping...?

Posted by Ted Husted <hu...@apache.org>.
You may be confusing Actions with action-mappings. 

Each JSP can have its own action-mapping, and own input settings, and
the rest of it, and all the action-mappings can share the same Action. 

Of course, action-mappings can also share JSPs, and so forth. There are
no 1:1's here.

-T.

Rick Reumann wrote:
> 
> Sorry James, I don't think I described the situation to well and I'm
> sure there probably is a better way to handle this...
> 
> Easiest way is an extreme example..
> 
> What if you had 4 different JSPs that captured the same information in
> a form YET everything else on the page was radically different. Upon
> submission, though, you want to forward all the pages to the same
> Action and even possibly forward all of them to the same results page.
> 
> The problem(I think) is you also want to validate the form
> information. I'm wondering how you would get the validation to know to
> return back to the correct JSP page if there were validation errors?
> 
> I thought you needed to provide the input="yourJsp.jsp" so that it
> knew were to go back to, but if all 4 jsps shared this action mapping
> what would you put in the input="?" section? (maybe I'm totally wrong
> and the validation doesn't need that but I thought it did).
> 
> Thanks for the help,
> Rick
> 
> On Wednesday, June 12, 2002, 3:43:18 PM, James wrote:
> 
> JM> Not sure why you are submitting a form from diff jsp, but one work
> JM> around might be to forward to a known jsp....
> 
> JM> I'm guessing that you are passing something to the action to tell it where
> JM> you came from......
> 
> JM> <!-- Save mail subscription -->
> JM> <action  path="/saveSubscription"
> JM>            type="org.apache.struts.webapp.example.SaveSubscriptionAction"
> JM>            name="subscriptionForm"
> JM>           scope="request"
> JM>           input="/WEB-INF/jsp/subscription.jsp">
> JM>   <forward name="success"         path="/editRegistration.do?action=Edit"/>
> 
> JM>   <forward name="fail-jsp1"       path="/jsp1.jsp"/>
> JM>   <forward name="fail-jsp2"       path="/jsp2.jsp"/>
> JM>   <forward name="fail-jsp3"       path="/jsp3.jsp"/>
> 
> JM> <!-- or you might use a different exception -->
> JM>       <exception
> JM>                 key="failure.reason1"
> JM>                type="org.apache.struts.webapp.exception.Reason1"
> JM>                path="/jsp1.jsp"/>
> 
> JM> </action>
> 
> JM> I didn't actually run this.....so.....hope it gives you some ideas.
> 
> JM> James Mitchell
> JM> Software Engineer\Struts Evangelist
> JM> Struts-Atlanta, the "Open Minded Developer Network"
> JM> http://struts-atlanta.open-tools.org
> 
> >> -----Original Message-----
> >> From: Rick Reumann [mailto:maillist@reumann.net]
> >> Sent: Wednesday, June 12, 2002 3:31 PM
> >> To: Struts List
> >> Subject: If several JSs share the same action mapping...?
> >>
> >>
> >> How to do you deal with the input="?" parameter when setting up an
> >> action mapping that different JSPs will share? I thought this "input"
> >> declaration was so if you are using validation it knows which page to
> >> return to with the validation errors. How is this accomplished when
> >> you have different JSPs that could share this action mapping but also
> >> need to be validated and thus I think also require the input field to
> >> be supplied?
> >>
> >> TIA
> >>
> >> --
> >>
> >> Rick
> >> mailto:maillist@reumann.net
> >>
> >> "Maybe in order to understand mankind, we have to look at the word
> >> itself: 'Mankind'. Basically, it's made up of two separate words -
> >> 'mank' and 'ind'. What do these words mean ? It's a mystery, and
> >> that's why so is mankind."
> >>   -Jack Handey
> >>
> >>
> >> --
> >> To unsubscribe, e-mail:
> JM> <ma...@jakarta.apache.org>
> JM> For additional commands, e-mail:
> JM> <ma...@jakarta.apache.org>
> 
> --
> 
> Rick
> mailto:maillist@reumann.net
> 
> "It's amazing to me that one of the world's most feared diseases would
> be carried by one of the world's smallest animals: the real tiny dog."
>   -Jack Handey
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: If several JSPs share the same action mapping...?

Posted by James Mitchell <jm...@telocity.com>.
Right, you will not know which jsp submitted the form unless you:

1. find out from the request (request uri)
2. tell the action by some hidden form var or on the url action (html)

either way you've got to create a hack to pass the correct ActionForward.


sorry for my quick (not-so-pretty) replies, I'm working on a hot project and
coding on one machine and monitoring the list on the laptop.  I'm
multi-tasking
both mentally, and physically ;)  (My alt-tab is a quarter turn to the left)

James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the "Open Minded Developer Network"
http://struts-atlanta.open-tools.org

> -----Original Message-----
> From: Rick Reumann [mailto:maillist@reumann.net]
> Sent: Wednesday, June 12, 2002 3:59 PM
> To: James Mitchell
> Cc: Struts Users Mailing List; Struts-Atlanta@open-tools.org
> Subject: Re[2]: If several JSPs share the same action mapping...?
>
>
> Sorry James, I don't think I described the situation to well and I'm
> sure there probably is a better way to handle this...
>
> Easiest way is an extreme example..
>
> What if you had 4 different JSPs that captured the same information in
> a form YET everything else on the page was radically different. Upon
> submission, though, you want to forward all the pages to the same
> Action and even possibly forward all of them to the same results page.
>
> The problem(I think) is you also want to validate the form
> information. I'm wondering how you would get the validation to know to
> return back to the correct JSP page if there were validation errors?
>
> I thought you needed to provide the input="yourJsp.jsp" so that it
> knew were to go back to, but if all 4 jsps shared this action mapping
> what would you put in the input="?" section? (maybe I'm totally wrong
> and the validation doesn't need that but I thought it did).
>
> Thanks for the help,
> Rick
>
> On Wednesday, June 12, 2002, 3:43:18 PM, James wrote:
>
> JM> Not sure why you are submitting a form from diff jsp, but one work
> JM> around might be to forward to a known jsp....
>
> JM> I'm guessing that you are passing something to the action to
> tell it where
> JM> you came from......
>
> JM> <!-- Save mail subscription -->
> JM> <action  path="/saveSubscription"
> JM>
> type="org.apache.struts.webapp.example.SaveSubscriptionAction"
> JM>            name="subscriptionForm"
> JM>           scope="request"
> JM>           input="/WEB-INF/jsp/subscription.jsp">
> JM>   <forward name="success"
> path="/editRegistration.do?action=Edit"/>
>
> JM>   <forward name="fail-jsp1"       path="/jsp1.jsp"/>
> JM>   <forward name="fail-jsp2"       path="/jsp2.jsp"/>
> JM>   <forward name="fail-jsp3"       path="/jsp3.jsp"/>
>
> JM> <!-- or you might use a different exception -->
> JM>       <exception
> JM>                 key="failure.reason1"
> JM>                type="org.apache.struts.webapp.exception.Reason1"
> JM>                path="/jsp1.jsp"/>
>
> JM> </action>
>
> JM> I didn't actually run this.....so.....hope it gives you some ideas.
>
>
>
> JM> James Mitchell
> JM> Software Engineer\Struts Evangelist
> JM> Struts-Atlanta, the "Open Minded Developer Network"
> JM> http://struts-atlanta.open-tools.org
>
> >> -----Original Message-----
> >> From: Rick Reumann [mailto:maillist@reumann.net]
> >> Sent: Wednesday, June 12, 2002 3:31 PM
> >> To: Struts List
> >> Subject: If several JSs share the same action mapping...?
> >>
> >>
> >> How to do you deal with the input="?" parameter when setting up an
> >> action mapping that different JSPs will share? I thought this "input"
> >> declaration was so if you are using validation it knows which page to
> >> return to with the validation errors. How is this accomplished when
> >> you have different JSPs that could share this action mapping but also
> >> need to be validated and thus I think also require the input field to
> >> be supplied?
> >>
> >> TIA
> >>
> >> --
> >>
> >> Rick
> >> mailto:maillist@reumann.net
> >>
> >> "Maybe in order to understand mankind, we have to look at the word
> >> itself: 'Mankind'. Basically, it's made up of two separate words -
> >> 'mank' and 'ind'. What do these words mean ? It's a mystery, and
> >> that's why so is mankind."
> >>   -Jack Handey
> >>
> >>
> >> --
> >> To unsubscribe, e-mail:
> JM> <ma...@jakarta.apache.org>
> JM> For additional commands, e-mail:
> JM> <ma...@jakarta.apache.org>
>
>
>
>
> --
>
> Rick
> mailto:maillist@reumann.net
>
> "It's amazing to me that one of the world's most feared diseases would
> be carried by one of the world's smallest animals: the real tiny dog."
>   -Jack Handey
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re[2]: If several JSPs share the same action mapping...?

Posted by Rick Reumann <ma...@reumann.net>.
Sorry James, I don't think I described the situation to well and I'm
sure there probably is a better way to handle this...

Easiest way is an extreme example..

What if you had 4 different JSPs that captured the same information in
a form YET everything else on the page was radically different. Upon
submission, though, you want to forward all the pages to the same
Action and even possibly forward all of them to the same results page.

The problem(I think) is you also want to validate the form
information. I'm wondering how you would get the validation to know to
return back to the correct JSP page if there were validation errors?

I thought you needed to provide the input="yourJsp.jsp" so that it
knew were to go back to, but if all 4 jsps shared this action mapping
what would you put in the input="?" section? (maybe I'm totally wrong
and the validation doesn't need that but I thought it did).

Thanks for the help,
Rick

On Wednesday, June 12, 2002, 3:43:18 PM, James wrote:

JM> Not sure why you are submitting a form from diff jsp, but one work
JM> around might be to forward to a known jsp....

JM> I'm guessing that you are passing something to the action to tell it where
JM> you came from......

JM> <!-- Save mail subscription -->
JM> <action  path="/saveSubscription"
JM>            type="org.apache.struts.webapp.example.SaveSubscriptionAction"
JM>            name="subscriptionForm"
JM>           scope="request"
JM>           input="/WEB-INF/jsp/subscription.jsp">
JM>   <forward name="success"         path="/editRegistration.do?action=Edit"/>

JM>   <forward name="fail-jsp1"       path="/jsp1.jsp"/>
JM>   <forward name="fail-jsp2"       path="/jsp2.jsp"/>
JM>   <forward name="fail-jsp3"       path="/jsp3.jsp"/>

JM> <!-- or you might use a different exception -->
JM>       <exception
JM>                 key="failure.reason1"
JM>                type="org.apache.struts.webapp.exception.Reason1"
JM>                path="/jsp1.jsp"/>

JM> </action>

JM> I didn't actually run this.....so.....hope it gives you some ideas.



JM> James Mitchell
JM> Software Engineer\Struts Evangelist
JM> Struts-Atlanta, the "Open Minded Developer Network"
JM> http://struts-atlanta.open-tools.org

>> -----Original Message-----
>> From: Rick Reumann [mailto:maillist@reumann.net]
>> Sent: Wednesday, June 12, 2002 3:31 PM
>> To: Struts List
>> Subject: If several JSs share the same action mapping...?
>>
>>
>> How to do you deal with the input="?" parameter when setting up an
>> action mapping that different JSPs will share? I thought this "input"
>> declaration was so if you are using validation it knows which page to
>> return to with the validation errors. How is this accomplished when
>> you have different JSPs that could share this action mapping but also
>> need to be validated and thus I think also require the input field to
>> be supplied?
>>
>> TIA
>>
>> --
>>
>> Rick
>> mailto:maillist@reumann.net
>>
>> "Maybe in order to understand mankind, we have to look at the word
>> itself: 'Mankind'. Basically, it's made up of two separate words -
>> 'mank' and 'ind'. What do these words mean ? It's a mystery, and
>> that's why so is mankind."
>>   -Jack Handey
>>
>>
>> --
>> To unsubscribe, e-mail:
JM> <ma...@jakarta.apache.org>
JM> For additional commands, e-mail:
JM> <ma...@jakarta.apache.org>




-- 

Rick
mailto:maillist@reumann.net

"It's amazing to me that one of the world's most feared diseases would
be carried by one of the world's smallest animals: the real tiny dog." 
  -Jack Handey


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: If several JSs share the same action mapping...?

Posted by James Mitchell <jm...@telocity.com>.
Not sure why you are submitting a form from diff jsp, but one work around
might be to
forward to a known jsp....

I'm guessing that you are passing something to the action to tell it where
you came from......

<!-- Save mail subscription -->
<action  path="/saveSubscription"
	   type="org.apache.struts.webapp.example.SaveSubscriptionAction"
	   name="subscriptionForm"
	  scope="request"
	  input="/WEB-INF/jsp/subscription.jsp">
  <forward name="success"         path="/editRegistration.do?action=Edit"/>

  <forward name="fail-jsp1"       path="/jsp1.jsp"/>
  <forward name="fail-jsp2"       path="/jsp2.jsp"/>
  <forward name="fail-jsp3"       path="/jsp3.jsp"/>

<!-- or you might use a different exception -->
      <exception
                key="failure.reason1"
               type="org.apache.struts.webapp.exception.Reason1"
               path="/jsp1.jsp"/>

</action>

I didn't actually run this.....so.....hope it gives you some ideas.



James Mitchell
Software Engineer\Struts Evangelist
Struts-Atlanta, the "Open Minded Developer Network"
http://struts-atlanta.open-tools.org

> -----Original Message-----
> From: Rick Reumann [mailto:maillist@reumann.net]
> Sent: Wednesday, June 12, 2002 3:31 PM
> To: Struts List
> Subject: If several JSs share the same action mapping...?
>
>
> How to do you deal with the input="?" parameter when setting up an
> action mapping that different JSPs will share? I thought this "input"
> declaration was so if you are using validation it knows which page to
> return to with the validation errors. How is this accomplished when
> you have different JSPs that could share this action mapping but also
> need to be validated and thus I think also require the input field to
> be supplied?
>
> TIA
>
> --
>
> Rick
> mailto:maillist@reumann.net
>
> "Maybe in order to understand mankind, we have to look at the word
> itself: 'Mankind'. Basically, it's made up of two separate words -
> 'mank' and 'ind'. What do these words mean ? It's a mystery, and
> that's why so is mankind."
>   -Jack Handey
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>