LookUpDispatchAction problem with 'bestätigen' button name
Hi, We've got a big problem with Struts 1.2 internationalization. When we change the Locale to German the Confirm button is called bestätigen. The ä character is not getting converted properly by Struts and we get the error 'HTTP Status 400 - Request[/saveR] does not contain handler parameter named actionMethod' The line in the jsp is : input type=submit name=actionMethod value=bestätigen class=button id=button The line in the resources (Unix) : ApplicationResources_de.properties:button.confirm=bestätigen We did fix a problem where in the View Source it was converting the ä char to 2 more special chars like above when it pulled it off Unix. Everything looks ok now, but behind the scenes Struts is translating the button label wrong. We have tried adding enctype=application/x-www-form-urlencoded on the html:form that is submitted, but it made no difference. Please can you help me if you have come across this problem before. Thank you -- View this message in context: http://struts.1045723.n5.nabble.com/LookUpDispatchAction-problem-with-bestatigen-button-name-tp4428718p4428718.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: LookUpDispatchAction problem with 'bestätigen' button name
SOLVED ALREADY added request.setCharacterEncoding(UTF-8); near the top of the security filter http://www.mail-archive.com/struts-user@jakarta.apache.org/msg79130.html thanks anyway -- View this message in context: http://struts.1045723.n5.nabble.com/LookUpDispatchAction-problem-with-bestatigen-button-name-tp4428718p4428785.html Sent from the Struts - User mailing list archive at Nabble.com. - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [S2] LookupDispatchAction Equivalent in Struts 2
--- On Sat, 8/9/08, Lalchandra Rampersaud wrote: I am migrating an application from struts 1 to struts 2 but I cannot find a way to replicate the convenient LookupDispatchAction found in struts 1. I have many buttons that require a form submit require different functions, in struts 1 this is achieved using the key attribute in conjunction with the resource file. You can specify the action method to be called in S2 via mapping or tag attributes. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] LookupDispatchAction Equivalent in Struts 2
Hi Dave, Thanks for the quick reply. Mapping is exacty the solution I need, but I don't know how to implement mapping in struts 2. It would be helpful if you can indicate where I can start looking. Saludos Lalchandra Rampersaud Carpe diem - Original Message - From: Dave Newton [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Saturday, August 09, 2008 5:21 PM Subject: Re: [S2] LookupDispatchAction Equivalent in Struts 2 --- On Sat, 8/9/08, Lalchandra Rampersaud wrote: I am migrating an application from struts 1 to struts 2 but I cannot find a way to replicate the convenient LookupDispatchAction found in struts 1. I have many buttons that require a form submit require different functions, in struts 1 this is achieved using the key attribute in conjunction with the resource file. You can specify the action method to be called in S2 via mapping or tag attributes. Dave - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [S2] LookupDispatchAction Equivalent in Struts 2
--- On Sat, 8/9/08, Lalchandra Rampersaud wrote: Thanks for the quick reply. Mapping is exacty the solution I need, but I don't know how to implement mapping in struts 2. It would be helpful if you can indicate where I can start looking. The action configuration documentation [1] describes how to configure (via XML) the action method called for a particular action mapping. The s:submit.../ tag documentation [2] includes the method attribute, which defines the action method called on submission. The documentation is your friend; I'd spend some time poking around the guide links [3]. Dave [1] http://struts.apache.org/2.x/docs/action-configuration.html [2] http://struts.apache.org/2.x/docs/submit.html [3] http://struts.apache.org/2.x/docs/guides.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Subclass LookupDispatchAction
Good morning, I need to subclass the LookupDispatchAction to write a BaseLookupDispatchAction to centralize the UserRole check of my application (etc.). I try the following piece of code : public abstract class BaseLookupAction extends LookupDispatchAction { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { try{ //Check des users puis ActionForward succes=super.execute(mapping,form,request,response); return succes; } catch(Exception ex) { ex.printStackTrace(); ActionMessages errors = new ActionMessages(); ActionMessage error = new ActionMessage(error.fatal); errors.add(ActionErrors.GLOBAL_MESSAGE,error); saveErrors(request, errors); return mapping.findForward(error); } The problem with that code is that I can not use my CustomErrorHandler because the signature of the execute method does not throw an exception. So I must catch it and manually forward to an error page. Is there a better way to do that? }
Re: Subclass LookupDispatchAction
On 6/25/07, Xavier Vanderstukken [EMAIL PROTECTED] wrote: Good morning, I need to subclass the LookupDispatchAction to write a BaseLookupDispatchAction to centralize the UserRole check of my application (etc.). I try the following piece of code : public abstract class BaseLookupAction extends LookupDispatchAction { public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { try{ //Check des users puis ActionForward succes=super.execute(mapping,form,request,response); return succes; } catch(Exception ex) { ex.printStackTrace(); ActionMessages errors = new ActionMessages(); ActionMessage error = new ActionMessage(error.fatal); errors.add(ActionErrors.GLOBAL_MESSAGE,error); saveErrors(request, errors); return mapping.findForward(error); } The problem with that code is that I can not use my CustomErrorHandler because the signature of the execute method does not throw an exception. I checked LookupDispatchAction and it does declare Exception as being thrown on the execute method - so I don't understand why you're having a problem - what version of Struts are you using? Niall So I must catch it and manually forward to an error page. Is there a better way to do that? } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem using LookupDispatchAction
Jim, You need an resource.properties file define in Message resources section of the struts config file. When made getMethodMap, you need to use the key in the resource file as the key for the map, the value of the method name in your extended LookupDispatchAction. You can refer to Struts examples, there are plenty of dispatch actions, including event one. Good luck. On 11/25/06, Wendy Smoak [EMAIL PROTECTED] wrote: On 11/24/06, Gallagher, Jim (RBoS ITDS Dublin) [EMAIL PROTECTED] wrote: Thanks, that sounds just like what I'm looking for, except for one thing: I need meaningful multi-word labels on the buttons, but it looks to me like the parameter for EventDispatchAction can't cope - is this true, or is it a question of using the properties file? EventDispatchAction looks for the presence of a request parameter in order to choose the method to be executed. It doesn't care what the button text is. -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Yujun Liang [EMAIL PROTECTED]
Problem using LookupDispatchAction
Hi, I've persuaded my project team to upgrade from Struts 1.1 to Struts 1.2.9, simply to allow use of the LookupDispatchAction. However, it's not working correctly for me. Have I misunderstood the requirements, or is there something else obvious I'm doing wrong? I followed the instructions found in the Javadoc at http://struts.apache.org/1.2.x/api/org/apache/struts/actions/LookupDispatchA ction.html http://struts.apache.org/1.2.x/api/org/apache/struts/actions/LookupDispatch Action.html My JSP (form is scContactCardOptions): html:submit value=View Existing Order property=operation / nbsp; html:submit value=orderReplacement property=operation / nbsp; html:submit value=Save Service User Number property=operation / My struts-config.xml: action path=/scContactCardOptions type=com.rbsg.application.serviceuserweb.actions.ScContactCardOptionsAction name=scContactCardOptionsBean parameter=operation forward name=savesuno path=ScContactCardPath/forward forward name=viewexistingorder path=ScContactOrderPath/forward forward name=replacementorder path=ScReplaceOrderPath/forward /action My action class: public class ScContactCardOptionsAction extends LookupDispatchAction { ActionMessages errors = null; ActionForward forward = null; /* (non-Javadoc) * @see org.apache.struts.actions.LookupDispatchAction#getKeyMethodMap() */ protected Map getKeyMethodMap() { System.out.println(executing getKeyMethodMap()); Map map = new HashMap(); map.put(orderReplacement, orderReplacement); map.put(View Existing Order, viewExistingOrder); map.put(Save Service User Number, saveSUNo); return map; } public ActionForward saveSUNo( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { errors = new ActionMessages(); forward = new ActionForward(); getUserPreferences(mapping, request); ScContactCardOptionsFormBean sssb = (ScContactCardOptionsFormBean) form; String contactID = sssb.getContactID(); String serviceUserNo = sssb.getServiceUserNo(); if (errors.isEmpty()) { // Forward control to the appropriate 'success' URI (change name as desired) forward = mapping.findForward(savesuno); } else { // If a message is required, save the specified key(s) // into the request for use by the struts:errors tag. saveErrors(request, errors); } // Finish with return (forward); } Further methods called orderReplacement and viewExistingOrder are defined in an indentical fashion to saveSUNo. The exact error message is: [24/11/06 14:40:21:451 GMT] 6aa82178 DispatchActio E org.apache.struts.actions.DispatchAction Action[/scContactCardOptions] does not contain method named 'View Existing Order' [24/11/06 14:40:21:451 GMT] 6aa82178 DispatchActio E org.apache.struts.actions.DispatchAction TRAS0014I: The following exception was logged java.lang.NoSuchMethodException: com.rbsg.application.serviceuserweb.actions.ScContactCardOptionsAction.View Existing Order(org.apache.struts.action.ActionMapping, org.apache.struts.action.ActionForm, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) Basically, the getKeyMethodMap method does not seem to be executed. Any assistance would be gratefully received. Regards, Jim The Royal Bank of Scotland plc, Registered in Scotland No. 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB Authorised and regulated by the Financial Services Authority. This e-mail message is confidential and for use by the addressee only. If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer. Internet e-mails are not necessarily secure. The Royal Bank of Scotland plc does not accept responsibility for changes made to this message after it was sent. Whilst all reasonable care has been taken to avoid the transmission of viruses, it is the responsibility of the recipient to ensure that the onward transmission, opening or use of this message and any attachments will not adversely affect its systems or data. No responsibility is accepted by The Royal Bank of Scotland plc in this regard
Re: Problem using LookupDispatchAction
On 11/24/06, Gallagher, Jim (RBoS ITDS Dublin) [EMAIL PROTECTED] wrote: I've persuaded my project team to upgrade from Struts 1.1 to Struts 1.2.9, simply to allow use of the LookupDispatchAction. However, it's not working correctly for me. Have I misunderstood the requirements, or is there something else obvious I'm doing wrong? First, EventDispatchAction is a *much* better choice. Please use that instead. http://struts.apache.org/1.2.9/api/org/apache/struts/actions/EventDispatchAction.html (LDA does a reverse lookup from button text to property name and then (in the key method map,) from property name to method name. You didn't show the .properties file, but I doubt your getKeyMethodMap method is correct as written. Compare it to the one in the Javadoc.) -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Problem using LookupDispatchAction
Thanks, that sounds just like what I'm looking for, except for one thing: I need meaningful multi-word labels on the buttons, but it looks to me like the parameter for EventDispatchAction can't cope - is this true, or is it a question of using the properties file? Regards, Jim Jim Gallagher, New BACS Team, Domestic Payments, Payments, Security Fraud, Royal Bank of Scotland, Parkgate Business Park, Parkgate Street, Dublin 8. RBS Depot Code: DUB ITS:7-4171-7167 External: +353-1-648 7167 Internet mail: [EMAIL PROTECTED] -Original Message- From: Wendy Smoak [mailto:[EMAIL PROTECTED] Sent: 24 November 2006 15:04 To: Struts Users Mailing List Subject: Re: Problem using LookupDispatchAction *** WARNING : This message originates from the Internet *** On 11/24/06, Gallagher, Jim (RBoS ITDS Dublin) [EMAIL PROTECTED] wrote: I've persuaded my project team to upgrade from Struts 1.1 to Struts 1.2.9, simply to allow use of the LookupDispatchAction. However, it's not working correctly for me. Have I misunderstood the requirements, or is there something else obvious I'm doing wrong? First, EventDispatchAction is a *much* better choice. Please use that instead. http://struts.apache.org/1.2.9/api/org/apache/struts/actions/EventDispatchAc tion.html (LDA does a reverse lookup from button text to property name and then (in the key method map,) from property name to method name. You didn't show the .properties file, but I doubt your getKeyMethodMap method is correct as written. Compare it to the one in the Javadoc.) -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] The Royal Bank of Scotland plc, Registered in Scotland No. 90312. Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB Authorised and regulated by the Financial Services Authority. This e-mail message is confidential and for use by the addressee only. If the message is received by anyone other than the addressee, please return the message to the sender by replying to it and then delete the message from your computer. Internet e-mails are not necessarily secure. The Royal Bank of Scotland plc does not accept responsibility for changes made to this message after it was sent. Whilst all reasonable care has been taken to avoid the transmission of viruses, it is the responsibility of the recipient to ensure that the onward transmission, opening or use of this message and any attachments will not adversely affect its systems or data. No responsibility is accepted by The Royal Bank of Scotland plc in this regard and the recipient should carry out such virus and other checks as it considers appropriate. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem using LookupDispatchAction
On 11/24/06, Gallagher, Jim (RBoS ITDS Dublin) [EMAIL PROTECTED] wrote: Thanks, that sounds just like what I'm looking for, except for one thing: I need meaningful multi-word labels on the buttons, but it looks to me like the parameter for EventDispatchAction can't cope - is this true, or is it a question of using the properties file? EventDispatchAction looks for the presence of a request parameter in order to choose the method to be executed. It doesn't care what the button text is. -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem with validator framework in LookupDispatchAction
Yariel Ramos Moreno wrote: Hi all: I have a LookupDispatchAction which can be submitted by two buttons (Update and Restore). I need to validate this form only when Update button is pressed. The form field to validate is required and most be integer. The required condition works fine, using the requiredIf validation with a hidden field to check the pressed button (ask for the pressed button and if the value is 1 (Update) then validate, else (value 2 for Restore) don't do anything). If the value in the field is not an integer, the validator framework triggers an exception no matter which button were pressed. What can I do to make this validation using the validator framework? What exception is triggered? What does the form bean look like? I'm guessing that you have a form property declared as 'integer' and the exception is occurring when you have non-integer input. In that case, try changing for form bean property to String. If that's not it, post the relevant snippets of configuration, including your form bean declaration and implementation, your validation rules and relevant JSP code. L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem with validator framework in LookupDispatchAction
Hi all: I have a LookupDispatchAction which can be submitted by two buttons (Update and Restore). I need to validate this form only when Update button is pressed. The form field to validate is required and most be integer. The required condition works fine, using the requiredIf validation with a hidden field to check the pressed button (ask for the pressed button and if the value is 1 (Update) then validate, else (value 2 for Restore) don't do anything). If the value in the field is not an integer, the validator framework triggers an exception no matter which button were pressed. What can I do to make this validation using the validator framework? Thanks in advance. __ XIII Convención Científica de Ingeniería y Arquitectura 28/noviembre al 1/diciembre de 2006 Cujae, Ciudad de la Habana, Cuba http://www.cujae.edu.cu/eventos/convencion
LookupDispatchAction call - onchange of an input field
Have a html:text . onchange of the value entered in this field, have to submit the form. Using LookupDispatchAction. script function onNumChange(numObj) document.forms[0].method.value=numPay; document.forms[0].submit(); } script html:hidden property=method/ // used for LookupDispatchAction html:text name=Form1 styleId=numID property=numPay onchange=onNumChange(this);/ IS it possible to submit a form onchange of a input field? the above is not working. How can this be done? Thanks. _ Get real-time traffic reports with Windows Live Local Search http://local.live.com/default.aspx?v=2cp=42.336065~-109.392273style=rlvl=4scene=3712634trfc=1 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction call - onchange of an input field
On 9/12/06, fea jabi [EMAIL PROTECTED] wrote: Have a html:text . onchange of the value entered in this field, have to submit the form. Using LookupDispatchAction. script function onNumChange(numObj) document.forms[0].method.value=numPay; document.forms[0].submit(); } script html:hidden property=method/ // used for LookupDispatchAction html:text name=Form1 styleId=numID property=numPay onchange=onNumChange(this);/ IS it possible to submit a form onchange of a input field? the above is not working. How can this be done? Thanks. Please specify what do you mean by not working?? is the java script being called? Or is the method value not coming? In case you are using tiles, document.forms[0] might be referring to some other form. you should use the form name instead. -- Puneet
several parameter to LookupDispatchAction
Hi, i want to call a LookupDispatchAction passing more parameter I mean something like this public ActionForward myMethod( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { ActionForward a=new RedirectingActionForward(otherAction.do?method=Openparam2=val); return (a); } I've tried but I'm not able to get the parameter param2 in the otherAction LookupDipastchAction Any help will be appreciated Thanks in advance - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
LookupDispatchAction using wrong resource bundle!
I have multiple resource bundles in addition to the default one in struts-config.xml: message-resources parameter=MessageResources null=false / !-- I put id, parameter and key, because I'm not convinced I know what each one does :( -- message-resources id=constraints parameter=constraints key=constraints factory=ca.indosoft.common.resource.ConstraintResourcesFactory null=true / In my Action: protected void create( ... ) { ... } // and so on... protected Map getKeyMethodMap() { final MapString, String map = new TreeMapString, String(); map.put( form.label.create, create ); map.put( form.label.update, update ); map.put( form.label.delete, delete ); map.put( form.label.clear, clear ); map.put( form.label.cancel, cancel ); map.put( form.label.new, makeNew ); return map; } But when I debug through it, in LookupDispatchAction.initLookupMap( HttpServletRequest, Locale ), it's using the ConstraintResourcesFactory! The only place I actually say 'bundle=constraints' is in my validation.xml, which doesn't get hit at all (my app fails because LookupDispatchAction is looking in the ConstraintResources class, and not MessageResources.properties): form name=myForm field property=title depends=required,maxlength msg name=required key=error.title.required / msg name=maxlength key=error.title.overflow / arg name=maxlength bundle=constraints key=title.length / /field /form Is this a bug, or an issue with my implementation? Thanks, Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction using wrong resource bundle!
LookupDispatchAction checks ALL the resource bundles (and doesn't even stop when it finds the key). Does anyone see any reason why it can't use the same mechanism as everything else, or has this been fixed in a later version? - Scott - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: html:image with LookupDispatchAction
need hep with this please. Thanks. From: fea jabi [EMAIL PROTECTED] Reply-To: Struts Users Mailing List user@struts.apache.org To: user@struts.apache.org Subject: html:image with LookupDispatchAction Date: Tue, 13 Jun 2006 14:48:39 -0400 Trying to use html:image with LookupDispathAction. how to use this? Using 1.2.7 of struts Getting error Request[/DispatchAction] does not contain handler parameter named 'method'. This may be caused by whitespace in the label text. fmt:message var=copyImgVar key=lbl.copy bundle=${appbundle}/ html:image src=images/copy.gif property=method value=${copyImgVar} / struts-config: action path=/DispatchAcctAction type=com.DispatchAcctAction name=AcctForm scope=session parameter=method forward name=successAcct path=/PrepareCustAction.do redirect=false/ /action what am I missing here? Thanks. _ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] _ Dont just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
html:image with LookupDispatchAction
Trying to use html:image with LookupDispathAction. how to use this? Using 1.2.7 of struts Getting error Request[/DispatchAction] does not contain handler parameter named 'method'. This may be caused by whitespace in the label text. fmt:message var=copyImgVar key=lbl.copy bundle=${appbundle}/ html:image src=images/copy.gif property=method value=${copyImgVar} / struts-config: action path=/DispatchAcctAction type=com.DispatchAcctAction name=AcctForm scope=session parameter=method forward name=successAcct path=/PrepareCustAction.do redirect=false/ /action what am I missing here? Thanks. _ Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: How to use LookupdispatchAction
On 5/5/06, DOUILLARD David [EMAIL PROTECTED] wrote: Hi, I have a form that create a user in my database. I use a simple action class. After the création, i forward to a jsp (viewuser.jsp) that show my users. Now, i want to add two buttons on viewuser.jsp (Button.edit, button.delete) for each raw of my table. Can i avoid to have an action by button but have one action for add, delete, view ? How to do this ? My problem is that in struts-config.xml, my create action is linking with a jsp (input attribut) and with a form bean. I suggest you not to use LookupDispatchAction, and to use EventDispatchAction or EventActionDispatcher instead. These classes were introduced in Struts 1.2.9 and Struts 1.3.1. See here for details: http://wiki.apache.org/struts/EventActionDispatcher - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
LookupDispatchAction error
Hello, I have this error using Lookupdispatchaction javax.servlet.ServletException: Action[/creationuser] missing resource 'valider' in key method map My jsp have two buttons : html:submit property=monaction bean:message key=button.valider / /html:submit html:submit property=monaction bean:message key=button.refuser / /html:submit My ApplicationResources.properties button.valider=valider button.refuser=refuser My struts-config.xml action input=/saisieUser.jsp name=creationUserForm parameter=monaction path=/creationuser scope=request type=dsit.user.action.creationUserAction validate=true forward name=affichageUser path=/affichageUser.jsp/ /action And my lookupdispatchaction public ActionForward refuser(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { //Traitement base de données pour refus java.lang.String monMessage = Refusé!; request.setAttribute(beanmonMessage,monMessage); return(mapping.findForward(affichageUser)); } public ActionForward valider(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { //Traitement base de données pour refus java.lang.String monMessage = Validé!; request.setAttribute(beanmonMessage,monMessage); return(mapping.findForward(affichageUser)); } protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(button.valider,valider); map.put(button.refuser,refuser); System.out.print(map.containsKey(button.valider)); // return true System.out.print(map.containsKey(button.refuser)); //return true System.out.print(map.containsValue(valider)); //return true System.out.print(map.containsValue(refuser)); //return true return map; My button refuser works but not my button valider. I don't understand why only one button works ? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction error
just check out in ur struts-config file, if by mistake u have pressed space or tab after button.valider=valider even I got the same error once and this was the mistake On 4/24/06, DOUILLARD David [EMAIL PROTECTED] wrote: Hello, I have this error using Lookupdispatchaction javax.servlet.ServletException: Action[/creationuser] missing resource 'valider' in key method map My jsp have two buttons : html:submit property=monaction bean:message key=button.valider / /html:submit html:submit property=monaction bean:message key=button.refuser / /html:submit My ApplicationResources.properties button.valider=valider button.refuser=refuser My struts-config.xml action input=/saisieUser.jsp name=creationUserForm parameter=monaction path=/creationuser scope=request type=dsit.user.action.creationUserAction validate=true forward name=affichageUser path=/affichageUser.jsp/ /action And my lookupdispatchaction public ActionForward refuser(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { //Traitement base de données pour refus java.lang.String monMessage = Refusé!; request.setAttribute(beanmonMessage,monMessage); return(mapping.findForward(affichageUser)); } public ActionForward valider(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { //Traitement base de données pour refus java.lang.String monMessage = Validé!; request.setAttribute(beanmonMessage,monMessage); return(mapping.findForward(affichageUser)); } protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(button.valider,valider); map.put(button.refuser,refuser); System.out.print(map.containsKey(button.valider)); // return true System.out.print(map.containsKey(button.refuser)); //return true System.out.print(map.containsValue(valider)); //return true System.out.print(map.containsValue(refuser)); //return true return map; My button refuser works but not my button valider. I don't understand why only one button works ? Thanks - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Thanks and Regards Gagan Jain
how to handle requests submitted using java script with a LookupDispatchAction subcalss
Hi, Please guide me overcome this issue. My jsp page has two list boxes, the values in one of those boxes(dependent list box) are populated depending on the selected value in the other one (independent listbox). I tried submitting the value selected in the independentlistbox using javascript. I am using LookupDispatchUpAction subclass to handle this request. I am getting the following error message, javax.servlet.ServletException: Request[/effortTracker] does not contain handler parameter named method org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.java:200) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:446) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:266) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510) javax.servlet.http.HttpServlet.service(HttpServlet.java:709) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) Extract from jsp: -- html:select property=project_id value=0 onchange=javascript: resubmit('EffortTracker','getPrograms') option value=0Select/option bean:define id=Projects name=Menu property=projects type=java.util.Collection/ html:options collection=Projects property=project_ids labelProperty=project_codes/ /html:select The javascript used: function resubmit(form_name,method_value) { document.forms[form_name].method.value= method_value; document.forms[form_name].submit(); } LookupDispatchAction subclass: public class EffortAction extends LookupDispatchAction{ protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(EffortTracker.getPrograms,getPrograms); return map; } public ActionForward getPrograms(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { I have a parameter named method configured in struts- config.xml. action path=/effortTracker name=EffortTracker type=infosys.aol.Actions.EffortAction validate=false parameter=method forward name=continue path=Tiles.EffortTracker/ /action I will be happy to provide any more information as you find needed. Thank you Regards, Nava Krishna M - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
R: how to handle requests submitted using java script with a LookupDispatchAction subcalss
protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(getPrograms,getPrograms); return map; } ApplicationResources.properties getPrograms=getPrograms in jsp html:hidden property=method / -Messaggio originale- Da: Nava Krishna Mallela [mailto:[EMAIL PROTECTED] Inviato: giovedì 6 aprile 2006 12.32 A: user@struts.apache.org Oggetto: how to handle requests submitted using java script with a LookupDispatchAction subcalss Hi, Please guide me overcome this issue. My jsp page has two list boxes, the values in one of those boxes(dependent list box) are populated depending on the selected value in the other one (independent listbox). I tried submitting the value selected in the independentlistbox using javascript. I am using LookupDispatchUpAction subclass to handle this request. I am getting the following error message, javax.servlet.ServletException: Request[/effortTracker] does not contain handler parameter named method org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.java:200) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:446) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:266) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510) javax.servlet.http.HttpServlet.service(HttpServlet.java:709) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) Extract from jsp: -- html:select property=project_id value=0 onchange=javascript: resubmit('EffortTracker','getPrograms') option value=0Select/option bean:define id=Projects name=Menu property=projects type=java.util.Collection/ html:options collection=Projects property=project_ids labelProperty=project_codes/ /html:select The javascript used: function resubmit(form_name,method_value) { document.forms[form_name].method.value= method_value; document.forms[form_name].submit(); } LookupDispatchAction subclass: public class EffortAction extends LookupDispatchAction{ protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(getPrograms,getPrograms); return map; } public ActionForward getPrograms(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { I have a parameter named method configured in struts- config.xml. action path=/effortTracker name=EffortTracker type=infosys.aol.Actions.EffortAction validate=false parameter=method forward name=continue path=Tiles.EffortTracker/ /action ApplicationResources.properties I will be happy to provide any more information as you find needed. Thank you Regards, Nava Krishna M - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: how to handle requests submitted using java script with a LookupDispatchAction subcalss
Hi, Change ur script as follows, it may solve ur problem.. Add u r webRoot name and method name. Still u have problems send a mail.. function resubmit(form_name,method_value) { document.forms[form_name].method.value= method_value; document.forms[form_name].action=your web root name/effortTracker.do?method=place ur method namehere; document.forms[form_name].submit(); } Thanks and Regards, Krishna Mattam Team Member - CDF Toolset Contact:044-22548575 Email: [EMAIL PROTECTED] -Original Message- From: Nava Krishna Mallela [mailto:[EMAIL PROTECTED] Sent: Thursday, April 06, 2006 4:02 PM To: user@struts.apache.org Subject: how to handle requests submitted using java script with a LookupDispatchAction subcalss Hi, Please guide me overcome this issue. My jsp page has two list boxes, the values in one of those boxes(dependent list box) are populated depending on the selected value in the other one (independent listbox). I tried submitting the value selected in the independentlistbox using javascript. I am using LookupDispatchUpAction subclass to handle this request. I am getting the following error message, javax.servlet.ServletException: Request[/effortTracker] does not contain handler parameter named method org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAct ion.java:200) org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr ocessor.java:446) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java: 266) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510) javax.servlet.http.HttpServlet.service(HttpServlet.java:709) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) Extract from jsp: -- html:select property=project_id value=0 onchange=javascript: resubmit('EffortTracker','getPrograms') option value=0Select/option bean:define id=Projects name=Menu property=projects type=java.util.Collection/ html:options collection=Projects property=project_ids labelProperty=project_codes/ /html:select The javascript used: function resubmit(form_name,method_value) { document.forms[form_name].method.value= method_value; document.forms[form_name].submit(); } LookupDispatchAction subclass: public class EffortAction extends LookupDispatchAction{ protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(EffortTracker.getPrograms,getPrograms); return map; } public ActionForward getPrograms(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { I have a parameter named method configured in struts- config.xml. action path=/effortTracker name=EffortTracker type=infosys.aol.Actions.EffortAction validate=false parameter=method forward name=continue path=Tiles.EffortTracker/ /action I will be happy to provide any more information as you find needed. Thank you Regards, Nava Krishna M - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: R: how to handle requests submitted using java script with a LookupDispatchAction subcalss
Hi Diaconu Eduard, I aready have a key(EffortTracker.getProgram) mapped to the value( getPrograms). i.e. application.resources file contains, EffortTracker.getPrograms=getPrograms and protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(EffortTracker.getPrograms,getPrograms); return map; } (I am sorry the code that was there in my initial mail is not showing getKeyMethodMap method properly) I guess, LookupDispatchAction will reverse map the value to key using properties file. and action mapping in struts-config.xml already declared method as a parameter. Taking that into consideration , do we still need to use html:hidden proprety = method / Regards, Nava Krishna. M Diaconu Eduard wrote: protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(getPrograms,getPrograms); return map; } ApplicationResources.properties getPrograms=getPrograms in jsp html:hidden property=method / -Messaggio originale- Da: Nava Krishna Mallela [mailto:[EMAIL PROTECTED] Inviato: giovedì 6 aprile 2006 12.32 A: user@struts.apache.org Oggetto: how to handle requests submitted using java script with a LookupDispatchAction subcalss Hi, Please guide me overcome this issue. My jsp page has two list boxes, the values in one of those boxes(dependent list box) are populated depending on the selected value in the other one (independent listbox). I tried submitting the value selected in the independentlistbox using javascript. I am using LookupDispatchUpAction subclass to handle this request. I am getting the following error message, javax.servlet.ServletException: Request[/effortTracker] does not contain handler parameter named method org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.java:200) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:446) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:266) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510) javax.servlet.http.HttpServlet.service(HttpServlet.java:709) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) Extract from jsp: -- html:select property=project_id value=0 onchange=javascript: resubmit('EffortTracker','getPrograms') option value=0Select/option bean:define id=Projects name=Menu property=projects type=java.util.Collection/ html:options collection=Projects property=project_ids labelProperty=project_codes/ /html:select The javascript used: function resubmit(form_name,method_value) { document.forms[form_name].method.value= method_value; document.forms[form_name].submit(); } LookupDispatchAction subclass: public class EffortAction extends LookupDispatchAction{ protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(getPrograms,getPrograms); return map; } public ActionForward getPrograms(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { I have a parameter named method configured in struts- config.xml. action path=/effortTracker name=EffortTracker type=infosys.aol.Actions.EffortAction validate=false parameter=method forward name=continue path=Tiles.EffortTracker/ /action ApplicationResources.properties I will be happy to provide any more information as you find needed. Thank you Regards, Nava Krishna M - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
LookupDispatchAction and Internationalization
Hi, I am using Struts 1.2.7 with the LookupDispatchAction and everything works fine, as long as the labels of the buttons (=values of the keys of the resourcebundles) are not using special characters. If there are special characters I get the following error: missing resource 'Hinzuf�' in key method map so it seems, that there is a problem with the special character ü (\u00FC), because the real value should be 'Hinzufügen' - but cannot be interpreted and is therefore replaced by a question mark. In my messageresource property-file I have replaced all special characters with the according \u-coding, but it seems that at some other place (struts-config.xml ?!) I have to tell the Struts-framework to use Unicode ... Thanks in advance for any hints in this matter! cheers, karin. -- Any idiot can face a crisis. It is the day-to-day living that wears you out. - Anton Chekov - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction and Internationalization
Thanks for the info - I was already using a UTF-8 filter that does the following (as all my input-fields should accept special characters): - request.setCharacterEncoding(UTF8); chain.doFilter(request, response); - but in the meantime, I found out, that my special problem is only occuring when run from within my IDE, but everything worked fine when deployed on Tomcat. so I think I can live with that ... cheers, karin. starki78 wrote: Ciao, I few days ago I stepped over an encoding servlet-filter. It checks before each action the encoding of the request and can change it to the value you would like to have. Perhaps this would be a good solution for your problem! Nice greetings -- Initial Header --- From : Karin Schellner [EMAIL PROTECTED] To : Struts Users Mailing List user@struts.apache.org Cc : Date : Wed, 05 Apr 2006 10:46:12 +0200 Subject : LookupDispatchAction and Internationalization Hi, I am using Struts 1.2.7 with the LookupDispatchAction and everything works fine, as long as the labels of the buttons (=values of the keys of the resourcebundles) are not using special characters. If there are special characters I get the following error: missing resource 'Hinzuf?' in key method map so it seems, that there is a problem with the special character ü (\u00FC), because the real value should be 'Hinzufügen' - but cannot be interpreted and is therefore replaced by a question mark. In my messageresource property-file I have replaced all special characters with the according \u-coding, but it seems that at some other place (struts-config.xml ?!) I have to tell the Struts-framework to use Unicode ... Thanks in advance for any hints in this matter! cheers, karin. -- Any idiot can face a crisis. It is the day-to-day living that wears you out. - Anton Chekov - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- DI Karin Schellner Research Studios Austria - Digital Memory Engineering ARC Seibersdorf research GmbH Thurngasse 8/20, A-1090 Wien M. +43.664.825-1105 T. +43.1.585-0537 F. +43.1.585-3741 http://dme.researchstudio.at -- Any idiot can face a crisis. It is the day-to-day living that wears you out. - Anton Chekov - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction and Internationalization
On 4/5/06, Karin Schellner [EMAIL PROTECTED] wrote: Hi, I am using Struts 1.2.7 with the LookupDispatchAction and everything works fine, as long as the labels of the buttons (=values of the keys of the resourcebundles) are not using special characters. If there are special characters I get the following error: missing resource 'Hinzuf�' in key method map so it seems, that there is a problem with the special character ü (\u00FC), because the real value should be 'Hinzufügen' - but cannot be interpreted and is therefore replaced by a question mark. In my messageresource property-file I have replaced all special characters with the according \u-coding, but it seems that at some other place (struts-config.xml ?!) I have to tell the Struts-framework to use Unicode ... Thanks in advance for any hints in this matter! I suggest you upgrade to 1.2.9, throw out LookupDispatchAction and use EventActionDispatcher: http://wiki.apache.org/struts/EventActionDispatcher Michael.
Difference between DispatchAction and LookupDispatchAction
Hi i like to know the difference between DispatchAction and LookupDispatchAction in struts 1.2. anyone can help me... with regards vasu - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Difference between DispatchAction and LookupDispatchAction
The LookupDispatchAction * http://struts.apache.org/struts-extras/apidocs/org/apache/struts/actions/LookupDispatchAction.html is designed for use in localized applications that will have different labels on buttons in different locales. People will sometimes want to give multiple button the same name, and then tell them apart by the label. The LookupDispatchAction does a reverse lookup on the button's label and returns the original message resource token. You can then act on whichever button was pressed. -- HTH, Ted. On 3/30/06, vasumathi [EMAIL PROTECTED] wrote: Hi i like to know the difference between DispatchAction and LookupDispatchAction in struts 1.2. anyone can help me... with regards vasu - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Difference between DispatchAction and LookupDispatchAction
A DispatchAction contains a number of different methods other than the standard execute(). These methods are executed based on some request parameter. Your action mapping in struts-config specifies the request parameter to examine. Then, whatever the value of that parameter is for a given request, Struts will try to execute the method in the action whos name matches the value of the parameter. A LookupDispatchAction by contrast determines which method to call not based directly on a request parameter's value, but by doing a lookup to determine the method, based on the value of the parameter. You provide a method that accepts the value of the request parameter and returns the method to execute. How you actually implement the lookup is of course up to you, but a simple Map is probably most typical. I suppose if I were to state the difference as concisely as possible, I would probably say this... The method to execute on a DispatchAction is determined by Struts based on the value of a specified request parameter, whereas the method to execute on a LookupDispachAction is determined by your Action itself based on the value of a specified request parameter. HTH, Frank -- Frank W. Zammetti Founder and Chief Software Architect Omnytex Technologies http://www.omnytex.com AIM: fzammetti Yahoo: fzammetti MSN: [EMAIL PROTECTED] Java Web Parts - http://javawebparts.sourceforge.net Supplying the wheel, so you don't have to reinvent it! On Thu, March 30, 2006 4:00 am, vasumathi said: Hi i like to know the difference between DispatchAction and LookupDispatchAction in struts 1.2. anyone can help me... with regards vasu - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Difference between DispatchAction and LookupDispatchAction
On 3/30/06, vasumathi [EMAIL PROTECTED] wrote: Hi i like to know the difference between DispatchAction and LookupDispatchAction in struts 1.2. anyone can help me... They both have their deficiencies. If you are looking for a good dispatching action, use EventActionDispatcher from Struts 1.2.9: http://wiki.apache.org/struts/EventActionDispatcher Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Difference between DispatchAction and LookupDispatchAction
God, if I had this in my project a year ago :( 2006/3/30, Michael Jouravlev [EMAIL PROTECTED]: On 3/30/06, vasumathi [EMAIL PROTECTED] wrote: Hi i like to know the difference between DispatchAction and LookupDispatchAction in struts 1.2. anyone can help me... They both have their deficiencies. If you are looking for a good dispatching action, use EventActionDispatcher from Struts 1.2.9: http://wiki.apache.org/struts/EventActionDispatcher Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: multiple submit buttons: LookupDispatchAction / ActionForward formdata missing
have i defined it? yes i did. I will check as soon as I get to work. thank you for the observation. From: Michael Jouravlev [mailto:[EMAIL PROTECTED] Sent: Tue 2/28/2006 4:09 PM To: Struts Users Mailing List Subject: Re: multiple submit buttons: LookupDispatchAction / ActionForward formdata missing On 2/28/06, SIRAGHER, JOEL [EMAIL PROTECTED] wrote: I'm doing multiple submit buttons on my struts/jsp 1.1 page. My debugger takes me to the correct action, but the action has no form data in it. ... RetrieveFormBean dataForm = (RetrieveFormBean) form; // form data comes back null. Contains no data forwarded. . return mapping.findForward(retrieve); } My struts-config.xml action path=/actions/retrieve name=RetrieveFormBean type=com.struts.action.RetrieveAction scope=session parameter=method forward name=Retrieve path=/tiles/Retrieve.jsp/ /action RetrieveFormBean mentioned in the name attribute is not a class name, it is the name of an ActionForm instance. Have you defined it in form-beans section? rantTim Fennel is right, Struts configuration is a sucky thing./rant Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: multiple submit buttons: LookupDispatchAction / ActionForward formdata missing
we are unfortunately using 1.1. I will check with the techspert team to see if we can switch over. thank you for the suggestion From: Michael Jouravlev [mailto:[EMAIL PROTECTED] Sent: Tue 2/28/2006 4:15 PM To: Struts Users Mailing List Subject: Re: multiple submit buttons: LookupDispatchAction / ActionForward formdata missing On 2/28/06, SIRAGHER, JOEL [EMAIL PROTECTED] wrote: skipped/ By the way, LookupDispatchAction is not the best choice to dispatch events. I suggest you to use this one: http://issues.apache.org/bugzilla/attachment.cgi?id=17724 You will also need ActionDispatcher class from Struts 1.2.7+ distro. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: multiple submit buttons: LookupDispatchAction / ActionForward formdata missing
LookupDispatchAction is horrid. Use one of the varieties found at www.michaelmcgrady.com under buttons. You also don't need to change from 1.1 to 1.2.7. You just need the class, which you can put in yourself. On 2/28/06, SIRAGHER, JOEL [EMAIL PROTECTED] wrote: Greetings: I've been debugging now for a while, and don't know where to continue looking. I'm doing multiple submit buttons on my struts/jsp 1.1 page. My debugger takes me to the correct action, but the action has no form data in it. On the jsp side, I am entering data, etc. Do I have to put something special in my struts-config.xml? Im pretty stuck here now for the last few days. Can some one make a suggestion? My .jsp: == html:form action=/actions/retrieve method=post TD align=center html:submit property=method bean:message key=button.UpdatePage / /html:submit /TD My Action Class: = public class RetrieveAction extends LookupDispatchAction { protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(button.UpdatePage, updatePage); } public ActionForward updatePage(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { RetrieveFormBean dataForm = (RetrieveFormBean) form; // form data comes back null. Contains no data forwarded. . return mapping.findForward(retrieve); } My struts-config.xml action path=/actions/retrieve name=RetrieveFormBean type=com.struts.action.RetrieveAction scope=session parameter=method forward name=Retrieve path=/tiles/Retrieve.jsp/ /action - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~
Re: multiple submit buttons: LookupDispatchAction / ActionForward formdata missing
P.S. The lookup dispatch action is a new and improved version at www.michaelmcgrady.com, not the bad one in Struts. On 2/28/06, SIRAGHER, JOEL [EMAIL PROTECTED] wrote: Greetings: I've been debugging now for a while, and don't know where to continue looking. I'm doing multiple submit buttons on my struts/jsp 1.1 page. My debugger takes me to the correct action, but the action has no form data in it. On the jsp side, I am entering data, etc. Do I have to put something special in my struts-config.xml? Im pretty stuck here now for the last few days. Can some one make a suggestion? My .jsp: == html:form action=/actions/retrieve method=post TD align=center html:submit property=method bean:message key=button.UpdatePage / /html:submit /TD My Action Class: = public class RetrieveAction extends LookupDispatchAction { protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(button.UpdatePage, updatePage); } public ActionForward updatePage(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { RetrieveFormBean dataForm = (RetrieveFormBean) form; // form data comes back null. Contains no data forwarded. . return mapping.findForward(retrieve); } My struts-config.xml action path=/actions/retrieve name=RetrieveFormBean type=com.struts.action.RetrieveAction scope=session parameter=method forward name=Retrieve path=/tiles/Retrieve.jsp/ /action - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~
Re: multiple submit buttons: LookupDispatchAction / ActionForward formdata missing
You don't need to switch, you just need the two classes I mentioned. You dont need a keymethodmap either. === cut here === jsp: html:form action=/actions/retrieve method=post html:submit property=updateEvent bean:message key=button.UpdatePage / /html:submit /html:form Action Class: = public class RetrieveAction extends Action { /** * Instantiate event dispatcher */ protected ActionDispatcher dispatcher = new EventDispatcher(this, false); /** * Use event dispatcher to call an appropriate event handler. * By using a dispatcher an action class does not have * to extend a DispatchAction flavor. */ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { return dispatcher.execute(mapping, form, request, response); } public ActionForward updatePage(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { RetrieveFormBean dataForm = (RetrieveFormBean) form; . return mapping.findForward(retrieve); } } struts-config.xml action path=/actions/retrieve name=RetrieveFormBean type=com.struts.action.RetrieveAction scope=session parameter=updateEvent=updatePage forward name=Retrieve path=/tiles/Retrieve.jsp/ /action === cut here === On 3/1/06, SIRAGHER, JOEL [EMAIL PROTECTED] wrote: we are unfortunately using 1.1. I will check with the techspert team to see if we can switch over. thank you for the suggestion From: Michael Jouravlev [mailto:[EMAIL PROTECTED] Sent: Tue 2/28/2006 4:15 PM To: Struts Users Mailing List Subject: Re: multiple submit buttons: LookupDispatchAction / ActionForward formdata missing On 2/28/06, SIRAGHER, JOEL [EMAIL PROTECTED] wrote: skipped/ By the way, LookupDispatchAction is not the best choice to dispatch events. I suggest you to use this one: http://issues.apache.org/bugzilla/attachment.cgi?id=17724 You will also need ActionDispatcher class from Struts 1.2.7+ distro. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
MESS!: multiple submit buttons: LookupDispatchAction / ActionForward formdata missing
I got the ok on switching to 1.2.8, and I will also try your method this afternoon. I appreciate everyones responses. In the mean time, I have some design issues and questions: Does the old lookupdispatch action sometimes loose stuff that lives on the form?? I have a very complicated form. I am trying to find an easier way of programming it. Leave the page via google type links; or leave the page via sortNow button; or leave the page via selectNow button; or leave the screen via select/unselect entire set; select/unselect entire page. Google type links look like this for me: = html:link action=/actions/RetrieveInit?movegroup=firstset logic:iterate id=folder name=RetrieveFormBean property=recNumLinkText type=com.xxx.struts.action.RecNumLinkText html:link action =/actions/SortRetrieveInit paramId=clickwindow paramName=folder bean:write name=folder property=linkText / /html:link /logic:iterate html:link action=/actions/RetrieveInit?movegroup=lastset Then I have a group of dropdowns to select sorting criteria. Clicking the sort button goes thru the old lookupdispatchAction. They have their own in the lookup dispatch as: html:submit property=method bean:message key=button.SortNow / /html:submit html:submit property=method bean:message key=button.UpdatePage / // click a few checkboxes /html:submit html:submit property=method bean:message key=button.SelectCurrentPage / /html:submit html:submit property=method //current page of results bean:message key=button.UnselectCurrentPage / /html:submit html:submit property=method //all results in the results table. bean:message key=button.SelectAllResults / /html:submit Then I also have other functionality called: SelectNow which allows selecting groups of records based on criteria. On the design side, I have 2 actions: an InitAction which pulls the records out of the database and puts them in queryResults[] that lives in the form bean. Then I have the actions which go thru the old lookupdispatch thing, except for the google type links which send processing via html:link forward to the RetrieveInitAction The most disturbing issues I've run across now is that If I use the dispatch button that checks All records on the screen. The data gets to the database, and redraws the records on the screen as checked. But when I go to uncheck a few, and hit the update page button, which reads the form and looks for checkboxes unchecked or checked... they all show up as checked again. What a mess. All this lives on one screen. Any ideas on redesign or how to make it easier to program? -Original Message- From: Michael Jouravlev [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 01, 2006 11:17 AM To: Struts Users Mailing List Subject: Re: multiple submit buttons: LookupDispatchAction / ActionForward formdata missing You don't need to switch, you just need the two classes I mentioned. You dont need a keymethodmap either. === cut here === jsp: html:form action=/actions/retrieve method=post html:submit property=updateEvent bean:message key=button.UpdatePage / /html:submit /html:form Action Class: = public class RetrieveAction extends Action { /** * Instantiate event dispatcher */ protected ActionDispatcher dispatcher = new EventDispatcher(this, false); /** * Use event dispatcher to call an appropriate event handler. * By using a dispatcher an action class does not have * to extend a DispatchAction flavor. */ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { return dispatcher.execute(mapping, form, request, response); } public ActionForward updatePage(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { RetrieveFormBean dataForm = (RetrieveFormBean) form; . return mapping.findForward(retrieve); } } struts-config.xml action path=/actions/retrieve name=RetrieveFormBean type=com.struts.action.RetrieveAction scope=session parameter=updateEvent=updatePage forward name=Retrieve path=/tiles/Retrieve.jsp/ /action === cut here === On 3/1/06, SIRAGHER, JOEL [EMAIL PROTECTED] wrote: we are unfortunately using 1.1. I will check with the techspert team to see if we can switch over. thank you for the suggestion From: Michael Jouravlev [mailto:[EMAIL PROTECTED] Sent: Tue 2/28/2006 4:15 PM To: Struts Users Mailing List Subject: Re: multiple submit buttons: LookupDispatchAction / ActionForward formdata missing On 2/28/06, SIRAGHER, JOEL [EMAIL PROTECTED] wrote: skipped/ By the way
Re: MESS!: multiple submit buttons: LookupDispatchAction / ActionForward formdata missing
On 3/1/06, SIRAGHER, JOEL [EMAIL PROTECTED] wrote: I got the ok on switching to 1.2.8, and I will also try your method this afternoon. I appreciate everyones responses. In the mean time, I have some design issues and questions: Does the old lookupdispatch action sometimes loose stuff that lives on the form?? An action (if you mean action class) cannot lose stuff from the form. An action is just a C in MVC and it is stateless. I will answer the checkbox question further in this reply. I have a very complicated form. I am trying to find an easier way of programming it. You can have either one solid page or a composite page that contains different self-sufficient components. If you have one solid page, then I would say process it with one (or two) actions. Make the submit action a dispatch-type action (like you already did) and channel all page events to submit action. The render action would fill out and display the page. This is what you are already doing. If you prefer to have a composite page, then you can either use something like Tiles (never used it) or you can use other component technology. In this case you can have as many actions as many subcomponents you have. I don't want to advise any specific component technology, it all depends on taste. I have my own implementation, but it is in alpha stage so I don't want to mess your production environment. skipped/ Then I also have other functionality called: SelectNow which allows selecting groups of records based on criteria. On the design side, I have 2 actions: an InitAction which pulls the records out of the database and puts them in queryResults[] that lives in the form bean. Then I have the actions which go thru the old lookupdispatch thing, except for the google type links which send processing via html:link forward to the RetrieveInitAction The most disturbing issues I've run across now is that If I use the dispatch button that checks All records on the screen. The data gets to the database, and redraws the records on the screen as checked. But when I go to uncheck a few, and hit the update page button, which reads the form and looks for checkboxes unchecked or checked... they all show up as checked again. This is a known issue, more like HTTP thing than Struts. Unchecked radiobuttons and checkboxes are not sent to the server by browser, so when you submit a form, you need to clear checkboxes before ActionForm is populated. The only place to do this is ActionForm.reset() method. Clear all checkboxes and do not set them with data from database. When form is populated from the request, the checked checkboxes will be set. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: MESS!: multiple submit buttons: LookupDispatchAction / ActionForward formdata missing
The Action class is not the controller. The controller is the class that chooses the Action class. On 3/1/06, Michael Jouravlev [EMAIL PROTECTED] wrote: On 3/1/06, SIRAGHER, JOEL [EMAIL PROTECTED] wrote: I got the ok on switching to 1.2.8, and I will also try your method this afternoon. I appreciate everyones responses. In the mean time, I have some design issues and questions: Does the old lookupdispatch action sometimes loose stuff that lives on the form?? An action (if you mean action class) cannot lose stuff from the form. An action is just a C in MVC and it is stateless. I will answer the checkbox question further in this reply. I have a very complicated form. I am trying to find an easier way of programming it. You can have either one solid page or a composite page that contains different self-sufficient components. If you have one solid page, then I would say process it with one (or two) actions. Make the submit action a dispatch-type action (like you already did) and channel all page events to submit action. The render action would fill out and display the page. This is what you are already doing. If you prefer to have a composite page, then you can either use something like Tiles (never used it) or you can use other component technology. In this case you can have as many actions as many subcomponents you have. I don't want to advise any specific component technology, it all depends on taste. I have my own implementation, but it is in alpha stage so I don't want to mess your production environment. skipped/ Then I also have other functionality called: SelectNow which allows selecting groups of records based on criteria. On the design side, I have 2 actions: an InitAction which pulls the records out of the database and puts them in queryResults[] that lives in the form bean. Then I have the actions which go thru the old lookupdispatch thing, except for the google type links which send processing via html:link forward to the RetrieveInitAction The most disturbing issues I've run across now is that If I use the dispatch button that checks All records on the screen. The data gets to the database, and redraws the records on the screen as checked. But when I go to uncheck a few, and hit the update page button, which reads the form and looks for checkboxes unchecked or checked... they all show up as checked again. This is a known issue, more like HTTP thing than Struts. Unchecked radiobuttons and checkboxes are not sent to the server by browser, so when you submit a form, you need to clear checkboxes before ActionForm is populated. The only place to do this is ActionForm.reset() method. Clear all checkboxes and do not set them with data from database. When form is populated from the request, the checked checkboxes will be set. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~
multiple submit buttons: LookupDispatchAction / ActionForward formdata missing
Greetings: I've been debugging now for a while, and don't know where to continue looking. I'm doing multiple submit buttons on my struts/jsp 1.1 page. My debugger takes me to the correct action, but the action has no form data in it. On the jsp side, I am entering data, etc. Do I have to put something special in my struts-config.xml? Im pretty stuck here now for the last few days. Can some one make a suggestion? My .jsp: == html:form action=/actions/retrieve method=post TD align=center html:submit property=method bean:message key=button.UpdatePage / /html:submit /TD My Action Class: = public class RetrieveAction extends LookupDispatchAction { protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(button.UpdatePage, updatePage); } public ActionForward updatePage(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { RetrieveFormBean dataForm = (RetrieveFormBean) form; // form data comes back null. Contains no data forwarded. . return mapping.findForward(retrieve); } My struts-config.xml action path=/actions/retrieve name=RetrieveFormBean type=com.struts.action.RetrieveAction scope=session parameter=method forward name=Retrieve path=/tiles/Retrieve.jsp/ /action - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: multiple submit buttons: LookupDispatchAction / ActionForward formdata missing
On 2/28/06, SIRAGHER, JOEL [EMAIL PROTECTED] wrote: I'm doing multiple submit buttons on my struts/jsp 1.1 page. My debugger takes me to the correct action, but the action has no form data in it. ... RetrieveFormBean dataForm = (RetrieveFormBean) form; // form data comes back null. Contains no data forwarded. . return mapping.findForward(retrieve); } My struts-config.xml action path=/actions/retrieve name=RetrieveFormBean type=com.struts.action.RetrieveAction scope=session parameter=method forward name=Retrieve path=/tiles/Retrieve.jsp/ /action RetrieveFormBean mentioned in the name attribute is not a class name, it is the name of an ActionForm instance. Have you defined it in form-beans section? rantTim Fennel is right, Struts configuration is a sucky thing./rant Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: multiple submit buttons: LookupDispatchAction / ActionForward formdata missing
On 2/28/06, SIRAGHER, JOEL [EMAIL PROTECTED] wrote: skipped/ By the way, LookupDispatchAction is not the best choice to dispatch events. I suggest you to use this one: http://issues.apache.org/bugzilla/attachment.cgi?id=17724 You will also need ActionDispatcher class from Struts 1.2.7+ distro. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem using LookupDispatchAction
Don't bother with this. This is just the purloined nutso version. Try the original which is simple and works at www.michaelmcgrady.com. On 11/30/05, Michael Jouravlev [EMAIL PROTECTED] wrote: On 11/30/05, Matheus Eduardo Machado Moreira [EMAIL PROTECTED] wrote: Hi, I have a problem using LookupDispatchAction. I already tried looking for the solution on Google, this list archive and other resources but I wasn't able to fix the problem. Maybe some of you can help me. My action extends LookupDispatchAction and implements the getKeyMethodMap() method. In my ApplicationResources.properties file I define all the keys for the buttons that can be shown in my interfaces. Everything seems to be ok but every time I try to access my pages I receive the following error: javax.servlet.ServletException: Action[/pesquisaIngrediente] missing resource 'comando.iniciar' in key method map. I did everything as shown in the LookupDispatchAction's javadoc but the application doesn't work. Can someone help me with this frustrating error? Source code snippet would be nice. Can you access other resources from this file? Is it in proper location? Anyway, do you want to try a better alternative? Here it is: http://struts.sourceforge.net/strutsdialogs/selectaction.html This class is not available as separate download, so you need to get the whole library, but it is very small. The latest update in version 1.24 allows you to use this action as utility class, that is, your action does not have to extend it, you can just instantiate it and call it. Check the samples for example of how to do that. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- You can lead a horse to water but you cannot make it float on its back. ~Dakota Jack~
Re: Problem using LookupDispatchAction
Michael Jouravlev wrote: On 11/30/05, Matheus Eduardo Machado Moreira [EMAIL PROTECTED] wrote: Hi, I have a problem using LookupDispatchAction. I already tried looking for the solution on Google, this list archive and other resources but I wasn't able to fix the problem. Maybe some of you can help me. My action extends LookupDispatchAction and implements the getKeyMethodMap() method. In my ApplicationResources.properties file I define all the keys for the buttons that can be shown in my interfaces. Everything seems to be ok but every time I try to access my pages I receive the following error: javax.servlet.ServletException: Action[/pesquisaIngrediente] missing resource 'comando.iniciar' in key method map. I did everything as shown in the LookupDispatchAction's javadoc but the application doesn't work. Can someone help me with this frustrating error? Source code snippet would be nice. Can you access other resources from this file? Is it in proper location? Anyway, do you want to try a better alternative? Here it is: http://struts.sourceforge.net/strutsdialogs/selectaction.html This class is not available as separate download, so you need to get the whole library, but it is very small. The latest update in version 1.24 allows you to use this action as utility class, that is, your action does not have to extend it, you can just instantiate it and call it. Check the samples for example of how to do that. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Problem using LookupDispatchAction
Hi, I have a problem using LookupDispatchAction. I already tried looking for the solution on Google, this list archive and other resources but I wasn't able to fix the problem. Maybe some of you can help me. My action extends LookupDispatchAction and implements the getKeyMethodMap() method. In my ApplicationResources.properties file I define all the keys for the buttons that can be shown in my interfaces. Everything seems to be ok but every time I try to access my pages I receive the following error: javax.servlet.ServletException: Action[/pesquisaIngrediente] missing resource 'comando.iniciar' in key method map. I did everything as shown in the LookupDispatchAction's javadoc but the application doesn't work. Can someone help me with this frustrating error? Thanks, Matheus Eduardo Machado Moreira [EMAIL PROTECTED] Belo Horizonte - MG (31) 8724-8041 Sun Certified Programmer for the Java 2 Plataform 1.4 -- Valeu a pena? Tudo vale a pena Se a alma não é pequena. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem using LookupDispatchAction
On 11/30/05, Matheus Eduardo Machado Moreira [EMAIL PROTECTED] wrote: My action extends LookupDispatchAction and implements the getKeyMethodMap() method. In my ApplicationResources.properties file I define all the keys for the buttons that can be shown in my interfaces. Everything seems to be ok but every time I try to access my pages I receive the following error: javax.servlet.ServletException: Action[/pesquisaIngrediente] missing resource 'comando.iniciar' in key method map. My guess is that you've got things backwards in getKeyMethodMap, but it's hard to tell without seeing some code. Can you post the relevant bits of getKeyMethodMap, your .properties file, and one of your buttons? -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem using LookupDispatchAction
On 11/30/05, Matheus Eduardo Machado Moreira [EMAIL PROTECTED] wrote: Hi, I have a problem using LookupDispatchAction. I already tried looking for the solution on Google, this list archive and other resources but I wasn't able to fix the problem. Maybe some of you can help me. My action extends LookupDispatchAction and implements the getKeyMethodMap() method. In my ApplicationResources.properties file I define all the keys for the buttons that can be shown in my interfaces. Everything seems to be ok but every time I try to access my pages I receive the following error: javax.servlet.ServletException: Action[/pesquisaIngrediente] missing resource 'comando.iniciar' in key method map. I did everything as shown in the LookupDispatchAction's javadoc but the application doesn't work. Can someone help me with this frustrating error? Source code snippet would be nice. Can you access other resources from this file? Is it in proper location? Anyway, do you want to try a better alternative? Here it is: http://struts.sourceforge.net/strutsdialogs/selectaction.html This class is not available as separate download, so you need to get the whole library, but it is very small. The latest update in version 1.24 allows you to use this action as utility class, that is, your action does not have to extend it, you can just instantiate it and call it. Check the samples for example of how to do that. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem using LookupDispatchAction
I have the following key-value mappings in the .properties file (keys and values in Portuguese, I know all of you know Portuguese :-)). comando.pesquisar=Pesquisar (search) comando.editar=Editar (edit) comando.salvar=Salvar (save) comando.iniciar=iniciar (init, used as default entry point) I have a class where I put all the constants used throughout the application and this class declares a default key-method map: MapString, String defaultKeyMethodMap = new HashMapString, String(); defaultKeyMethodMap.put(comando.pesquisar, pesquisar); defaultKeyMethodMap.put(comando.editar, editar); defaultKeyMethodMap.put(comando.salvar, salvar); defaultKeyMethodMap.put(comando.iniciar, iniciar); My getKeyMethodMap() method is as below: protected Map getKeyMethodMap() { return Constants.defaultKeyMethodMap; } My action is simple. One detail, I don't define (yet) all the methods present in the key-method map because I'm constructing the action class method by method and testing each one. public class CadastroIngredienteAction extends LookupDispatchAction { public ActionForward iniciar(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { return mapping.findForward(refresh); } // other action methods here // getKeyMethodMap() as before comes here } In my .jsp file I have my buttons like this: html:form action=/pesquisaIngrediente html:submit property=acao fmt:message key=comando.pesquisar/ /html:submit /html:form Finally the action mapping in struts-config: action path=/pesquisaIngrediente type=br.com.patrulleros.manjar.action.CadastroIngredienteAction name=cadastroIngredienteFormBean scope=session parameter=acao forward name=refresh path=/WEB-INF/paginas/cadastroIngrediente/pesquisaIngrediente.jsp/ /action One more thing, I try to access the page typing the page's address directly in my browser: http://localhost:8084/pesquisaIngrediente.do?acao=comando.pesquisar. I do this way because I don't have a menu or something like this yet. Thanks, Matheus Eduardo Machado Moreira [EMAIL PROTECTED] Belo Horizonte - MG (31) 8724-8041 Sun Certified Programmer for the Java 2 Plataform 1.4 -- Valeu a pena? Tudo vale a pena Se a alma não é pequena. 2005/11/30, Wendy Smoak [EMAIL PROTECTED]: On 11/30/05, Matheus Eduardo Machado Moreira [EMAIL PROTECTED] wrote: My action extends LookupDispatchAction and implements the getKeyMethodMap() method. In my ApplicationResources.properties file I define all the keys for the buttons that can be shown in my interfaces. Everything seems to be ok but every time I try to access my pages I receive the following error: javax.servlet.ServletException: Action[/pesquisaIngrediente] missing resource 'comando.iniciar' in key method map. My guess is that you've got things backwards in getKeyMethodMap, but it's hard to tell without seeing some code. Can you post the relevant bits of getKeyMethodMap, your .properties file, and one of your buttons? -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Problem using LookupDispatchAction
In your url you have acao=comando.pesquisar, I have always used the form where acao=Pesquisar or the value of the key in the map. Also are you sure that your Constants class is providing the Map to the LookupDispatchAction? Matt Morton On 11/30/05, Matheus Eduardo Machado Moreira [EMAIL PROTECTED] wrote: I have the following key-value mappings in the .properties file (keys and values in Portuguese, I know all of you know Portuguese :-)). comando.pesquisar=Pesquisar (search) comando.editar=Editar (edit) comando.salvar=Salvar (save) comando.iniciar=iniciar (init, used as default entry point) I have a class where I put all the constants used throughout the application and this class declares a default key-method map: MapString, String defaultKeyMethodMap = new HashMapString, String(); defaultKeyMethodMap.put(comando.pesquisar, pesquisar); defaultKeyMethodMap.put(comando.editar, editar); defaultKeyMethodMap.put(comando.salvar, salvar); defaultKeyMethodMap.put(comando.iniciar, iniciar); My getKeyMethodMap() method is as below: protected Map getKeyMethodMap() { return Constants.defaultKeyMethodMap; } My action is simple. One detail, I don't define (yet) all the methods present in the key-method map because I'm constructing the action class method by method and testing each one. public class CadastroIngredienteAction extends LookupDispatchAction { public ActionForward iniciar(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { return mapping.findForward(refresh); } // other action methods here // getKeyMethodMap() as before comes here } In my .jsp file I have my buttons like this: html:form action=/pesquisaIngrediente html:submit property=acao fmt:message key=comando.pesquisar/ /html:submit /html:form Finally the action mapping in struts-config: action path=/pesquisaIngrediente type=br.com.patrulleros.manjar.action.CadastroIngredienteAction name=cadastroIngredienteFormBean scope=session parameter=acao forward name=refresh path=/WEB-INF/paginas/cadastroIngrediente/pesquisaIngrediente.jsp/ /action One more thing, I try to access the page typing the page's address directly in my browser: http://localhost:8084/pesquisaIngrediente.do?acao=comando.pesquisar. I do this way because I don't have a menu or something like this yet. Thanks, Matheus Eduardo Machado Moreira [EMAIL PROTECTED] Belo Horizonte - MG (31) 8724-8041 Sun Certified Programmer for the Java 2 Plataform 1.4 -- Valeu a pena? Tudo vale a pena Se a alma não é pequena. 2005/11/30, Wendy Smoak [EMAIL PROTECTED]: On 11/30/05, Matheus Eduardo Machado Moreira [EMAIL PROTECTED] wrote: My action extends LookupDispatchAction and implements the getKeyMethodMap() method. In my ApplicationResources.properties file I define all the keys for the buttons that can be shown in my interfaces. Everything seems to be ok but every time I try to access my pages I receive the following error: javax.servlet.ServletException: Action[/pesquisaIngrediente] missing resource 'comando.iniciar' in key method map. My guess is that you've got things backwards in getKeyMethodMap, but it's hard to tell without seeing some code. Can you post the relevant bits of getKeyMethodMap, your .properties file, and one of your buttons? -- Wendy - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
using a lookupDispatchAction to implement a WIZARD Form
Hello I try to use a lookupDispatchAction to implement a WIZARD FORM as it is wrote in the Struts cookbook and there is some things i still don't understand: Context: action path=/ViewStep1 name=CreateAccesForm scope=session validate=false type=org.apache.struts.actions.ForwardAction parameter=.portail.acces.societe/ action path=/ProcessStep1 name=CreateAccesForm scope=session validate=true type=com.studiocanal.extranetPortail.fo.acces.actions.DemAccesAction input=.portail.acces.societe parameter=method forward name=next path=/ViewStep2.do/ forward name=fail path=/ViewStep1.do/ /action I have a List of DTO in my ActionForm (CreateAccesForm) and others simple properties; i do some business in an action(ProcessStep1.do method=Verif ) to set my form properties with the values coming from the DB. When i finally return mapping.findForward(fail) which call the ViewStep1.do forwardAction to bring me back to the same jsp, my input form. So, my jsp page .portail.acces.societe only display the values of my List form properties and the others have disappear! But if i use a forward path directly to my jsp, like that : forward name=fail path=.portail.acces.societe/ I can find the real values of my form properties set in the html form. So my question is why the org.apache.struts.actions.ForwardAction resets my form simple properties according to what it find in the request, i imagine, and does not to the DTO List properties ?? Finally, what is the goal the ViewStep1 action, ViewStep2 and so on ? Thanks in advance Struts config for the wizard: !-- Wizard Creation mappings -- action path=/ViewStep1 name=CreateAccesForm scope=session validate=false type=org.apache.struts.actions.ForwardAction parameter=.portail.acces.societe/ action path=/ProcessStep1 name=CreateAccesForm scope=session validate=true type=com.studiocanal.extranetPortail.fo.acces.actions.DemAccesAction input=.portail.acces.societe parameter=method forward name=next path=/ViewStep2.do/ forward name=fail path=.portail.acces.societe/ /action !-- Step 2: Compte -- action path=/ViewStep2 name=CreateAccesForm scope=session type=org.apache.struts.actions.ForwardAction validate=false input=.portail.acces.compte parameter=.portail.acces.compte/ action path=/ProcessStep2 name=CreateAccesForm scope=session type=com.studiocanal.extranetPortail.fo.acces.actions.DemAccesAction parameter=method validate=false forward name=previous path=/ViewStep1.do/ forward name=next path=/ViewStep3.do/ /action !-- Step 3: Droits -- action path=/ViewStep3 name=CreateAccesForm scope=session type=org.apache.struts.actions.ForwardAction input=.portail.acces.droits validate=false parameter=.portail.acces.droits/ action path=/ProcessStep3 name=CreateAccesForm scope=session type=com.studiocanal.extranetPortail.fo.acces.actions.DemAccesAction parameter=method forward name=previous path=/ViewStep2.do/ forward name=finish path=/wizard_done.jsp/ /action -- Cordialement, Arnaud Gonzales.
Re: using a lookupDispatchAction to implement a WIZARD Form
On 11/8/05, arnaud gonzales [EMAIL PROTECTED] wrote: Hello I try to use a lookupDispatchAction to implement a WIZARD FORM as it is wrote in the Struts cookbook and there is some things i still don't understand: Context: action path=/ViewStep1 name=CreateAccesForm scope=session validate=false type=org.apache.struts.actions.ForwardAction parameter=.portail.acces.societe/ action path=/ProcessStep1 name=CreateAccesForm scope=session validate=true type=com.studiocanal.extranetPortail.fo.acces.actions.DemAccesAction input=.portail.acces.societe parameter=method forward name=next path=/ViewStep2.do/ forward name=fail path=/ViewStep1.do/ /action I have a List of DTO in my ActionForm (CreateAccesForm) and others simple properties; i do some business in an action(ProcessStep1.do method=Verif ) to set my form properties with the values coming from the DB. When i finally return mapping.findForward(fail) which call the ViewStep1.do forwardAction to bring me back to the same jsp, my input form. So, my jsp page .portail.acces.societe only display the values of my List form properties and the others have disappear! But if i use a forward path directly to my jsp, like that : forward name=fail path=.portail.acces.societe/ I can find the real values of my form properties set in the html form. So my question is why the org.apache.struts.actions.ForwardAction resets my form simple properties according to what it find in the request, i imagine, and does not to the DTO List properties ?? Because when request comes in, Struts populates ActionForm fields from request. When you do forward, this is the same as incoming request for Struts. And since it is an in-server forward, the request still contains old data. Why would not you try something more robust for your wizard: http://struts.sourceforge.net/strutsdialogs/wizardaction.html Here are two online demos, very similar. The first is a login/signup action/wizard: http://www.superinterface.com/wizard/signupWizard.do The second is just a signup wizard with a security question: http://www.superinterface.com/strutsdialog/wizardaction.do Notice, that for all wizard pages the address in the browser is the same, so you cannot go back to a stale page. Navigation is performed on server, browser sees only the page that corresponds to current wizard state. -- Struts Dialogs: code-behind for Struts http://struts.sourceforge.net/strutsdialogs - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: I am getting frustrated with LookupDispatchAction
On 10/19/05, Adam Hardy [EMAIL PROTECTED] wrote: Michael Jouravlev on 19/10/05 00:44, wrote: On 10/18/05, Adam Hardy [EMAIL PROTECTED] wrote: Secondly, getKeyMethodMap() looks really clunky - is there no way this can be pushed into the struts-config.xml? It can be done, but if this to be defined inside existing structures like action, then I would have to change Struts code. Another way is to define it somewhere else like component instead of action or just action-events, in this case you would need to include custom ruleset object into web.xml. The latter would be easier because Struts code would not be changed. I will think about moving map to config file, but frankly I do not consider it a priority. Why you don't like it in the class file? Because it's just a strings that go in a map. It's more easily readable in a config file and it keeps them all in one place instead of having to open each action. Obviously that only counts when you are looking at a big project, but it does make an impact. I did that, but it works only with new syntax, when you use component instead of action. Having a separate XML element to define an action mapping is easier, because it allows to mix both action and component in one config file, and it does not require changing the Struts code. All I needed is just to add a new rule set. So, how about this: !-- Home page. Handles welcome menu, main menu and language selection -- component path = /Home view = /mailreaderpages/home.jsp type = net.jspcontrols.mailreader.HomeAction !-- Input events (request keys for submit buttons) -- event name = DIALOG-EVENT-LOGON handler = onLogon/ event name = DIALOG-EVENT-SIGNUP handler = onAccountSignup/ event name = DIALOG-EVENT-ACCUPDATE handler = onAccountUpdate/ event name = DIALOG-EVENT-SUBSCRIPTIONS handler = onSubscriptions/ !-- Transfer from one action to another, usually using redirection -- transfer name = subscriptions path = /Subscriptions.do?DIALOG-EVENT-INIT/ !-- Render a view, usually by forwarding to a JSP page -- render name = failure path = /mailreaderpages/error.jsp / /component However I just thought of a better idea. Impose a rule that the name of the Action method should be prefixed by the prefix and that should be used as the name of each submit button. If the map is initialised at construction by reflection, it would make it all more intuitive and easier to code, with the added advantage that you would have one less place where the programmer would make a mistake. I'd rather not do that. First, I don't want to introduce any magic into Java code. Also, there is a better way of achieving that without magic (umm, with less magic if you want) using annotations, like Tim Fennel did in Stripes: @UrlBinding(/quickstart/Calculator.action) public class CalculatorActionBean implements ActionBean { ... @HandlesEvent(Addition) @DefaultHandler public Resolution addNumbers() { ... return new ForwardResolution(/quickstart/index.jsp); } } So, I don't want to redo what is already done by some ;-) But, Tim strives to minimize XML configuration, while your first desire was to move mapping configuration from action to XML, so I guess you would like what I have implemented ;-) Another choice would be to encode handler methods' names directly into request keys, and to process submits with something like this: http://issues.apache.org/bugzilla/attachment.cgi?id=15762 See javadoc comments for usage. I think this is something that could find its place among Struts core actions. What do you think? One more thing: you have to either define mapping in xml file, or in an action, but not in both places (internally, I check map variable for null). Is this OK or you want to refine XML mapping in Java code? Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
lookupdispatchaction and validator
hello, I'm trying to use validator with lookupdispatchaction, it will be great to generate the client JS validation. Have you any links, samples? Thanks in advance -- Regards Arnaud Gonzales.
Re: lookupdispatchaction and validator
Arnaud, Validator is independent on any actions, it can handle JS validation as well, http://66.102.7.104/search?q=cache:4urwhau-PQcJ:struts.apache.org/userGuide/dev_validator.html+struts+validatorhl=enclient=firefox-a Regards On 11/3/05, arnaud gonzales [EMAIL PROTECTED] wrote: hello, I'm trying to use validator with lookupdispatchaction, it will be great to generate the client JS validation. Have you any links, samples? Thanks in advance -- Regards Arnaud Gonzales. -- Yujun Liang [EMAIL PROTECTED]
LookupDispatchAction with html:image
I'm trying to use the LookupDispatchAction with the html:image tags so that I can have spiffy looking buttons, however I get this error: INFO: Exception thrown Request[/Foo/SaveDefaultSettings] does not contain handler parameter named 'method'. This may be caused by whitespace in the label text. What seems to be happening is that if I use a regular html:submit tag it works fine, but due to the position information that goes along with the html:image tag it's messing up the parameter submit. Is there a way around this? I've tried setting the value parameter on the html:image to be the same as the value parameter that is sumitted on an html:submit and that doesn't work :-( thanks, -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader http://www.jroller.com/page/certifieddanger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction with html:image
http://www.michaelmcgrady.com/button/jsp/dispatch_action.jsp http://issues.apache.org/bugzilla/attachment.cgi?id=15762 http://struts.sourceforge.net/strutsdialogs/selectaction.html On 10/20/05, Keith Sader [EMAIL PROTECTED] wrote: I'm trying to use the LookupDispatchAction with the html:image tags so that I can have spiffy looking buttons, however I get this error: INFO: Exception thrown Request[/Foo/SaveDefaultSettings] does not contain handler parameter named 'method'. This may be caused by whitespace in the label text. What seems to be happening is that if I use a regular html:submit tag it works fine, but due to the position information that goes along with the html:image tag it's messing up the parameter submit. Is there a way around this? I've tried setting the value parameter on the html:image to be the same as the value parameter that is sumitted on an html:submit and that doesn't work :-( - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction with html:image
After googling some more, it seems as though there's no 'elegant' way of doing what seems simple on the surface in terms of swapping two tags. I think I'm just going to wind up using the ImageButtonBean work-around. Thanks for the links! On 10/20/05, Michael Jouravlev [EMAIL PROTECTED] wrote: http://www.michaelmcgrady.com/button/jsp/dispatch_action.jsp http://issues.apache.org/bugzilla/attachment.cgi?id=15762 http://struts.sourceforge.net/strutsdialogs/selectaction.html -- Keith Sader [EMAIL PROTECTED] http://www.saderfamily.org/roller/page/ksader http://www.jroller.com/page/certifieddanger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction with html:image
On 10/20/05, Keith Sader [EMAIL PROTECTED] wrote: After googling some more, it seems as though there's no 'elegant' way of doing what seems simple on the surface in terms of swapping two tags. I think I'm just going to wind up using the ImageButtonBean work-around. Thanks for the links! Why? There is. The point is to send a command as request key, not as request value, so you could use value for button caption. Also, you need to strip .x or .y for images. That is it. See the live example: http://www.superinterface.com/strutsdialog/selectaction.html And the source HTML could not be simpler: form action=selectaction.do method=post h3Regular pushbuttons/h3 input type=submit name=app-submit-button-add value=Add button /brbr input type=submit name=app-submit-button-delete value=Delete button fancy caption /brbr input type=submit name=app-submit-button-unk value=No corresponding handler (exception) /brbr input type=submit name=no-prefix value=Does not start with prefix (unspecified) / h3Image button/h3 input type=image name=app-submit-button-login src=login.gif value=Log In /form But the choice is yours, of course :-) Have fun, Michael. -- Struts Dialogs http://struts.sourceforge.net/strutsdialogs - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: I am getting frustrated with LookupDispatchAction
Hey everyone. Thanks for the input on my problems with my LookupDispatchAction. I was able to get the wizard steps working using the example on page 201 of the book: Jakarta Struts Cookbook. Now I am off to do the business logic. Again, thanks for all the help. --Brad -Original Message- From: Simonin, Bradley K. (Brad) Sent: Mon 10/17/2005 4:18 PM To: user@struts.apache.org Subject: I am getting frustrated with LookupDispatchAction Hi. I am using struts 1.2.7. My struts-config-xml file has the following: action path=/mywizard1 name=wizardForm scope=session type=edu.nmsu.psl.userwizard.AddPSLUserWizardAction input=/step1.jsp validate=false parameter=method forward name=next path=/step2.jsp/ /action my jsp has the following: html:submit property=methodbean:message key=button.next//html:submit But I get the following error in tomcat: javax.servlet.ServletException: Request[/mywizard1] does not contain handler parameter named 'method'. Can someone save me from insanity? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: I am getting frustrated with LookupDispatchAction
Michael Jouravlev on 19/10/05 00:44, wrote: On 10/18/05, Adam Hardy [EMAIL PROTECTED] wrote: Secondly, getKeyMethodMap() looks really clunky - is there no way this can be pushed into the struts-config.xml? It can be done, but if this to be defined inside existing structures like action, then I would have to change Struts code. Another way is to define it somewhere else like component instead of action or just action-events, in this case you would need to include custom ruleset object into web.xml. The latter would be easier because Struts code would not be changed. I will think about moving map to config file, but frankly I do not consider it a priority. Why you don't like it in the class file? Because it's just a strings that go in a map. It's more easily readable in a config file and it keeps them all in one place instead of having to open each action. Obviously that only counts when you are looking at a big project, but it does make an impact. However I just thought of a better idea. Impose a rule that the name of the Action method should be prefixed by the prefix and that should be used as the name of each submit button. If the map is initialised at construction by reflection, it would make it all more intuitive and easier to code, with the added advantage that you would have one less place where the programmer would make a mistake. Adam - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: I am getting frustrated with LookupDispatchAction
On 10/17/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi. I am using struts 1.2.7. My struts-config-xml file has the following: action path=/mywizard1 name=wizardForm scope=session type=edu.nmsu.psl.userwizard.AddPSLUserWizardAction input=/step1.jsp validate=false parameter=method forward name=next path=/step2.jsp/ /action my jsp has the following: html:submit property=methodbean:message key=button.next//html:submit But I get the following error in tomcat: javax.servlet.ServletException: Request[/mywizard1] does not contain handler parameter named 'method'. Can someone save me from insanity? Try this instead: http://struts.sourceforge.net/strutsdialogs/selectaction.html You do not have to use Struts tags with it, just HTML. Works with buttons, links and images. Consider it an improved LookupDispatchAction. The library also allows you to build a robust wizard component. -- Struts Dialogs http://struts.sourceforge.net/strutsdialogs - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: I am getting frustrated with LookupDispatchAction
Michael Without a doubt this is the most intuitive page I have ever seen I take it the lack of support for orphaned 'parameter' action attribute is overcome with inserting map events to method handlers via HashMap such as this example protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(getInitKey()+-ADD, add); map.put(getInitKey()+-DELETE, delete); map.put(getInitKey()+-CREATE, create); map.put(getInitKey()+-LOGIN, login); return map; } //where methods are coded as // Handler of Add button public ActionForward add(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { System.out.println(-- add); return mapping.findForward(addpage); } Very insightful.. Martin- - Original Message - From: Michael Jouravlev [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, October 18, 2005 12:09 PM Subject: Re: I am getting frustrated with LookupDispatchAction On 10/17/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi. I am using struts 1.2.7. My struts-config-xml file has the following: action path=/mywizard1 name=wizardForm scope=session type=edu.nmsu.psl.userwizard.AddPSLUserWizardAction input=/step1.jsp validate=false parameter=method forward name=next path=/step2.jsp/ /action my jsp has the following: html:submit property=methodbean:message key=button.next//html:submit But I get the following error in tomcat: javax.servlet.ServletException: Request[/mywizard1] does not contain handler parameter named 'method'. Can someone save me from insanity? Try this instead: http://struts.sourceforge.net/strutsdialogs/selectaction.html You do not have to use Struts tags with it, just HTML. Works with buttons, links and images. Consider it an improved LookupDispatchAction. The library also allows you to build a robust wizard component. -- Struts Dialogs http://struts.sourceforge.net/strutsdialogs - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: I am getting frustrated with LookupDispatchAction
This action class is inspired by LookupDispatchAction, but it does not use property file and does not tie button caption to property name. Actually, it supports parameter to be compatible with original DispatchAction. On the other hand, if you think that hashmap brings an unnecessary overhead, then sticking method name directly into request key is simpler. No hashmaps, and clickable images are elegantly supported, but one can spot handler method name right from the browser, and rearrange the names names. If you don't care for visible method names, you can check out my version based on idea of parsing dotted request key: http://issues.apache.org/bugzilla/attachment.cgi?id=15762 I first saw this parsing style on McGrady's website and borowed it from there. I am not pretending that this particuar idea is mine. The class from the link above has some comments here and there, and tries not to duplicate DispatchAction code. I think that this solution is compact and clean and could be a very good alternative/replacement to current DispatchAction, but I don't want to argue anymore on who stole from whom and why others can or cannot use it or why it cannot be included into Struts core. I needed a good dispatch action for my event-based library, I guess what I have now is good enough and allows to write well-structured code. Also, I get a level of indirection which hides actual method names from a user, so I will stick to what I have. Michael. On 10/18/05, Martin Gainty [EMAIL PROTECTED] wrote: Michael Without a doubt this is the most intuitive page I have ever seen I take it the lack of support for orphaned 'parameter' action attribute is overcome with inserting map events to method handlers via HashMap such as this example protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(getInitKey()+-ADD, add); map.put(getInitKey()+-DELETE, delete); map.put(getInitKey()+-CREATE, create); map.put(getInitKey()+-LOGIN, login); return map; } //where methods are coded as // Handler of Add button public ActionForward add(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { System.out.println(-- add); return mapping.findForward(addpage); } Very insightful.. Martin- - Original Message - From: Michael Jouravlev [EMAIL PROTECTED] To: Struts Users Mailing List user@struts.apache.org Sent: Tuesday, October 18, 2005 12:09 PM Subject: Re: I am getting frustrated with LookupDispatchAction On 10/17/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi. I am using struts 1.2.7. My struts-config-xml file has the following: action path=/mywizard1 name=wizardForm scope=session type=edu.nmsu.psl.userwizard.AddPSLUserWizardAction input=/step1.jsp validate=false parameter=method forward name=next path=/step2.jsp/ /action my jsp has the following: html:submit property=methodbean:message key=button.next//html:submit But I get the following error in tomcat: javax.servlet.ServletException: Request[/mywizard1] does not contain handler parameter named 'method'. Can someone save me from insanity? Try this instead: http://struts.sourceforge.net/strutsdialogs/selectaction.html You do not have to use Struts tags with it, just HTML. Works with buttons, links and images. Consider it an improved LookupDispatchAction. The library also allows you to build a robust wizard component. -- Struts Dialogs http://struts.sourceforge.net/strutsdialogs - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: I am getting frustrated with LookupDispatchAction
Michael, I like your code alot but a couple of things prevent me from purloining it for my own purposes: firstly, I like to allocate my base class to sort out user, locale, msgKeys, and messages objects for use in the subclass. It doesn't seem to be possible to sandwich a subclass in-between SelectAction and the child class to do this, isn't that so? Secondly, getKeyMethodMap() looks really clunky - is there no way this can be pushed into the struts-config.xml? Adam Michael Jouravlev on 18/10/05 23:30, wrote: This action class is inspired by LookupDispatchAction, but it does not use property file and does not tie button caption to property name. Actually, it supports parameter to be compatible with original DispatchAction. On the other hand, if you think that hashmap brings an unnecessary overhead, then sticking method name directly into request key is simpler. No hashmaps, and clickable images are elegantly supported, but one can spot handler method name right from the browser, and rearrange the names names. If you don't care for visible method names, you can check out my version based on idea of parsing dotted request key: http://issues.apache.org/bugzilla/attachment.cgi?id=15762 I first saw this parsing style on McGrady's website and borowed it from there. I am not pretending that this particuar idea is mine. The class from the link above has some comments here and there, and tries not to duplicate DispatchAction code. I think that this solution is compact and clean and could be a very good alternative/replacement to current DispatchAction, but I don't want to argue anymore on who stole from whom and why others can or cannot use it or why it cannot be included into Struts core. I needed a good dispatch action for my event-based library, I guess what I have now is good enough and allows to write well-structured code. Also, I get a level of indirection which hides actual method names from a user, so I will stick to what I have. Michael. On 10/18/05, Martin Gainty [EMAIL PROTECTED] wrote: Michael Without a doubt this is the most intuitive page I have ever seen I take it the lack of support for orphaned 'parameter' action attribute is overcome with inserting map events to method handlers via HashMap such as this example protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(getInitKey()+-ADD, add); map.put(getInitKey()+-DELETE, delete); map.put(getInitKey()+-CREATE, create); map.put(getInitKey()+-LOGIN, login); return map; } //where methods are coded as // Handler of Add button public ActionForward add(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { System.out.println(-- add); return mapping.findForward(addpage); } Very insightful.. Martin- - Original Message - From: Michael Jouravlev [EMAIL PROTECTED] On 10/17/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi. I am using struts 1.2.7. My struts-config-xml file has the following: action path=/mywizard1 name=wizardForm scope=session type=edu.nmsu.psl.userwizard.AddPSLUserWizardAction input=/step1.jsp validate=false parameter=method forward name=next path=/step2.jsp/ /action my jsp has the following: html:submit property=methodbean:message key=button.next//html:submit But I get the following error in tomcat: javax.servlet.ServletException: Request[/mywizard1] does not contain handler parameter named 'method'. Can someone save me from insanity? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: I am getting frustrated with LookupDispatchAction
On 10/18/05, Adam Hardy [EMAIL PROTECTED] wrote: Michael, I like your code alot but a couple of things prevent me from purloining it for my own purposes: firstly, I like to allocate my base class to sort out user, locale, msgKeys, and messages objects for use in the subclass. It doesn't seem to be possible to sandwich a subclass in-between SelectAction and the child class to do this, isn't that so? I guess I have to make an utility class out of it, so it could be called from any Action.execute(). I will do that. Secondly, getKeyMethodMap() looks really clunky - is there no way this can be pushed into the struts-config.xml? It can be done, but if this to be defined inside existing structures like action, then I would have to change Struts code. Another way is to define it somewhere else like component instead of action or just action-events, in this case you would need to include custom ruleset object into web.xml. The latter would be easier because Struts code would not be changed. I will think about moving map to config file, but frankly I do not consider it a priority. Why you don't like it in the class file? What benefit do you expect from moving it to config file? YOu want to be able to remap handlers? BTW, you can purloin ;) from another link that I posted, that version does not use map at all and is _very_ compact. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
I am getting frustrated with LookupDispatchAction
Hi. I am using struts 1.2.7. My struts-config-xml file has the following: action path=/mywizard1 name=wizardForm scope=session type=edu.nmsu.psl.userwizard.AddPSLUserWizardAction input=/step1.jsp validate=false parameter=method forward name=next path=/step2.jsp/ /action my jsp has the following: html:submit property=methodbean:message key=button.next//html:submit But I get the following error in tomcat: javax.servlet.ServletException: Request[/mywizard1] does not contain handler parameter named 'method'. Can someone save me from insanity? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: I am getting frustrated with LookupDispatchAction
Can someone save me from insanity? Questionable... But I get the following error in tomcat: javax.servlet.ServletException: Request[/mywizard1] does not contain handler parameter named 'method'. Do you have a method named 'method'? It should look like the typical Struts execute method. Paul __ Yahoo! Mail - PC Magazine Editors' Choice 2005 http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: I am getting frustrated with LookupDispatchAction
I guess you don't have a property for button.next defined in your MessageResources. Please make sure you have defined that property in the resources. On 10/17/05, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi. I am using struts 1.2.7. My struts-config-xml file has the following: action path=/mywizard1 name=wizardForm scope=session type=edu.nmsu.psl.userwizard.AddPSLUserWizardAction input=/step1.jsp validate=false parameter=method forward name=next path=/step2.jsp/ /action my jsp has the following: html:submit property=methodbean:message key=button.next //html:submit But I get the following error in tomcat: javax.servlet.ServletException: Request[/mywizard1] does not contain handler parameter named 'method'. Can someone save me from insanity? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: I am getting frustrated with LookupDispatchAction
I have not seen parameter as an attribute of action path= it is better to break the parameter away from action tag something like set-property property=method value=method/ Anyone else??? M- - Original Message - From: [EMAIL PROTECTED] To: user@struts.apache.org Sent: Monday, October 17, 2005 6:18 PM Subject: I am getting frustrated with LookupDispatchAction Hi. I am using struts 1.2.7. My struts-config-xml file has the following: action path=/mywizard1 name=wizardForm scope=session type=edu.nmsu.psl.userwizard.AddPSLUserWizardAction input=/step1.jsp validate=false parameter=method forward name=next path=/step2.jsp/ /action my jsp has the following: html:submit property=methodbean:message key=button.next//html:submit But I get the following error in tomcat: javax.servlet.ServletException: Request[/mywizard1] does not contain handler parameter named 'method'. Can someone save me from insanity? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: I am getting frustrated with LookupDispatchAction
From: [EMAIL PROTECTED] my jsp has the following: html:submit property=methodbean:message key=button.next//html:submit But I get the following error in tomcat: javax.servlet.ServletException: Request[/mywizard1] does not contain handler parameter named 'method'. Can someone save me from insanity? No, but you can save yourself. :) First, what HTML is that JSP snippet generating? For some reason, the request that was submitted did not include a request parameter named 'method'. Either the HTML isn't correct, or maybe that button wasn't actually clicked. (Is there JavaScript involved? Did you press enter in a text field instead of clicking the button?) -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: I am getting frustrated with LookupDispatchAction
Did you implement the getKeyMethodMap() method in the subclass of LookupDispatchAction. Sunil [EMAIL PROTECTED] 10/18/2005 03:48 AM Please respond to Struts Users Mailing List user@struts.apache.org To user@struts.apache.org cc Subject I am getting frustrated with LookupDispatchAction Hi. I am using struts 1.2.7. My struts-config-xml file has the following: action path=/mywizard1 name=wizardForm scope=session type=edu.nmsu.psl.userwizard.AddPSLUserWizardAction input=/step1.jsp validate=false parameter=method forward name=next path=/step2.jsp/ /action my jsp has the following: html:submit property=methodbean:message key=button.next//html:submit But I get the following error in tomcat: javax.servlet.ServletException: Request[/mywizard1] does not contain handler parameter named 'method'. Can someone save me from insanity? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: I am getting frustrated with LookupDispatchAction
Have you extended LookUpDipatchAction your ddPSLUserWizardAction ?? Notice: The information contained in this e-mail message and/or attachments to it may contain confidential or privileged information. If you are not the intended recipient, any dissemination, use, review, distribution, printing or copying of the information contained in this e-mail message and/or attachments to it are strictly prohibited. If you have received this communication in error, please notify us by reply e-mail or telephone and immediately and permanently delete the message and any attachments. Thank you
Re: I am getting frustrated with LookupDispatchAction
Those are two different things. 'parameter' is a standard attribute of the 'action' element, which many of the standard action classes expect (and can access via getParameter()). The 'set-property' element is a means of passing arbitrary additional parameters to an action. The two aren't interchangeable. L. Martin Gainty wrote: I have not seen parameter as an attribute of action path= it is better to break the parameter away from action tag something like set-property property=method value=method/ Anyone else??? M- - Original Message - From: [EMAIL PROTECTED] To: user@struts.apache.org Sent: Monday, October 17, 2005 6:18 PM Subject: I am getting frustrated with LookupDispatchAction Hi. I am using struts 1.2.7. My struts-config-xml file has the following: action path=/mywizard1 name=wizardForm scope=session type=edu.nmsu.psl.userwizard.AddPSLUserWizardAction input=/step1.jsp validate=false parameter=method forward name=next path=/step2.jsp/ /action my jsp has the following: html:submit property=methodbean:message key=button.next//html:submit But I get the following error in tomcat: javax.servlet.ServletException: Request[/mywizard1] does not contain handler parameter named 'method'. Can someone save me from insanity? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
AW: LookupDispatchAction-problem getting started
Thank you, the spaces work. Volker -Ursprüngliche Nachricht- Von: Wendy Smoak [SMTP:[EMAIL PROTECTED] Gesendet am: Montag, 22. August 2005 14:43 An: Struts Users Mailing List Betreff: Re: LookupDispatchAction-problem getting started From: Tiller, Volker [EMAIL PROTECTED] I can't get started with the example about using LookupDispatchAction of Ted Husted, Tip #3 (http://husted.com/struts/tips/index.html). What is my error or can I get some working code ? forward name=testit path=/test.do?method=button.add/ The 'method' parameter should be set to the _value_ from ApplicationResources.properties (not the key). I'm not sure how to encode the spaces to do this manually, maybe method=add+it+all or method=add%20it%20all. Or maybe the spaces will just work. (It's early...) Here's what happens: - the framework sees add it all as the value of the 'method' parameter - it figures out that 'add it all' came from the 'button.add' property - looks up 'button.add' in the keyMethodMap and finds 'add' - calls the 'add' method in your Action (Naming the parameter something other than 'method' may make things clearer-- maybe 'choice'.) HTH, -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
LookupDispatchAction-problem getting started
Hi all, I can't get started with the example about using LookupDispatchAction of Ted Husted, Tip #3 (http://husted.com/struts/tips/index.html). What is my error or can I get some working code ? This is the problem: The forward html:link forward=testit styleClass=menuitemtest it/html:link gets ERROR DispatchAction:220 - Request[/test] does not contain handler parameter named 'method'. This may be caused by whitespace in the label text. Altering the global forward 'testit' to forward name=testit path=/test.do?method=button.add/ gets javax.servlet.ServletException: Action[/test] missing resource 'button.add' in key method map org.apache.struts.actions.LookupDispatchAction.getLookupMapName(LookupDispatchAction.java:240) org.apache.struts.actions.LookupDispatchAction.getMethodName(LookupDispatchAction.java:281) org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.java:158) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194) org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) javax.servlet.http.HttpServlet.service(HttpServlet.java:689) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) + This is the code +++Action public final class MyAction extends LookupDispatchAction { private static Log log = LogFactory.getLog(MyAction.class); protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(button.add, add); map.put(button.delete, delete); return map; } public ActionForward add(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // do add log.info(--- in add()); return mapping.findForward(success); } public ActionForward delete(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // do delete log.info(--- in delete()); return mapping.findForward(success); } } +++Form: public final class MyForm extends ActionForm { private String prop; public String getProp() { return prop; } public void setProp(String prop) { this.prop = prop; } } +++JSP: /tiles/test.jsp %@ page language=java contentType=text/html; charset=ISO-8859-1 pageEncoding=ISO-8859-1% %@ include file=taglibs.jsp% !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1 titletest LookupDispatchAction.../title /head body html:form action=/test html:submit property=method bean:message key=button.add/ /html:submit html:submit property=method bean:message key=button.delete/ /html:submit /html:form /body /html +++application.properties: button.add=add it all button.delete=delete it all +++struts-config global-forwards forward name=welcome path=/Welcome.do/ forward name=testit path=/test.do/ /global-forwards form-bean name=MyForm type=lau.layers.actions.forms.MyForm/ action-mappings action path=/test type=lau.layers.actions.MyAction name=MyForm scope=request input=/tiles/test.jsp parameter=method forward name=success path=/Welcome.do/forward /action /action-mappings ++ Thanks, Volker. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction-problem getting started
From: Tiller, Volker [EMAIL PROTECTED] I can't get started with the example about using LookupDispatchAction of Ted Husted, Tip #3 (http://husted.com/struts/tips/index.html). What is my error or can I get some working code ? forward name=testit path=/test.do?method=button.add/ The 'method' parameter should be set to the _value_ from ApplicationResources.properties (not the key). I'm not sure how to encode the spaces to do this manually, maybe method=add+it+all or method=add%20it%20all. Or maybe the spaces will just work. (It's early...) Here's what happens: - the framework sees add it all as the value of the 'method' parameter - it figures out that 'add it all' came from the 'button.add' property - looks up 'button.add' in the keyMethodMap and finds 'add' - calls the 'add' method in your Action (Naming the parameter something other than 'method' may make things clearer-- maybe 'choice'.) HTH, -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
LookupDispatchAction, trying Ted Husted Tip #3
Trying the example in http://husted.com/struts/tips/index.html #3 Use LookupDispatchAction ... I use following Action, Form, JSP, application.properties and struts-config +++Action public final class MyAction extends LookupDispatchAction { private static Log log = LogFactory.getLog(MyAction.class); protected Map getKeyMethodMap() { Map map = new HashMap(); map.put(button.add, add); map.put(button.delete, delete); return map; } public ActionForward add(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // do add log.info(--- in add()); return mapping.findForward(success); } public ActionForward delete(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { // do delete log.info(--- in delete()); return mapping.findForward(success); } } +++Form: public final class MyForm extends ActionForm { private String prop; public String getProp() { return prop; } public void setProp(String prop) { this.prop = prop; } } +++JSP: /tiles/test.jsp %@ page language=java contentType=text/html; charset=ISO-8859-1 pageEncoding=ISO-8859-1% %@ include file=taglibs.jsp% !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head meta http-equiv=Content-Type content=text/html; charset=ISO-8859-1 titletest LookupDispatchAction.../title /head body html:form action=/test html:submit property=method bean:message key=button.add/ /html:submit html:submit property=method bean:message key=button.delete/ /html:submit /html:form /body /html +++application.properties: button.add=add it all button.delete=delete it all +++struts-config global-forwards forward name=welcome path=/Welcome.do/ forward name=testit path=/test.do/ /global-forwards form-bean name=MyForm type=lau.layers.actions.forms.MyForm/ action-mappings action path=/test type=lau.layers.actions.MyAction name=MyForm scope=request input=/tiles/test.jsp parameter=method forward name=success path=/Welcome.do/forward /action /action-mappings The forward html:link forward=testit styleClass=menuitemtest it/html:link gets ERROR DispatchAction:220 - Request[/test] does not contain handler parameter named 'method'. This may be caused by whitespace in the label text. Altering the global forward 'testit' to forward name=testit path=/test.do?method=button.add/ gets javax.servlet.ServletException: Action[/test] missing resource 'button.add' in key method map org.apache.struts.actions.LookupDispatchAction.getLookupMapName(LookupDispatchAction.java:240) org.apache.struts.actions.LookupDispatchAction.getMethodName(LookupDispatchAction.java:281) org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.java:158) org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194) org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) javax.servlet.http.HttpServlet.service(HttpServlet.java:689) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) What have I missunderstood about LookupDispatchAction ? Many thanks for a hint! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
LookupDispatchAction or DispatchAction?
Hi, I've tested both types of actions but I really cannot say which action is better and I don't have the slightest feeling when which action to take. Can you give me a clue? Thanks Christian 6X velocizzare la tua navigazione a 56k? 6X Web Accelerator di Libero! Scaricalo su INTERNET GRATIS 6X http://www.libero.it - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction or DispatchAction?
starki78 wrote the following on 7/25/2005 2:04 AM: Hi, I've tested both types of actions but I really cannot say which action is better and I don't have the slightest feeling when which action to take. Without trying to open up a whole other can of worms since there have been a bunch of recent threads concerning the dispatch/lookup concept, I would stay away from the LookupDispatchAction. There are other variants out there MappingDispatchAction, SimpleDispatchAction, and now SelectAction. Personally, I've just stuck with DispatchAction and like it. The other new flavors mentioned have some merit, but since you asked about LookupDispatchAction I'll reiterate again why I hate it... 1) Figuring out what method gets called when you press a button is way too annoying. You have to define a map in your Action class which represents the names of the buttons, but if you use your ApplicationResources file to have the names display on you page, you know have to do this translation to figure out what gets called... you need to look in the app resources file and then look in the map and find that key represented by the value in app resources and then you can see the method being called. 2) It makes it difficult for your button to do perform more than one type of action. For example, maybe you have a generic button used on a from that can be used for a couple different actions methods. If you call it submit it's only going to what 'submit' equates to in the Lookup map in your Action. If you use a Dispatch Action you can have your button do more than one type of action method since it's not keyed off the button name. 3) There are issues when you have more than one submit button on a page and the user presses enter on their keyboard. I forgot the exact problems but it was a real pain. In IE it acts one way, in other browsers a different way. I just remember cases where the button name being passed wasn't what was expected. I wrote that above quickly, so it might not make sense, but save yourself some headaches and just use the DispatchAction (unless you want to look at some of the variants out there other than LookupDispatchAction... I was just lazy and dispatch works for me:) -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction or DispatchAction?
On 7/25/05, Rick Reumann [EMAIL PROTECTED] wrote: starki78 wrote the following on 7/25/2005 2:04 AM: Hi, I've tested both types of actions but I really cannot say which action is better and I don't have the slightest feeling when which action to take. Without trying to open up a whole other can of worms since there have been a bunch of recent threads concerning the dispatch/lookup concept, I would stay away from the LookupDispatchAction. There are other variants out there MappingDispatchAction, SimpleDispatchAction, and now SelectAction. Personally, I've just stuck with DispatchAction and like it. The other new flavors mentioned have some merit, but since you asked about LookupDispatchAction I'll reiterate again why I hate it... 1) Figuring out what method gets called when you press a button is way too annoying. You have to define a map in your Action class which represents the names of the buttons, but if you use your ApplicationResources file to have the names display on you page, you know have to do this translation to figure out what gets called... you need to look in the app resources file and then look in the map and find that key represented by the value in app resources and then you can see the method being called. Having the map right in an action file is easier, faster and does not tie you to a property file, does it? 2) It makes it difficult for your button to do perform more than one type of action. For example, maybe you have a generic button used on a from that can be used for a couple different actions methods. If you call it submit it's only going to what 'submit' equates to in the Lookup map in your Action. If you use a Dispatch Action you can have your button do more than one type of action method since it's not keyed off the button name. I don't see how it is different. In the end of the day it is just a request parameter, and you can do whatever you want with it. DispatchAction uses method=methodName to obtain method name. LookupDispatchAction uses a map, but you still can change the request parameter. Also, indirection gives you some sort of protection, because users do not know about actual method names, and they cannot call any public method of action class on their choice. I think having an indirect call is a little more robust. 3) There are issues when you have more than one submit button on a page and the user presses enter on their keyboard. I forgot the exact problems but it was a real pain. In IE it acts one way, in other browsers a different way. I just remember cases where the button name being passed wasn't what was expected. I was testing default submit yesterday. I have two sample apps, both use form, text field and some buttons. Firefox always submits the first button, defined in the form. IE submits the first button in one case, and does not submit any buttons in other case. I don't know why. Therefore I decided to use a hidden field which contains default event in case no buttons are submitted. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction or DispatchAction?
On Mon, July 25, 2005 1:11 pm, Michael Jouravlev said: Having the map right in an action file is easier, faster and does not tie you to a property file, does it? Just wanted to stick my proboscis in on this particular point (I've been following along this whole discussion by the way)... I view this sort of thing as configuration information, not unlike struts-config. As such, it should I believe, be externalized. So for me, I'd rather have something like this in a property file. In the world of high availability web apps, you don't want to take the app down to change a map in a class when you could, in theory at least, change a config file and reload it on-the-fly, no deployment issues, no downtime, etc. Where I work it takes a minimum of 48 hours to get a prod elevation done unless it's an emergency, and then it require about 10 signatures from senior management... if I had to tell them I needed to change an entry in a map in an Action, they'd kill me for having to take the app down for something like that. Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction or DispatchAction?
On 7/25/05, Frank W. Zammetti [EMAIL PROTECTED] wrote: On Mon, July 25, 2005 1:11 pm, Michael Jouravlev said: Having the map right in an action file is easier, faster and does not tie you to a property file, does it? Just wanted to stick my proboscis in on this particular point (I've been following along this whole discussion by the way)... I view this sort of thing as configuration information, not unlike struts-config. As such, it should I believe, be externalized. So for me, I'd rather have something like this in a property file. In the world of high availability web apps, you don't want to take the app down to change a map in a class when you could, in theory at least, change a config file and reload it on-the-fly, no deployment issues, no downtime, etc. Where I work it takes a minimum of 48 hours to get a prod elevation done unless it's an emergency, and then it require about 10 signatures from senior management... if I had to tell them I needed to change an entry in a map in an Action, they'd kill me for having to take the app down for something like that. Well, I am not sure that Struts can pick up changes in property file, though I saw some Reloadable properties subproject in Struts Applications tree. On the other hand, I think that tying a button textual caption to a method name like LookupDispatchAction does, is a not right thing to do. You cannot change the caption at the runtime. I mean, you can, but then you have to change a property file as well, and to reload properties. Having a map correlating request key to method name instead of correlating a button value to method name allows to change button caption at any time without the need to reload the properties. Separating events, handlers and captions seems logical for me. I got used to this when I was programming for Windows. Windows resources just have an ID, and anyone interested can catch a message from control with that ID. Button captions are not relevant at all, one can even change them right in compiled exe file. One more note. I am not sure that all config info should be externalized. It is much easier to have an action and a corresponding HTML/JSP page(s), than to tie them in a config file. That is, I prefer Action-page relationship as 1:M, not as M:1 or M:M. Maybe externalising such relationships works better for you, if you have M:1 relationship. I am trying to imagine such a use case, and with using dispatching action, I cannot think of one. Anyway, there are as many opinions as there are people ;) Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction or DispatchAction?
On Mon, July 25, 2005 1:55 pm, Michael Jouravlev said: Well, I am not sure that Struts can pick up changes in property file, though I saw some Reloadable properties subproject in Struts Applications tree. You can always force the issue... not a good idea, but it can be done. You are correct in general though, it's not something that you can do out-of-the-box. On the other hand, I think that tying a button textual caption to a method name like LookupDispatchAction does, is a not right thing to do. I agree. Separating events, handlers and captions seems logical for me. I got used to this when I was programming for Windows. Windows resources just have an ID, and anyone interested can catch a message from control with that ID. Button captions are not relevant at all, one can even change them right in compiled exe file. Again, I agree. These things should be separated as much as possible. All I was saying is that I perfer what binds them to not require me changing code, and a map in a class still counts, even if it's not all that extreme :) One more note. I am not sure that all config info should be externalized. It is much easier to have an action and a corresponding HTML/JSP page(s), than to tie them in a config file. That is, I prefer Action-page relationship as 1:M, not as M:1 or M:M. Maybe externalising such relationships works better for you, if you have M:1 relationship. I am trying to imagine such a use case, and with using dispatching action, I cannot think of one. I actually do not use any form of DispatchAction most of the time... very rarely will I use anything along those lines. I find it to break the idea of separating responsibilities. I prefer to see a well-named Action for each actual action that can be invoked from a page. Whatever the relationship is, I prefer this. I have some Actions that aren't tied to a particular page at all, some that are very much page-specific, etc. Even when they are only a few lines of code and bloat is not an issue if they are all in the same class, I find it better architecturally for them to be separate. Many people feel differently of course, but that's my perspective on it. Anyway, there are as many opinions as there are people ;) Absolutely :) Michael. Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction or DispatchAction?
On 7/25/05, Frank W. Zammetti [EMAIL PROTECTED] wrote: I actually do not use any form of DispatchAction most of the time... very rarely will I use anything along those lines. I find it to break the idea of separating responsibilities. I prefer to see a well-named Action for each actual action that can be invoked from a page. Whatever the relationship is, I prefer this. I have some Actions that aren't tied to a particular page at all, some that are very much page-specific, etc. Even when they are only a few lines of code and bloat is not an issue if they are all in the same class, I find it better architecturally for them to be separate. Many people feel differently of course, but that's my perspective on it. DispatchAction allows you to have one mapping for a related set of operations. Therefore, you can call different operations for one object using the same web address, which is impossible using separate actions unless you use filter or something like mod_rewrite. Having same address is important to prevent browser history from growing, thus effectively disabling Back button. This makes application more robust and user experience closer to desktop application. You just might have not thought about that. Or, conversely, you stronlgly believe that each page change must be recorded in browser history, even if it is a series of login attempts, just because browsers are supposed to do so ;) Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction or DispatchAction?
On Mon, July 25, 2005 2:32 pm, Michael Jouravlev said: DispatchAction allows you to have one mapping for a related set of operations. Therefore, you can call different operations for one object using the same web address, which is impossible using separate actions unless you use filter or something like mod_rewrite. I understand that, always have. Even if I didn't you've been telling us all this for weeks, so I'd certainly understand it now :) Having same address is important to prevent browser history from growing, thus effectively disabling Back button. This makes application more robust and user experience closer to desktop application. In my experience, there are two distinct expectations a client can have... one is that the application be very much like a desktop app, the other is that it be very much like a web app. People DO, amazingly, understand the fundamental difference. In the former case, I have always solved the problem by having the app exist in its own chromeless window. I provide full navigation capabilities within the app, and the users understand that if they try and defeat this by using keyboard shortcuts or extra mouse buttons or the like, the app is not guaranteed to not break. THIS is in fact closer to a desktop app, and if that's the goal I suggest this rather than some sort of hybrid approach. In the the later case, users will absolutely expect the history to work as it always does, and an app that defeats that is seen as broken. You just might have not thought about that. Or, conversely, you stronlgly believe that each page change must be recorded in browser history, even if it is a series of login attempts, just because browsers are supposed to do so ;) I have thought of it, like I said. As for what I believe, it doesn't matter... it's what the CLIENT believes. I can guide them and direct them, but ultimately they write the requirements. I've been fortunate to be involved in analysis and design from inception in most of my projects, so I can make sure they are getting things right. That's not always the case. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction or DispatchAction?
On 7/25/05, Frank W. Zammetti [EMAIL PROTECTED] wrote: Having same address is important to prevent browser history from growing, thus effectively disabling Back button. This makes application more robust and user experience closer to desktop application. In my experience, there are two distinct expectations a client can have... one is that the application be very much like a desktop app, the other is that it be very much like a web app. People DO, amazingly, understand the fundamental difference. In the former case, I have always solved the problem by having the app exist in its own chromeless window. I provide full navigation capabilities within the app, and the users understand that if they try and defeat this by using keyboard shortcuts or extra mouse buttons or the like, the app is not guaranteed to not break. THIS is in fact closer to a desktop app, and if that's the goal I suggest this rather than some sort of hybrid approach. In the the later case, users will absolutely expect the history to work as it always does, and an app that defeats that is seen as broken. Ok, I will use the same use case I used during last weeks :) a login form. Say, you have a welcome page on a website, which directs a user to a login page. How many pages do you have? I hope your answer is two. So we have two pages and we can return from a login page to welcome page using Back, and then to go again to login page using Forward. I think it is logical, that we need to click Back *only once* to return from login page to welcome page. Now a user tries to login. He makes several attempts, say five. It did not work, and a login page is redisplayed with error (is not this the same login page, logically?) The user wants to return to welcome page. How many times is he supposed to click Back button? In most applications, six times. Why? because browser recorded each login attempt as a separate resource location. Therefore, a user actually *expects* to click Back only once to return back, because login page is a second page. Instead, he is *forced* to click six times. Do you really think that clicking Back six times is logical and expected by a user? I do not thik so. Having one address for login page, and redirecting to it after submitting the data, we ensure (for most browsers) that browser history contains only one entry of our logical page. Which is exactly what a user expects. I have thought of it, like I said. As for what I believe, it doesn't matter... it's what the CLIENT believes. I can guide them and direct them, but ultimately they write the requirements. I've been fortunate to be involved in analysis and design from inception in most of my projects, so I can make sure they are getting things right. That's not always the case. Right, clients don't know the details of tecnhology. We as developers should offer them the best we can do (in reasonable time, of course). On the other hand, do your clients really care about what happens when a user clicks Refresh button? I would say, they ask for certain pages to be bookmarkable. And oh, make it in blue, not in yellow ;) Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction or DispatchAction?
On Mon, July 25, 2005 3:11 pm, Michael Jouravlev said: Ok, I will use the same use case I used during last weeks :) a login form. Say, you have a welcome page on a website, which directs a user to a login page. How many pages do you have? I hope your answer is two. I would have said one... why would I force a user to click a button to GET to the logon page in the first place? Why isn't the logon page and welcome page the same thing? This is the case in my apps. Therefore, when a logon failure occurs, they are on the logon/welcome page, with a message telling them about the failure, and they can try again. If we're talking user friendliness and expectations, THIS is how it should be IMO. So we have two pages and we can return from a login page to welcome page using Back, and then to go again to login page using Forward. I think it is logical, that we need to click Back *only once* to return from login page to welcome page. And I would agree, if we really want to persue a fundamentally flawed site design :) Now a user tries to login. He makes several attempts, say five. Should have been locked out at 3, but I digress... ;) It did not work, and a login page is redisplayed with error (is not this the same login page, logically?) The user wants to return to welcome page. Why? They are already where they need to be. If they really want to go back, let'em hit back 6 times :) How many times is he supposed to click Back button? In most applications, six times. Why? because browser recorded each login attempt as a separate resource location. Therefore, a user actually *expects* to click Back only once to return back, because login page is a second page. Instead, he is *forced* to click six times. Do you really think that clicking Back six times is logical and expected by a user? I do not thik so. Agreed. But again, what was the original expectation by the client? Is this a web app? Then guess what? That's the way it works. Deal with it. If they wanted something more fat-client-like, then I would address the fundamentally bad design first. Having one address for login page, and redirecting to it after submitting the data, we ensure (for most browsers) that browser history contains only one entry of our logical page. Which is exactly what a user expects. It's that for most browsers part that bugs me... If you code to standards, in theory at least, things work across all browsers (of a reasonable vintage anyway)... even if we agree that its better to not have the 6 browser history items, why should I put something in place to defeat it that isn't even entirely cross-browser? That seems to me to be exacerbating an already bad situation. Right, clients don't know the details of tecnhology. We as developers should offer them the best we can do (in reasonable time, of course). On the other hand, do your clients really care about what happens when a user clicks Refresh button? I would say, they ask for certain pages to be bookmarkable. And oh, make it in blue, not in yellow ;) Perhaps... but are they going to be happy when you tell them it might not work in browser A and B but is OK in C and D? Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction or DispatchAction?
On 7/25/05, Frank W. Zammetti [EMAIL PROTECTED] wrote: On Mon, July 25, 2005 3:11 pm, Michael Jouravlev said: Ok, I will use the same use case I used during last weeks :) a login form. Say, you have a welcome page on a website, which directs a user to a login page. How many pages do you have? I hope your answer is two. I would have said one... why would I force a user to click a button to GET to the logon page in the first place? Why isn't the logon page and welcome page the same thing? This is the case in my apps. Therefore, when a logon failure occurs, they are on the logon/welcome page, with a message telling them about the failure, and they can try again. Oh gosh, Frank, can you think more abstractively (is this a proper adjective?) It does not really matter, why login page follows welcome page, this is merely an *example*. Ok, consider that welcome page *is* a login page, but a user came from another site and after unsuccessful login attempt wants to return back to the previous site. Better? It did not work, and a login page is redisplayed with error (is not this the same login page, logically?) The user wants to return to welcome page. Why? They are already where they need to be. If they really want to go back, let'em hit back 6 times :) Why??? They want to return from login page to whatever previous page. I see only two pages here, why should they hit back 6 times??? But again, what was the original expectation by the client? Is this a web app? Then guess what? That's the way it works. Deal with it. They expect a webapp, which navigates from page one to page two. Therefore, it should be possible to navigate from page two to page one in one click. Is not this logical? *That* is the way it should work. Instead, users have to deal with raw implementation of HTTP POST. They don't care about HTTP, they just want to go back from page two to page one. Having one address for login page, and redirecting to it after submitting the data, we ensure (for most browsers) that browser history contains only one entry of our logical page. Which is exactly what a user expects. It's that for most browsers part that bugs me... If you code to standards, in theory at least, things work across all browsers (of a reasonable vintage anyway)... even if we agree that its better to not have the 6 browser history items, why should I put something in place to defeat it that isn't even entirely cross-browser? That seems to me to be exacerbating an already bad situation. Actually, vintage browsers work great. It is the Opera which is a black sheep. Umm... should HD television be broadcasted? It is used by what? 1%, 3% of subscribers. Those who do not use it, get the same show with lower quality, that is it. Conversely to HD TV, Opera is used by only about 2% of users, and most of them use Opera specifically because it caches every page. These users like exactly this behavior and *they* expect that. So it is OK for them if they had to click Back six times. Normal... hm... users expect just to return from page two to page one. If they use browser other than Opera, they get exactly what should happen, return from page two to page one. If they use the application on Opera, they have to click back six times, just like in most other applications, but application does not break because of this. Hell, fill it up with 89 instead of Sunoco 94, it will still be driveable, not that fast though :) Right, clients don't know the details of tecnhology. We as developers should offer them the best we can do (in reasonable time, of course). On the other hand, do your clients really care about what happens when a user clicks Refresh button? I would say, they ask for certain pages to be bookmarkable. And oh, make it in blue, not in yellow ;) Perhaps... but are they going to be happy when you tell them it might not work in browser A and B but is OK in C and D? What it? Application works either way, only on non-Opera browsers it works nicer, that is it. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction or DispatchAction?
On Mon, July 25, 2005 3:38 pm, Michael Jouravlev said: Oh gosh, Frank, can you think more abstractively (is this a proper adjective?) It does not really matter, why login page follows welcome page, this is merely an *example*. Ok, consider that welcome page *is* a login page, but a user came from another site and after unsuccessful login attempt wants to return back to the previous site. Better? Abstractly is the correct term, but that's not important :) I don't care if the user can get to their previous site with one back click from my site. Not my problem. How they navigate MY site is all I'm paid to care about. Why??? They want to return from login page to whatever previous page. I see only two pages here, why should they hit back 6 times??? You know, we've really gotten away from what was originally being discussed here... we were talking about DispatchActions, and now we're talking about redirect-after-post. How did that happen? They expect a webapp, which navigates from page one to page two. Therefore, it should be possible to navigate from page two to page one in one click. Is not this logical? *That* is the way it should work. Instead, users have to deal with raw implementation of HTTP POST. They don't care about HTTP, they just want to go back from page two to page one. I agree, but my point is that you are achieving this by defeating the fundamental nature of the browser, whether that fundamental nature is good or bad (and I would tend to agree with you that it is bad). People tend to perceive things that don't work as expected as being broken, even if what they expected wasn't good to begin with. Actually, vintage browsers work great. It is the Opera which is a black sheep. Umm... should HD television be broadcasted? It is used by what? 1%, 3% of subscribers. Those who do not use it, get the same show with lower quality, that is it. Conversely to HD TV, Opera is used by only about 2% of users, and most of them use Opera specifically because it caches every page. These users like exactly this behavior and *they* expect that. So it is OK for them if they had to click Back six times. Unless there is an alternative that solves the problem for all, and there is, as I described earlier. I'm not saying it's a BETTER solution, because it has shortcomings too, but in this one regard I think it might be better. Normal... hm... users expect just to return from page two to page one. If they use browser other than Opera, they get exactly what should happen, return from page two to page one. If they use the application on Opera, they have to click back six times, just like in most other applications, but application does not break because of this. Hell, fill it up with 89 instead of Sunoco 94, it will still be driveable, not that fast though :) Until it starts knocking and makes my car seem to be broken. :) But, I'd still like to know how we got to here from a discussion of DispatchActions? :) Frank - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction or DispatchAction?
On 7/25/05, Frank W. Zammetti [EMAIL PROTECTED] wrote: You know, we've really gotten away from what was originally being discussed here... we were talking about DispatchActions, and now we're talking about redirect-after-post. How did that happen? Because these are related things. Because two-phase component is easier to build with DispatchAction. You said that you did not see the use for DispatchAction and I offered you an example. But you are right, I have steered too far away. Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Validation while using LookupDispatchAction
My action class extends LookupDispatchAction, which has different methods in it. In struts-config.xml i have parameter method as we all know. My problem is; in my validation.xml i do have to perform different validations for different methods, how do I distinguish or find out which method is called to perform validation for that method only? struts-config.xml form-bean name=myForm type=org.apache.struts.validator.DynaValidatorActionForm form-property name=freeText type=java.lang.String/ /form-bean action path=/myAction type=com.action.MyAction name=myForm validate=true parameter=method forward.. /action validation.xml form-validation formset form name=/myaction.do field property=freeText depends=required arg0 key=myForm.freeText.name/ /field /form /formset /form-validation in above code in validaton.xml i need to pass method name for which i want this validation to take place not for all methods. Something like form name=/myAction.do?method=methodName how do I do this? or any other way. I would appreciate prompt response with examples. Thanks in advance, __ Yahoo! Mail Mobile Take Yahoo! Mail with you! Check email on your mobile phone. http://mobile.yahoo.com/learn/mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation while using LookupDispatchAction
From: Vicky [EMAIL PROTECTED] My action class extends LookupDispatchAction, which has different methods in it. In struts-config.xml i have parameter method as we all know. My problem is; in my validation.xml i do have to perform different validations for different methods, how do I distinguish or find out which method is called to perform validation for that method only? Because you're using DynaValidator_Action_Form, the framework will match up the action 'path' attribute from struts-config.xml with the form 'name' attribute from validation.xml. I do it by having different URL patterns mapped to the same LookupDispatchAction using the same DynaValidatorActionForm. In the action tag, only the 'path' and 'input' differ (so 'getInputForward()' works, no matter which path you came in with, you go to the right form-- it's a four-step wizard.) action path=/denRegister type=edu.example.RegisterAction name=registerForm ... input=den.register.step1 .../action action path=/denRegister3 type=edu.example.RegisterAction name=registerForm ... input=den.register.step3 .../action Then in validation.xml, you use the path for the form name (which is slightly confusing...): form name=/denRegister ... /form form name=/denRegister3... /form And then you can have different fields validated for different paths, even though it's the same Action and the same Form. All my forms are POSTed, so I wouldn't have had ?parameter=someText in any case. HTH, -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validation while using LookupDispatchAction
I would probably use ValidWhen field property=freeText depends=validwhen arg0 key=myForm.freeText.name/ var var-nametest/var-name var-value( (method!= validateMe) or (*this* != null) )/var-value /var /field Thanks and Regards, Nitish Kumar -Original Message- From: Vicky [mailto:[EMAIL PROTECTED] Sent: Thursday, June 23, 2005 7:55 PM To: Struts Users Mailing List Subject: Validation while using LookupDispatchAction My action class extends LookupDispatchAction, which has different methods in it. In struts-config.xml i have parameter method as we all know. My problem is; in my validation.xml i do have to perform different validations for different methods, how do I distinguish or find out which method is called to perform validation for that method only? struts-config.xml form-bean name=myForm type=org.apache.struts.validator.DynaValidatorActionForm form-property name=freeText type=java.lang.String/ /form-bean action path=/myAction type=com.action.MyAction name=myForm validate=true parameter=method forward.. /action validation.xml form-validation formset form name=/myaction.do field property=freeText depends=required arg0 key=myForm.freeText.name/ /field /form /formset /form-validation in above code in validaton.xml i need to pass method name for which i want this validation to take place not for all methods. Something like form name=/myAction.do?method=methodName how do I do this? or any other way. I would appreciate prompt response with examples. Thanks in advance, __ Yahoo! Mail Mobile Take Yahoo! Mail with you! Check email on your mobile phone. http://mobile.yahoo.com/learn/mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Validation while using LookupDispatchAction
Wendy, But having different actions in struts-config. how would I call them in my jsp html:form ? because right now I have only one action in jsp html:form action=myAction and then for each button i have property=method.. in jsp in struts-config for this action mapping I have parameter=method Did I miss anything in here? Thanks, --- Wendy Smoak [EMAIL PROTECTED] wrote: From: Vicky [EMAIL PROTECTED] My action class extends LookupDispatchAction, which has different methods in it. In struts-config.xml i have parameter method as we all know. My problem is; in my validation.xml i do have to perform different validations for different methods, how do I distinguish or find out which method is called to perform validation for that method only? Because you're using DynaValidator_Action_Form, the framework will match up the action 'path' attribute from struts-config.xml with the form 'name' attribute from validation.xml. I do it by having different URL patterns mapped to the same LookupDispatchAction using the same DynaValidatorActionForm. In the action tag, only the 'path' and 'input' differ (so 'getInputForward()' works, no matter which path you came in with, you go to the right form-- it's a four-step wizard.) action path=/denRegister type=edu.example.RegisterAction name=registerForm ... input=den.register.step1 .../action action path=/denRegister3 type=edu.example.RegisterAction name=registerForm ... input=den.register.step3 .../action Then in validation.xml, you use the path for the form name (which is slightly confusing...): form name=/denRegister ... /form form name=/denRegister3... /form And then you can have different fields validated for different paths, even though it's the same Action and the same Form. All my forms are POSTed, so I wouldn't have had ?parameter=someText in any case. HTH, -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Yahoo! Sports Rekindle the Rivalries. Sign up for Fantasy Football http://football.fantasysports.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Validation while using LookupDispatchAction
Your sure did: C#.NET makes stuff like this soo easy! Struts is dead. ~mark -Original Message- From: Vicky [mailto:[EMAIL PROTECTED] Sent: Thursday, June 23, 2005 2:48 PM But having different actions in struts-config. how would I call them in my jsp html:form ? because right now I have only one action in jsp html:form action=myAction and then for each button i have property=method.. in jsp in struts-config for this action mapping I have parameter=method Did I miss anything in here? This email and any file transmitted with it may be confidential and is intended solely for the use of the individual or entity to whom it is addressed. If you received this email in error please notify the DBM Service Desk by forwarding this message to [EMAIL PROTECTED] This email has been scanned by networkMaryland Antivirus Service for the presence of computer viruses. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]