You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mark <th...@yahoo.com> on 2004/11/04 06:25:51 UTC
Why can't I do or with no explicit action
Hi Folks,
Struts newbie here. In "standard" html, a form action is optional.
If not specified, when you hit submit, that form's action "goes to" that same
URL, thus returns back to that same form. I effectively want to do the same
thing in struts. The reason is I want to reuse some pages for different
struts action "flows".
To be clearer, imagine I have 5 pages A.jsp thru E.jsp. I sometimes want to
process them A, B, C, D, E. Other times I want B,C,E,D,A or whatever. Those
2 flows are controlled by 2 different (struts) actions, let's call them act1
and act2. If I hardcode the (HTML) form action as act1 in the page, the page
would go to act1, even through I may be "in" the act2 (struts) action (flow).
I realize that the first page needs to choose an action, but the rest should
just keep the same context/URL/whatever without having to hardcode it
(i.e "leave it blank"). I CAN get this info from the (HTTP) request object,
but it sure seems like that doing it the hard way. I guess that I could be
missing some fundamental "strutsism" here, but it sure seems like it would be
very useful to do what I described. I have searched all the FAQ's I can find,
but no luck.
Please explain to me what "I am not getting".
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Why can't I do or with no explicit action
Posted by Dakota Jack <cr...@gmail.com>.
If you will excuse me, Mark, I wonder why you would want your response
object to determine the flow by injecting a dynamic action? You sure
that is what you want?
You sure you don't want to determine what the response object is based
on the flow rather than on what the request object says based on the
response object options? Your way of approaching this seems odd to
me.
You can do either, of course. But, if you do it the way you are
suggesting, then you are locked in when the request is submitted and
you will have to have decided on that lock the previous request. This
seems unwieldy to me, but if that is what you like, sobeit.
Jack
On Thu, 4 Nov 2004 20:47:48 +0000 (UTC), Mark <th...@yahoo.com> wrote:
>
> Thanks Erik,
> That's exactly what I am asking. There MUST be some standard
> struts bean that I can access that has the current action the page flow "is
> in". I can see the taglib to look up a set of action forwards based on a URL.
> What I want is the the "action part" of the current URL so that I can make that
> the form action. If not, I can setup my own as you suggest. Maybe that's a
> better idea anyways, as it gives me more control other the situation.
>
> Mark
>
>
>
>
> Erik Weber <erikweber <at> mindspring.com> writes:
>
> I may not fully understand your problem, but won't using a variable to
> render your form action solve your problem?
>
> For example:
>
> <html:form action="${someBean.someProperty}" . . . >
>
> someBean being some object in some scope that is available to the JSP
> page, someProperty being the action URL which was set by logic in the
> page prep (Action) code?
>
> Erik
>
> Mark wrote:
>
> Hi Folks,
> Struts newbie here. In "standard" html, a form action is optional.
> If not specified, when you hit submit, that form's action "goes to" that same
> URL, thus returns back to that same form. I effectively want to do the same
> thing in struts. The reason is I want to reuse some pages for different
> struts action "flows".
>
> To be clearer, imagine I have 5 pages A.jsp thru E.jsp. I sometimes want to
> process them A, B, C, D, E. Other times I want B,C,E,D,A or whatever. Those
> 2 flows are controlled by 2 different (struts) actions, let's call them act1
> and act2. If I hardcode the (HTML) form action as act1 in the page, the page
> would go to act1, even through I may be "in" the act2 (struts) action (flow).
> I realize that the first page needs to choose an action, but the rest should
> just keep the same context/URL/whatever without having to hardcode it
> (i.e "leave it blank"). I CAN get this info from the (HTTP) request object,
> but it sure seems like that doing it the hard way. I guess that I could be
> missing some fundamental "strutsism" here, but it sure seems like it would be
> very useful to do what I described. I have searched all the FAQ's I can find,
> but no luck.
>
> Please explain to me what "I am not getting".
>
> ---------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
"You can't wake a person who is pretending to be asleep."
~Native Proverb~
"Each man is good in His sight. It is not necessary for eagles to be crows."
~Hunkesni (Sitting Bull), Hunkpapa Sioux~
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Why can't I do or with no explicit action
Posted by Mark <th...@yahoo.com>.
Thanks Erik,
That's exactly what I am asking. There MUST be some standard
struts bean that I can access that has the current action the page flow "is
in". I can see the taglib to look up a set of action forwards based on a URL.
What I want is the the "action part" of the current URL so that I can make that
the form action. If not, I can setup my own as you suggest. Maybe that's a
better idea anyways, as it gives me more control other the situation.
Mark
Erik Weber <erikweber <at> mindspring.com> writes:
I may not fully understand your problem, but won't using a variable to
render your form action solve your problem?
For example:
<html:form action="${someBean.someProperty}" . . . >
someBean being some object in some scope that is available to the JSP
page, someProperty being the action URL which was set by logic in the
page prep (Action) code?
Erik
Mark wrote:
Hi Folks,
Struts newbie here. In "standard" html, a form action is optional.
If not specified, when you hit submit, that form's action "goes to" that same
URL, thus returns back to that same form. I effectively want to do the same
thing in struts. The reason is I want to reuse some pages for different
struts action "flows".
To be clearer, imagine I have 5 pages A.jsp thru E.jsp. I sometimes want to
process them A, B, C, D, E. Other times I want B,C,E,D,A or whatever. Those
2 flows are controlled by 2 different (struts) actions, let's call them act1
and act2. If I hardcode the (HTML) form action as act1 in the page, the page
would go to act1, even through I may be "in" the act2 (struts) action (flow).
I realize that the first page needs to choose an action, but the rest should
just keep the same context/URL/whatever without having to hardcode it
(i.e "leave it blank"). I CAN get this info from the (HTTP) request object,
but it sure seems like that doing it the hard way. I guess that I could be
missing some fundamental "strutsism" here, but it sure seems like it would be
very useful to do what I described. I have searched all the FAQ's I can find,
but no luck.
Please explain to me what "I am not getting".
---------------------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Why can't I do or with no explicit
action
Posted by Erik Weber <er...@mindspring.com>.
I may not fully understand your problem, but won't using a variable to
render your form action solve your problem?
For example:
<html:form action="${someBean.someProperty}" . . . >
someBean being some object in some scope that is available to the JSP
page, someProperty being the action URL which was set by logic in the
page prep (Action) code?
Erik
Mark wrote:
>Hi Folks,
> Struts newbie here. In "standard" html, a form action is optional.
>If not specified, when you hit submit, that form's action "goes to" that same
>URL, thus returns back to that same form. I effectively want to do the same
>thing in struts. The reason is I want to reuse some pages for different
>struts action "flows".
>
>To be clearer, imagine I have 5 pages A.jsp thru E.jsp. I sometimes want to
>process them A, B, C, D, E. Other times I want B,C,E,D,A or whatever. Those
>2 flows are controlled by 2 different (struts) actions, let's call them act1
>and act2. If I hardcode the (HTML) form action as act1 in the page, the page
>would go to act1, even through I may be "in" the act2 (struts) action (flow).
>I realize that the first page needs to choose an action, but the rest should
>just keep the same context/URL/whatever without having to hardcode it
>(i.e "leave it blank"). I CAN get this info from the (HTTP) request object,
>but it sure seems like that doing it the hard way. I guess that I could be
>missing some fundamental "strutsism" here, but it sure seems like it would be
>very useful to do what I described. I have searched all the FAQ's I can find,
>but no luck.
>
>Please explain to me what "I am not getting".
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Why can't I do or with no explicit action
Posted by Dakota Jack <cr...@gmail.com>.
First, as you describe the problem, the problem is not with the action
but with the forwarding. That is, on the first example you want the
action for C to forward to D but in the second example you want the
action for C to forward to E. Right? That's what it says anyway.
Second, no matter what the form action attribute says in the struts
<html:form> tag, you can do anything you want with the forwarding in
your action.
Consequently, according to your description, you have no problem.
Jack
On Thu, 4 Nov 2004 05:25:51 +0000 (UTC), Mark <th...@yahoo.com> wrote:
>
> Hi Folks,
> Struts newbie here. In "standard" html, a form action is optional.
> If not specified, when you hit submit, that form's action "goes to" that same
> URL, thus returns back to that same form. I effectively want to do the same
> thing in struts. The reason is I want to reuse some pages for different
> struts action "flows".
>
> To be clearer, imagine I have 5 pages A.jsp thru E.jsp. I sometimes want to
> process them A, B, C, D, E. Other times I want B,C,E,D,A or whatever. Those
> 2 flows are controlled by 2 different (struts) actions, let's call them act1
> and act2. If I hardcode the (HTML) form action as act1 in the page, the page
> would go to act1, even through I may be "in" the act2 (struts) action (flow).
> I realize that the first page needs to choose an action, but the rest should
> just keep the same context/URL/whatever without having to hardcode it
> (i.e "leave it blank"). I CAN get this info from the (HTTP) request object,
> but it sure seems like that doing it the hard way. I guess that I could be
> missing some fundamental "strutsism" here, but it sure seems like it would be
> very useful to do what I described. I have searched all the FAQ's I can find,
> but no luck.
>
> Please explain to me what "I am not getting".
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
"You can't wake a person who is pretending to be asleep."
~Native Proverb~
"Each man is good in His sight. It is not necessary for eagles to be crows."
~Hunkesni (Sitting Bull), Hunkpapa Sioux~
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org