You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Muhammad Momin Rashid <mo...@amaana.com> on 2004/09/23 14:02:31 UTC
locale in validation.xml
Hello All,
I have defined two formsets in my validation.xml file. One is the default
and the other one is for the country PK & language en. I have defined
validations for FormSelectCountry in the default formset (and its not
redefined in the other formset). Now whenever in my application the locale
is set ot en_US, the link to FormSelectCountry works fine. But if locale is
set to en_PK in the application, I get the following exception.
javax.servlet.jsp.JspException: No form found under 'FormSelectCountry' in
locale 'en_PK'
at
org.apache.struts.taglib.html.JavascriptValidatorTag.renderJavascript(JavascriptValidatorTag.java:364)
at
org.apache.struts.taglib.html.JavascriptValidatorTag.doStartTag(JavascriptValidatorTag.java:335)
at
org.apache.jsp.pages.ssl.select_005fcountry_jsp._jspx_meth_html_javascript_0(select_005fcountry_jsp.java:110)
at
org.apache.jsp.pages.ssl.select_005fcountry_jsp._jspService(select_005fcountry_jsp.java:81)
Duplicating the validations for FormSelectCountry in the other formset fixes
exception.
This seems a bit strange to me, will I have to duplicate the validations for
each form in all my localised formsets? Have I missed something here? Can
anyone show me what is the right way to do this? Having to duplicating form
entries in each locale seems wrong.
Regards,
Muhammad Momin Rashid.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: MappingDispatchAction ...what what should be the value of the action attribute of html:form
Posted by Hubert Rabago <hr...@gmail.com>.
I apologize, but I have no clue as to what you're trying to do. You
presented two mappings and said "what action do I use in my form"? I
just made a guess.
Maybe if you provide more information, someone (I or someone else)
could help you. What are you trying to do? What are the two mappings
for, and what are the separate jsps for?
If your goal is to have one action respond differently based on what
button was clicked on the form, maybe you should look into
LookupDispatchAction. (Oops, there I go guessing again.)
On Thu, 23 Sep 2004 16:08:40 +0100 (BST), O. Oke
<re...@yahoo.co.uk> wrote:
> If it is "/updateCustomer", it means I will have to a
> separate jsp for each mapping. This will defeat the
> purpose of using MappingDispatchAction. It seems to
> me that your suggestion is only applicable to
> subclasses of Action, not MappingDispatchAction .
>
> I am asking because I am using MappingDispatchAction
> for my project.
>
> Thank you.
>
>
>
> --- Hubert Rabago <hr...@gmail.com> wrote:
> > 1. The action attribute of the form tag should
> > point to the action
> > that will process the form upon submission. In your
> > case, it looks
> > like it would be "/updateCustomer", but I'm just
> > guessing.
> >
> > 2. I usually just put <html:submit value="Submit"/>
> > or "Save" or
> > something similar there because I usually have only
> > one submit button.
> > If you're asking because you read something about
> > this button mapped
> > to that method, that's LookupDispatchAction.
> > MappingDispatchAction is
> > a lot easier to deal with when it comes to mapping
> > methods, IMO. :)
> >
> > Hubert
> >
> > On Thu, 23 Sep 2004 15:26:56 +0100 (BST), O. Oke
> > <re...@yahoo.co.uk> wrote:
> > > Please help!
> > >
> > > I have a class that extends MappingDispatchAction
> > > class
> > > . This class has, they are below:
> > >
> > > <action path="/getCustomer"
> > > type="com.fujimitsu.cargo.gen.CustomerAction"
> > > name="cargoForm"
> > > scope="request"
> > > validate="false"
> > > input=".customerDef.jsp"
> > > parameter="getCustomer">
> > > <forward name="success" path=".customerDef.jsp" />
> > > </action>
> > >
> > > <action path="/updateCustomer"
> > > type="com.fujimitsu.cargo.gen.CustomerAction"
> > > name="cargoForm" scope="request"
> > > validate="true"
> > > input=".customerDef.jsp"
> > > parameter="updateCustomer">
> > > <forward name="success" path=".customerDef.jsp" />
> > > </action>
> > >
> > > My question:
> > > 1. In my JSP, what what should be the value of
> > the
> > > action attribute of html:form
> > > i.e. <html:form action="??????????"> (i.e.
> > which
> > > mapping should be specified here)?
> > >
> > > 2. what should the code of the button for
> > excuting
> > > getCustomer method be?
> > > i.e. <html:submit ???????????????
> > >
> > > Thank you.
> > >
> > >
> >
> ___________________________________________________________ALL-NEW
> > Yahoo! Messenger - all new features - even more fun!
> > http://uk.messenger.yahoo.com
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > 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
> >
> >
>
>
>
>
> ___________________________________________________________ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: MappingDispatchAction's JSP code
Posted by Rick Reumann <st...@reumann.net>.
O. Oke wrote the following on 9/24/2004 6:22 AM:
> I have a class that extends the new
> MappingDispatchAction
> class
> . This class has two methods, namely getCustomer and
> updateCustomer.
>
> The corresponding mapping for each method are below:
>
> <action path="/getCustomer"
> type="com.fujimitsu.cargo.gen.CustomerAction"
> name="cargoForm"
> scope="request"
> validate="false"
> input=".customerDef.jsp"
> parameter="getCustomer">
> <forward name="success" path=".customerDef.jsp" />
> </action>
>
> <action path="/updateCustomer"
> type="com.fujimitsu.cargo.gen.CustomerAction"
> name="cargoForm" scope="request"
> validate="true"
> input=".customerDef.jsp"
> parameter="updateCustomer">
> <forward name="success" path=".customerDef.jsp" />
> </action>
>
>
>
> my jsp has three buttons, namelygetCustomer,
> updateCustomer and cancel.
>
> JSP CODE
> ========
> The works with DispatchAction. However, due to the
> limitations of DispatchAction, I want to use the new
> MappingDispatchAction class.
What are these limitations? For what you are trying to do the
limitations are actually the other way around:)
>
> <html:form action="/Customer">
> <%-- onsubmit="return validateCargoForm(this);"--%>
> <table width="500" border="0">
> ................
> ................
> other fields....
> ................
> ................
> <html:hidden property="methodToExecute"
> value="unknownMethod"/>
> <SCRIPT>function set(target)
> {document.forms[0].methodToExecute.value=target;}</SCRIPT>
> <html:submit onclick="bCancel=true;
> set('getCustomers')">Get Customer</html:submit>
> <html:submit onclick=
> "set('updateCustomer')">Update Customer</html:submit>
> <html:cancel/>
> </html:form>
Your trying to use a MappingDispatchAction like a DispatchAction don't
do this. Just use DispatchAction. So you make one Action
"CustomerAction" and you can have one mapping <action
path="/customerAction" ..>
and then you have the different dispatch methods inside. Simple.
If you want to use MappingDispatchAction then you'll have to use
javascript to change the action name in your <html:form action=""
section. I find that uglier than setting a dispatch parameter with
javascript.
I guess you didn't look at the SimpleDispatchAction either?
--
Rick
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
MappingDispatchAction's JSP code
Posted by "O. Oke" <re...@yahoo.co.uk>.
Please help!
Background
==========
I have a class that extends the new
MappingDispatchAction
class
. This class has two methods, namely getCustomer and
updateCustomer.
The corresponding mapping for each method are below:
<action path="/getCustomer"
type="com.fujimitsu.cargo.gen.CustomerAction"
name="cargoForm"
scope="request"
validate="false"
input=".customerDef.jsp"
parameter="getCustomer">
<forward name="success" path=".customerDef.jsp" />
</action>
<action path="/updateCustomer"
type="com.fujimitsu.cargo.gen.CustomerAction"
name="cargoForm" scope="request"
validate="true"
input=".customerDef.jsp"
parameter="updateCustomer">
<forward name="success" path=".customerDef.jsp" />
</action>
my jsp has three buttons, namelygetCustomer,
updateCustomer and cancel.
JSP CODE
========
The works with DispatchAction. However, due to the
limitations of DispatchAction, I want to use the new
MappingDispatchAction class.
<html:form action="/Customer">
<%-- onsubmit="return validateCargoForm(this);"--%>
<table width="500" border="0">
................
................
other fields....
................
................
<html:hidden property="methodToExecute"
value="unknownMethod"/>
<SCRIPT>function set(target)
{document.forms[0].methodToExecute.value=target;}</SCRIPT>
<html:submit onclick="bCancel=true;
set('getCustomers')">Get Customer</html:submit>
<html:submit onclick=
"set('updateCustomer')">Update Customer</html:submit>
<html:cancel/>
</html:form>
My question:
============
1. In my JSP, what what should be the value of the
ACTION attribute of html:form
i.e. <html:form action="??????????"> (i.e. which
mapping should be specified here)?
2. what should the code of the button for excuting
a. getCustomer and updateCustomer method be?
i.e. <html:submit ???????????????
b. cancel be i.e. <html:cancel ???????????????
Thank you.
>
> You sure you have a form that has a "get customer"
> and an "update
> customer" on the same page? That doesn't make too
> much sense. You sure
> "get customer" doesn't just take you to another page
> where you choose a
> customer to get? It sounds like you don't need to
> have a form to do what
> you want but probably just want a button that goes
> to a url mapped to
> your action. If they truly are buttons on a form
> then....
>
> MappingDispatchAction is horrible for this. You end
> up having to swap
> out your action name with javascript which I don't
> like. Use any of the
> other dispatch flavors instead of MappingDispatch
> action for multiple
> buttons. Michael's SimpleDispatchAction handles this
> well or simply use
> a regular DispatchAction and change the dispatch
> parameter name with
> javascript. If you can't use javascript then use the
>
> SimpleDispatchAction over LookupDispatch action. I
> don't like the
> LookupDispatchAction at all. For a dispatch action
> you could do
> something similar to:
>
> <html:hidden property="dispatch">
>
> <html:submit
>
onclick="myForm.dispatch.value='update'">Update</html:submit>
>
> <html:submit
> onclick="myForm.dispatch.value='get'">Get
> Customer</html:submit>
>
> Michael's SimpleDispatchAction is much cleaner
> though for multiple
> buttons on a page. You should give it a try.
>
>
> --
> Rick
>
Rick,
Thanks for your response, in order to shed more light
on what I am trying to do, I have added the relevant
part of my current JSP code above. The JSP code above
works with DispatchAction. However, due to the
limitations of DispatchAction, I want to use the new
MappingDispatchAction class. As I stated, my question
are:
1. In my JSP, what what should be the value of the
ACTION attribute of html:form
i.e. <html:form action="??????????"> (i.e. which
mapping should be specified here)?
2. what should the code of the button for excuting
a. getCustomer and updateCustomer method be?
i.e. <html:submit ???????????????
b. cancel be i.e. <html:cancel ???????????????
These are the parts of the jigsaw that I am missing.
Thank you.
Ola.
___________________________________________________________ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: MappingDispatchAction's JSP code
Posted by Rick Reumann <st...@reumann.net>.
O. Oke wrote the following on 9/23/2004 5:47 PM:
> Background
> ==========
> I have a class that extends the new
> MappingDispatchAction
> class
> . This class has two methods, namely getCustomer and
> updateCustomer.
>
> The corresponding mapping for each method are below:
>
> <action path="/getCustomer"
> type="com.fujimitsu.cargo.gen.CustomerAction"
> name="cargoForm"
> scope="request"
> validate="false"
> input=".customerDef.jsp"
> parameter="getCustomer">
> <forward name="success" path=".customerDef.jsp" />
> </action>
>
> <action path="/updateCustomer"
> type="com.fujimitsu.cargo.gen.CustomerAction"
> name="cargoForm" scope="request"
> validate="true"
> input=".customerDef.jsp"
> parameter="updateCustomer">
> <forward name="success" path=".customerDef.jsp" />
> </action>
>
>
>
> my jsp has three buttons, namelygetCustomer,
> updateCustomer and cancel.
You sure you have a form that has a "get customer" and an "update
customer" on the same page? That doesn't make too much sense. You sure
"get customer" doesn't just take you to another page where you choose a
customer to get? It sounds like you don't need to have a form to do what
you want but probably just want a button that goes to a url mapped to
your action. If they truly are buttons on a form then....
MappingDispatchAction is horrible for this. You end up having to swap
out your action name with javascript which I don't like. Use any of the
other dispatch flavors instead of MappingDispatch action for multiple
buttons. Michael's SimpleDispatchAction handles this well or simply use
a regular DispatchAction and change the dispatch parameter name with
javascript. If you can't use javascript then use the
SimpleDispatchAction over LookupDispatch action. I don't like the
LookupDispatchAction at all. For a dispatch action you could do
something similar to:
<html:hidden property="dispatch">
<html:submit onclick="myForm.dispatch.value='update'">Update</html:submit>
<html:submit onclick="myForm.dispatch.value='get'">Get
Customer</html:submit>
Michael's SimpleDispatchAction is much cleaner though for multiple
buttons on a page. You should give it a try.
--
Rick
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: MappingDispatchAction's JSP code
Posted by Michael McGrady <mi...@michaelmcgrady.com>.
I am not sure what you have in mind at this point. Do you still want to
go on with MappingDispatchAction?
Michael McGrady
O. Oke wrote:
>Thanks for your response, I have rephrased my question
>as below:
>
>Please help!
>
>Background
>==========
>I have a class that extends the new
>MappingDispatchAction
>class
>. This class has two methods, namely getCustomer and
>updateCustomer.
>
>The corresponding mapping for each method are below:
>
> <action path="/getCustomer"
>type="com.fujimitsu.cargo.gen.CustomerAction"
>name="cargoForm"
>scope="request"
>validate="false"
>input=".customerDef.jsp"
> parameter="getCustomer">
> <forward name="success" path=".customerDef.jsp" />
> </action>
>
> <action path="/updateCustomer"
>type="com.fujimitsu.cargo.gen.CustomerAction"
>name="cargoForm" scope="request"
>validate="true"
>input=".customerDef.jsp"
>parameter="updateCustomer">
><forward name="success" path=".customerDef.jsp" />
> </action>
>
>
>
>my jsp has three buttons, namelygetCustomer,
>updateCustomer and cancel.
>
>
>
>My question:
>============
>1. In my JSP, what what should be the value of the
>ACTION attribute of html:form
> i.e. <html:form action="??????????"> (i.e. which
>mapping should be specified here)?
>
>2. what should the code of the button for excuting
> a. getCustomer and updateCustomer method be?
> i.e. <html:submit ???????????????
>
> b. cancel be i.e. <html:cancel ???????????????
>
>Thank you.
>
>Thanks for your response, I have rephrased my question
>as above.
>
>
>
>> --- Michael McGrady <mi...@michaelmcgrady.com>
>>wrote:
>>
>>
>>>If you would like a simpler, and more general,
>>>solution that does the
>>>same thing, try
>>>
>>>
>>>
>http://wiki.apache.org/struts/StrutsCatalogFiveMultipleButtonSolutions
>
>
>>>. However, if you like MappingDispatchAction
>>>anyway, which I would find
>>>odd but you may find even, you can do whatever you
>>>like, but you have to
>>>generate the correct path with your button or
>>>
>>>
>>form.
>>
>>
>>>Michael
>>>
>>>O. Oke wrote:
>>>
>>>
>>>
>>>>If it is "/updateCustomer", it means I will have
>>>>
>>>>
>>to
>>
>>
>>>a
>>>
>>>
>>>>separate jsp for each mapping. This will defeat
>>>>
>>>>
>>>the
>>>
>>>
>>>>purpose of using MappingDispatchAction. It seems
>>>>
>>>>
>>>to
>>>
>>>
>>>>me that your suggestion is only applicable to
>>>>subclasses of Action, not MappingDispatchAction .
>>>>
>>>>
>>>>I am asking because I am using
>>>>
>>>>
>>>MappingDispatchAction
>>>
>>>
>>>>for my project.
>>>>
>>>>Thank you.
>>>>
>>>>--- Hubert Rabago <hr...@gmail.com> wrote:
>>>>
>>>>
>>>>
>>>>
>>>>>1. The action attribute of the form tag should
>>>>>point to the action
>>>>>that will process the form upon submission. In
>>>>>
>>>>>
>>>your
>>>
>>>
>>>>>case, it looks
>>>>>like it would be "/updateCustomer", but I'm just
>>>>>guessing.
>>>>>
>>>>>2. I usually just put <html:submit
>>>>>
>>>>>
>>>value="Submit"/>
>>>
>>>
>>>>>or "Save" or
>>>>>something similar there because I usually have
>>>>>
>>>>>
>>>only
>>>
>>>
>>>>>one submit button.
>>>>>If you're asking because you read something
>>>>>
>>>>>
>>about
>>
>>
>>>>>this button mapped
>>>>>to that method, that's LookupDispatchAction.
>>>>>MappingDispatchAction is
>>>>>a lot easier to deal with when it comes to
>>>>>
>>>>>
>>mapping
>>
>>
>>>>>methods, IMO. :)
>>>>>
>>>>>Hubert
>>>>>
>>>>>On Thu, 23 Sep 2004 15:26:56 +0100 (BST), O. Oke
>>>>><re...@yahoo.co.uk> wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>Please help!
>>>>>>
>>>>>>I have a class that extends
>>>>>>
>>>>>>
>>MappingDispatchAction
>>
>>
>>>>>>class
>>>>>>. This class has, they are below:
>>>>>>
>>>>>> <action path="/getCustomer"
>>>>>>type="com.fujimitsu.cargo.gen.CustomerAction"
>>>>>>name="cargoForm"
>>>>>>scope="request"
>>>>>>validate="false"
>>>>>>input=".customerDef.jsp"
>>>>>>parameter="getCustomer">
>>>>>><forward name="success" path=".customerDef.jsp"
>>>>>>
>>>>>>
>>>/>
>>>
>>>
>>>>>> </action>
>>>>>>
>>>>>> <action path="/updateCustomer"
>>>>>>type="com.fujimitsu.cargo.gen.CustomerAction"
>>>>>>name="cargoForm" scope="request"
>>>>>>validate="true"
>>>>>>input=".customerDef.jsp"
>>>>>>parameter="updateCustomer">
>>>>>><forward name="success" path=".customerDef.jsp"
>>>>>>
>>>>>>
>>>/>
>>>
>>>
>>>>>> </action>
>>>>>>
>>>>>>My question:
>>>>>>1. In my JSP, what what should be the value of
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>the
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>action attribute of html:form
>>>>>> i.e. <html:form action="??????????"> (i.e.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>which
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>mapping should be specified here)?
>>>>>>
>>>>>>2. what should the code of the button for
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>excuting
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>getCustomer method be?
>>>>>> i.e. <html:submit ???????????????
>>>>>>
>>>>>>Thank you.
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>___________________________________________________________ALL-NEW
>>
>>
>>>>
>>>>
>>>>
>>>>
>>>>>Yahoo! Messenger - all new features - even more
>>>>>
>>>>>
>>>fun!
>>>
>>>
>>>>>http://uk.messenger.yahoo.com
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>---------------------------------------------------------------------
>>
>>
>>>>
>>>>
>>>>
>>>>
>>>>>>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
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>___________________________________________________________ALL-NEW
>>
>>
>>>Yahoo! Messenger - all new features - even more
>>>
>>>
>>fun!
>>
>>
>>> http://uk.messenger.yahoo.com
>>>
>>>
>>---------------------------------------------------------------------
>>
>>
>>>>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
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>>
>>
>___________________________________________________________ALL-NEW
>
>
>>Yahoo! Messenger - all new features - even more fun!
>> http://uk.messenger.yahoo.com
>>
>>
>>
>>
>---------------------------------------------------------------------
>
>
>>To unsubscribe, e-mail:
>>user-unsubscribe@struts.apache.org
>>For additional commands, e-mail:
>>user-help@struts.apache.org
>>
>>
>>
>>
>
>
>
>
>
>___________________________________________________________ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
>
>---------------------------------------------------------------------
>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
MappingDispatchAction's JSP code
Posted by "O. Oke" <re...@yahoo.co.uk>.
Thanks for your response, I have rephrased my question
as below:
Please help!
Background
==========
I have a class that extends the new
MappingDispatchAction
class
. This class has two methods, namely getCustomer and
updateCustomer.
The corresponding mapping for each method are below:
<action path="/getCustomer"
type="com.fujimitsu.cargo.gen.CustomerAction"
name="cargoForm"
scope="request"
validate="false"
input=".customerDef.jsp"
parameter="getCustomer">
<forward name="success" path=".customerDef.jsp" />
</action>
<action path="/updateCustomer"
type="com.fujimitsu.cargo.gen.CustomerAction"
name="cargoForm" scope="request"
validate="true"
input=".customerDef.jsp"
parameter="updateCustomer">
<forward name="success" path=".customerDef.jsp" />
</action>
my jsp has three buttons, namelygetCustomer,
updateCustomer and cancel.
My question:
============
1. In my JSP, what what should be the value of the
ACTION attribute of html:form
i.e. <html:form action="??????????"> (i.e. which
mapping should be specified here)?
2. what should the code of the button for excuting
a. getCustomer and updateCustomer method be?
i.e. <html:submit ???????????????
b. cancel be i.e. <html:cancel ???????????????
Thank you.
Thanks for your response, I have rephrased my question
as above.
> --- Michael McGrady <mi...@michaelmcgrady.com>
> wrote:
> > If you would like a simpler, and more general,
> > solution that does the
> > same thing, try
> >
>
http://wiki.apache.org/struts/StrutsCatalogFiveMultipleButtonSolutions
> >
> > . However, if you like MappingDispatchAction
> > anyway, which I would find
> > odd but you may find even, you can do whatever you
> > like, but you have to
> > generate the correct path with your button or
> form.
> >
> > Michael
> >
> > O. Oke wrote:
> >
> > >If it is "/updateCustomer", it means I will have
> to
> > a
> > >separate jsp for each mapping. This will defeat
> > the
> > >purpose of using MappingDispatchAction. It seems
> > to
> > >me that your suggestion is only applicable to
> > >subclasses of Action, not MappingDispatchAction .
> > >
> > >
> > >I am asking because I am using
> > MappingDispatchAction
> > >for my project.
> > >
> > >Thank you.
> > >
> > > --- Hubert Rabago <hr...@gmail.com> wrote:
> > >
> > >
> > >>1. The action attribute of the form tag should
> > >>point to the action
> > >>that will process the form upon submission. In
> > your
> > >>case, it looks
> > >>like it would be "/updateCustomer", but I'm just
> > >>guessing.
> > >>
> > >>2. I usually just put <html:submit
> > value="Submit"/>
> > >>or "Save" or
> > >>something similar there because I usually have
> > only
> > >>one submit button.
> > >> If you're asking because you read something
> about
> > >>this button mapped
> > >>to that method, that's LookupDispatchAction.
> > >>MappingDispatchAction is
> > >>a lot easier to deal with when it comes to
> mapping
> > >>methods, IMO. :)
> > >>
> > >>Hubert
> > >>
> > >>On Thu, 23 Sep 2004 15:26:56 +0100 (BST), O. Oke
> > >><re...@yahoo.co.uk> wrote:
> > >>
> > >>
> > >>>Please help!
> > >>>
> > >>>I have a class that extends
> MappingDispatchAction
> > >>>class
> > >>>. This class has, they are below:
> > >>>
> > >>> <action path="/getCustomer"
> > >>>type="com.fujimitsu.cargo.gen.CustomerAction"
> > >>>name="cargoForm"
> > >>>scope="request"
> > >>>validate="false"
> > >>>input=".customerDef.jsp"
> > >>>parameter="getCustomer">
> > >>><forward name="success" path=".customerDef.jsp"
> > />
> > >>> </action>
> > >>>
> > >>> <action path="/updateCustomer"
> > >>>type="com.fujimitsu.cargo.gen.CustomerAction"
> > >>>name="cargoForm" scope="request"
> > >>>validate="true"
> > >>>input=".customerDef.jsp"
> > >>>parameter="updateCustomer">
> > >>><forward name="success" path=".customerDef.jsp"
> > />
> > >>> </action>
> > >>>
> > >>>My question:
> > >>>1. In my JSP, what what should be the value of
> > >>>
> > >>>
> > >>the
> > >>
> > >>
> > >>>action attribute of html:form
> > >>> i.e. <html:form action="??????????"> (i.e.
> > >>>
> > >>>
> > >>which
> > >>
> > >>
> > >>>mapping should be specified here)?
> > >>>
> > >>>2. what should the code of the button for
> > >>>
> > >>>
> > >>excuting
> > >>
> > >>
> > >>>getCustomer method be?
> > >>> i.e. <html:submit ???????????????
> > >>>
> > >>>Thank you.
> > >>>
> > >>>
> > >>>
> > >>>
> >
>
>___________________________________________________________ALL-NEW
> > >
> > >
> > >>Yahoo! Messenger - all new features - even more
> > fun!
> > >> http://uk.messenger.yahoo.com
> > >>
> > >>
> > >>>
> > >>>
> >
>
>---------------------------------------------------------------------
> > >
> > >
> > >>>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
> > >>
> > >>
> > >>
> > >>
> > >
> > >
> > >
> > >
> > >
> >
>
>___________________________________________________________ALL-NEW
> > Yahoo! Messenger - all new features - even more
> fun!
> > http://uk.messenger.yahoo.com
> > >
> >
>
>---------------------------------------------------------------------
> > >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
> >
> >
>
>
>
>
>
>
___________________________________________________________ALL-NEW
> Yahoo! Messenger - all new features - even more fun!
> http://uk.messenger.yahoo.com
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
>
>
___________________________________________________________ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
MappingDispatchAction's JSP code
Posted by "O. Oke" <re...@yahoo.co.uk>.
Please help!
Background
==========
I have a class that extends the new
MappingDispatchAction
class
. This class has two methods, namely getCustomer and
updateCustomer.
The corresponding mapping for each method are below:
<action path="/getCustomer"
type="com.fujimitsu.cargo.gen.CustomerAction"
name="cargoForm"
scope="request"
validate="false"
input=".customerDef.jsp"
parameter="getCustomer">
<forward name="success" path=".customerDef.jsp" />
</action>
<action path="/updateCustomer"
type="com.fujimitsu.cargo.gen.CustomerAction"
name="cargoForm" scope="request"
validate="true"
input=".customerDef.jsp"
parameter="updateCustomer">
<forward name="success" path=".customerDef.jsp" />
</action>
my jsp has three buttons, namelygetCustomer,
updateCustomer and cancel.
My question:
============
1. In my JSP, what what should be the value of the
ACTION attribute of html:form
i.e. <html:form action="??????????"> (i.e. which
mapping should be specified here)?
2. what should the code of the button for excuting
a. getCustomer and updateCustomer method be?
i.e. <html:submit ???????????????
b. cancel be i.e. <html:cancel ???????????????
Thank you.
Thanks for your response, I have rephrased my question
as above.
--- Michael McGrady <mi...@michaelmcgrady.com> wrote:
> If you would like a simpler, and more general,
> solution that does the
> same thing, try
>
http://wiki.apache.org/struts/StrutsCatalogFiveMultipleButtonSolutions
>
> . However, if you like MappingDispatchAction
> anyway, which I would find
> odd but you may find even, you can do whatever you
> like, but you have to
> generate the correct path with your button or form.
>
> Michael
>
> O. Oke wrote:
>
> >If it is "/updateCustomer", it means I will have to
> a
> >separate jsp for each mapping. This will defeat
> the
> >purpose of using MappingDispatchAction. It seems
> to
> >me that your suggestion is only applicable to
> >subclasses of Action, not MappingDispatchAction .
> >
> >
> >I am asking because I am using
> MappingDispatchAction
> >for my project.
> >
> >Thank you.
> >
> > --- Hubert Rabago <hr...@gmail.com> wrote:
> >
> >
> >>1. The action attribute of the form tag should
> >>point to the action
> >>that will process the form upon submission. In
> your
> >>case, it looks
> >>like it would be "/updateCustomer", but I'm just
> >>guessing.
> >>
> >>2. I usually just put <html:submit
> value="Submit"/>
> >>or "Save" or
> >>something similar there because I usually have
> only
> >>one submit button.
> >> If you're asking because you read something about
> >>this button mapped
> >>to that method, that's LookupDispatchAction.
> >>MappingDispatchAction is
> >>a lot easier to deal with when it comes to mapping
> >>methods, IMO. :)
> >>
> >>Hubert
> >>
> >>On Thu, 23 Sep 2004 15:26:56 +0100 (BST), O. Oke
> >><re...@yahoo.co.uk> wrote:
> >>
> >>
> >>>Please help!
> >>>
> >>>I have a class that extends MappingDispatchAction
> >>>class
> >>>. This class has, they are below:
> >>>
> >>> <action path="/getCustomer"
> >>>type="com.fujimitsu.cargo.gen.CustomerAction"
> >>>name="cargoForm"
> >>>scope="request"
> >>>validate="false"
> >>>input=".customerDef.jsp"
> >>>parameter="getCustomer">
> >>><forward name="success" path=".customerDef.jsp"
> />
> >>> </action>
> >>>
> >>> <action path="/updateCustomer"
> >>>type="com.fujimitsu.cargo.gen.CustomerAction"
> >>>name="cargoForm" scope="request"
> >>>validate="true"
> >>>input=".customerDef.jsp"
> >>>parameter="updateCustomer">
> >>><forward name="success" path=".customerDef.jsp"
> />
> >>> </action>
> >>>
> >>>My question:
> >>>1. In my JSP, what what should be the value of
> >>>
> >>>
> >>the
> >>
> >>
> >>>action attribute of html:form
> >>> i.e. <html:form action="??????????"> (i.e.
> >>>
> >>>
> >>which
> >>
> >>
> >>>mapping should be specified here)?
> >>>
> >>>2. what should the code of the button for
> >>>
> >>>
> >>excuting
> >>
> >>
> >>>getCustomer method be?
> >>> i.e. <html:submit ???????????????
> >>>
> >>>Thank you.
> >>>
> >>>
> >>>
> >>>
>
>___________________________________________________________ALL-NEW
> >
> >
> >>Yahoo! Messenger - all new features - even more
> fun!
> >> http://uk.messenger.yahoo.com
> >>
> >>
> >>>
> >>>
>
>---------------------------------------------------------------------
> >
> >
> >>>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
> >>
> >>
> >>
> >>
> >
> >
> >
> >
> >
>
>___________________________________________________________ALL-NEW
> Yahoo! Messenger - all new features - even more fun!
> http://uk.messenger.yahoo.com
> >
>
>---------------------------------------------------------------------
> >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
>
>
___________________________________________________________ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: MappingDispatchAction ...what what should be the value of the
action attribute of html:form
Posted by Michael McGrady <mi...@michaelmcgrady.com>.
If you would like a simpler, and more general, solution that does the
same thing, try
http://wiki.apache.org/struts/StrutsCatalogFiveMultipleButtonSolutions
. However, if you like MappingDispatchAction anyway, which I would find
odd but you may find even, you can do whatever you like, but you have to
generate the correct path with your button or form.
Michael
O. Oke wrote:
>If it is "/updateCustomer", it means I will have to a
>separate jsp for each mapping. This will defeat the
>purpose of using MappingDispatchAction. It seems to
>me that your suggestion is only applicable to
>subclasses of Action, not MappingDispatchAction .
>
>
>I am asking because I am using MappingDispatchAction
>for my project.
>
>Thank you.
>
> --- Hubert Rabago <hr...@gmail.com> wrote:
>
>
>>1. The action attribute of the form tag should
>>point to the action
>>that will process the form upon submission. In your
>>case, it looks
>>like it would be "/updateCustomer", but I'm just
>>guessing.
>>
>>2. I usually just put <html:submit value="Submit"/>
>>or "Save" or
>>something similar there because I usually have only
>>one submit button.
>> If you're asking because you read something about
>>this button mapped
>>to that method, that's LookupDispatchAction.
>>MappingDispatchAction is
>>a lot easier to deal with when it comes to mapping
>>methods, IMO. :)
>>
>>Hubert
>>
>>On Thu, 23 Sep 2004 15:26:56 +0100 (BST), O. Oke
>><re...@yahoo.co.uk> wrote:
>>
>>
>>>Please help!
>>>
>>>I have a class that extends MappingDispatchAction
>>>class
>>>. This class has, they are below:
>>>
>>> <action path="/getCustomer"
>>>type="com.fujimitsu.cargo.gen.CustomerAction"
>>>name="cargoForm"
>>>scope="request"
>>>validate="false"
>>>input=".customerDef.jsp"
>>>parameter="getCustomer">
>>><forward name="success" path=".customerDef.jsp" />
>>> </action>
>>>
>>> <action path="/updateCustomer"
>>>type="com.fujimitsu.cargo.gen.CustomerAction"
>>>name="cargoForm" scope="request"
>>>validate="true"
>>>input=".customerDef.jsp"
>>>parameter="updateCustomer">
>>><forward name="success" path=".customerDef.jsp" />
>>> </action>
>>>
>>>My question:
>>>1. In my JSP, what what should be the value of
>>>
>>>
>>the
>>
>>
>>>action attribute of html:form
>>> i.e. <html:form action="??????????"> (i.e.
>>>
>>>
>>which
>>
>>
>>>mapping should be specified here)?
>>>
>>>2. what should the code of the button for
>>>
>>>
>>excuting
>>
>>
>>>getCustomer method be?
>>> i.e. <html:submit ???????????????
>>>
>>>Thank you.
>>>
>>>
>>>
>>>
>___________________________________________________________ALL-NEW
>
>
>>Yahoo! Messenger - all new features - even more fun!
>> http://uk.messenger.yahoo.com
>>
>>
>>>
>>>
>---------------------------------------------------------------------
>
>
>>>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
>>
>>
>>
>>
>
>
>
>
>
>___________________________________________________________ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
>
>---------------------------------------------------------------------
>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: MappingDispatchAction ...what what should be the value of the action attribute of html:form
Posted by "O. Oke" <re...@yahoo.co.uk>.
If it is "/updateCustomer", it means I will have to a
separate jsp for each mapping. This will defeat the
purpose of using MappingDispatchAction. It seems to
me that your suggestion is only applicable to
subclasses of Action, not MappingDispatchAction .
I am asking because I am using MappingDispatchAction
for my project.
Thank you.
--- Hubert Rabago <hr...@gmail.com> wrote:
> 1. The action attribute of the form tag should
> point to the action
> that will process the form upon submission. In your
> case, it looks
> like it would be "/updateCustomer", but I'm just
> guessing.
>
> 2. I usually just put <html:submit value="Submit"/>
> or "Save" or
> something similar there because I usually have only
> one submit button.
> If you're asking because you read something about
> this button mapped
> to that method, that's LookupDispatchAction.
> MappingDispatchAction is
> a lot easier to deal with when it comes to mapping
> methods, IMO. :)
>
> Hubert
>
> On Thu, 23 Sep 2004 15:26:56 +0100 (BST), O. Oke
> <re...@yahoo.co.uk> wrote:
> > Please help!
> >
> > I have a class that extends MappingDispatchAction
> > class
> > . This class has, they are below:
> >
> > <action path="/getCustomer"
> > type="com.fujimitsu.cargo.gen.CustomerAction"
> > name="cargoForm"
> > scope="request"
> > validate="false"
> > input=".customerDef.jsp"
> > parameter="getCustomer">
> > <forward name="success" path=".customerDef.jsp" />
> > </action>
> >
> > <action path="/updateCustomer"
> > type="com.fujimitsu.cargo.gen.CustomerAction"
> > name="cargoForm" scope="request"
> > validate="true"
> > input=".customerDef.jsp"
> > parameter="updateCustomer">
> > <forward name="success" path=".customerDef.jsp" />
> > </action>
> >
> > My question:
> > 1. In my JSP, what what should be the value of
> the
> > action attribute of html:form
> > i.e. <html:form action="??????????"> (i.e.
> which
> > mapping should be specified here)?
> >
> > 2. what should the code of the button for
> excuting
> > getCustomer method be?
> > i.e. <html:submit ???????????????
> >
> > Thank you.
> >
> >
>
___________________________________________________________ALL-NEW
> Yahoo! Messenger - all new features - even more fun!
> http://uk.messenger.yahoo.com
> >
> >
>
---------------------------------------------------------------------
> > 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
>
>
___________________________________________________________ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: MappingDispatchAction ...what what should be the value of the action attribute of html:form
Posted by Hubert Rabago <hr...@gmail.com>.
1. The action attribute of the form tag should point to the action
that will process the form upon submission. In your case, it looks
like it would be "/updateCustomer", but I'm just guessing.
2. I usually just put <html:submit value="Submit"/> or "Save" or
something similar there because I usually have only one submit button.
If you're asking because you read something about this button mapped
to that method, that's LookupDispatchAction. MappingDispatchAction is
a lot easier to deal with when it comes to mapping methods, IMO. :)
Hubert
On Thu, 23 Sep 2004 15:26:56 +0100 (BST), O. Oke
<re...@yahoo.co.uk> wrote:
> Please help!
>
> I have a class that extends MappingDispatchAction
> class
> . This class has, they are below:
>
> <action path="/getCustomer"
> type="com.fujimitsu.cargo.gen.CustomerAction"
> name="cargoForm"
> scope="request"
> validate="false"
> input=".customerDef.jsp"
> parameter="getCustomer">
> <forward name="success" path=".customerDef.jsp" />
> </action>
>
> <action path="/updateCustomer"
> type="com.fujimitsu.cargo.gen.CustomerAction"
> name="cargoForm" scope="request"
> validate="true"
> input=".customerDef.jsp"
> parameter="updateCustomer">
> <forward name="success" path=".customerDef.jsp" />
> </action>
>
> My question:
> 1. In my JSP, what what should be the value of the
> action attribute of html:form
> i.e. <html:form action="??????????"> (i.e. which
> mapping should be specified here)?
>
> 2. what should the code of the button for excuting
> getCustomer method be?
> i.e. <html:submit ???????????????
>
> Thank you.
>
> ___________________________________________________________ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
>
> ---------------------------------------------------------------------
> 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
MappingDispatchAction ...what what should be the value of the action attribute of html:form
Posted by "O. Oke" <re...@yahoo.co.uk>.
Please help!
I have a class that extends MappingDispatchAction
class
. This class has, they are below:
<action path="/getCustomer"
type="com.fujimitsu.cargo.gen.CustomerAction"
name="cargoForm"
scope="request"
validate="false"
input=".customerDef.jsp"
parameter="getCustomer">
<forward name="success" path=".customerDef.jsp" />
</action>
<action path="/updateCustomer"
type="com.fujimitsu.cargo.gen.CustomerAction"
name="cargoForm" scope="request"
validate="true"
input=".customerDef.jsp"
parameter="updateCustomer">
<forward name="success" path=".customerDef.jsp" />
</action>
My question:
1. In my JSP, what what should be the value of the
action attribute of html:form
i.e. <html:form action="??????????"> (i.e. which
mapping should be specified here)?
2. what should the code of the button for excuting
getCustomer method be?
i.e. <html:submit ???????????????
Thank you.
___________________________________________________________ALL-NEW Yahoo! Messenger - all new features - even more fun! http://uk.messenger.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org