You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Marcus Biel <Ma...@bmw.de> on 2002/11/27 08:56:58 UTC
newbie question from expierenced user
Hi there,
I working with Struts 1.02 quite a while now,
and did a very complicated application using Struts,
but the more I know, the more I realize that I don't exactly know the
basics:
What exactly is the difference between the different scopes & which
scopes are there,
besides request, session & page ? When to use whichsoever scope ?
What if I am using one form for different actions, using different
scopes ?
Could it be that that creates different ActionForms in different scopes
of the same type ???
thx in advance,
marcus
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: newbie question from expierenced user
Posted by Gemes Tibor <ge...@regens.hu>.
2002. november 27. 08:56 dátummal Marcus Biel ezt írtad:
> What if I am using one form for different actions, using different
> scopes ?
> Could it be that that creates different ActionForms in different scopes
> of the same type ???
Yes.
If you don't want to hide one form from the other you might want to use the
"attribute" attribute of the ActionMapping. I use this in case of 2 session
scope ActionForm of the same type.
Tib
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: different forwards from form
Posted by Gemes Tibor <ge...@regens.hu>.
2002. december 3. 09:37 dátummal Marcus Biel ezt írtad:
> I got a form for editing a data records.
> When I hit "cancel" I want to display an other page then when I hit
> submit.
>
> How to do this ?
Read the docs! Take a look at the struts-example.war, or read the struts-tips
at husted.com:
http://www.husted.com/struts/tips/014.html
Hth,
Tib
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: different forwards from form
Posted by Gemes Tibor <ge...@regens.hu>.
2002. december 3. 10:01 dátummal Marcus Biel ezt írtad:
> No, my problem is different!
No. Your problem is the same.
> Now if I add a cancel button, it works,
> but also forwards to this same page,
> instead of to the regular start page.
If you add a cancel button, you can handle the cancel event by checking
isCancelled(request) so you can decide where forward to.
Simplified:
if (isCancelled(request))
return mapping.findForward("cancel");
And define a forward named 'cancel'. If you do so you will be forwarded to
this page.
Tib
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: different forwards from form
Posted by Gemes Tibor <ge...@regens.hu>.
2002. december 3. 10:22 dátummal Marcus Biel ezt írtad:
> I thought (isCancelled(request))
>
> would be a user defined method.
> Are you sure I can simple use this method,
> and he will know the user hit the cancel button ?
If the cancel button was generated with <html:cancel>cancel</html:cancel>
Hth,
Tib
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: different forwards from form
Posted by Marcus Biel <Ma...@bmw.de>.
I thought (isCancelled(request))
would be a user defined method.
Are you sure I can simple use this method,
and he will know the user hit the cancel button ?
marcus
gemes@regens.hu schrieb:
>
> 2002. december 3. 10:01 dátummal Marcus Biel ezt írtad:
> > No, my problem is different!
>
> No. Your problem is the same.
>
> > Now if I add a cancel button, it works,
> > but also forwards to this same page,
> > instead of to the regular start page.
>
> If you add a cancel button, you can handle the cancel event by checking
> isCancelled(request) so you can decide where forward to.
> Simplified:
>
> if (isCancelled(request))
> return mapping.findForward("cancel");
>
> And define a forward named 'cancel'. If you do so you will be forwarded to
> this page.
>
> Tib
>
> --
> 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: different forwards from form
Posted by Marcus Biel <Ma...@bmw.de>.
No, my problem is different!
A simple reset would be easy -
but I want to hit reset when I am editing -
when editing and I hit submit, it calls an action,
that updates the record,
then it forwards to a new jsp, that's says:
"Your record has been edited successfully."
Now if I add a cancel button, it works,
but also forwards to this same page,
instead of to the regular start page.
marcus
gemes@regens.hu schrieb:
>
> 2002. december 3. 09:37 dátummal Marcus Biel ezt írtad:
> > I got a form for editing a data records.
> > When I hit "cancel" I want to display an other page then when I hit
> > submit.
> >
> > How to do this ?
>
> Read the docs! Take a look at the struts-example.war, or read the struts-tips
> at husted.com:
>
> http://www.husted.com/struts/tips/014.html
>
> Hth,
>
> Tib
>
> --
> 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: different forwards from form
Posted by Andrew Hill <an...@gridnode.com>.
One way is to do a forward from within the action. Ie: both buttons still
submit to same action to start with, but if its detected that it was a
cancel then the action immediately returns an ActionForward that forwards
the request on to the action/jsp/etc... that you want to go to if they hit
cancel.
-----Original Message-----
From: Marcus Biel [mailto:Marcus.Biel@bmw.de]
Sent: Tuesday, December 03, 2002 16:37
To: struts-user@jakarta.apache.org
Subject: different forwards from form
I got a form for editing a data records.
When I hit "cancel" I want to display an other page then when I hit
submit.
How to do this ?
thx,
marcus
--
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>
different forwards from form
Posted by Marcus Biel <Ma...@bmw.de>.
I got a form for editing a data records.
When I hit "cancel" I want to display an other page then when I hit
submit.
How to do this ?
thx,
marcus
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: newbie question from expierenced user
Posted by micael <ca...@harbornet.com>.
I would strongly suggest you go to the bookstore and read the relevant
parts in Struts in Action. Since you are a professional, you might even
want to buy the book.
At 08:56 AM 11/27/2002 +0100, you wrote:
>Hi there,
>
>I working with Struts 1.02 quite a while now,
>and did a very complicated application using Struts,
>
>but the more I know, the more I realize that I don't exactly know the
>basics:
>
>What exactly is the difference between the different scopes & which
>scopes are there,
>besides request, session & page ? When to use whichsoever scope ?
>
>What if I am using one form for different actions, using different
>scopes ?
>Could it be that that creates different ActionForms in different scopes
>of the same type ???
>
>
>thx in advance,
>
>marcus
>
>--
>To unsubscribe, e-mail: <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
Micael
-------------------------------------------------------
This electronic mail transmission and any accompanying documents contain
information belonging to the sender which may be confidential and legally
privileged. This information is intended only for the use of the
individual or entity to whom this electronic mail transmission was sent as
indicated above. If you are not the intended recipient, any disclosure,
copying, distribution, or action taken in reliance on the contents of the
information contained in this transmission is strictly prohibited. If you
have received this transmission in error, please delete the message. Thank you
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>