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: 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.
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: 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 : > > >key="button.refuser" /> > > > My ApplicationResources.properties > > button.valider=valider > button.refuser=refuser > > > My struts-config.xml > > parameter="monaction" path="/creationuser" scope="request" > type="dsit.user.action.creationUserAction" validate="true"> name="affichageUser" path="/affichageUser.jsp"/> > > > 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
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.
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 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+validator&hl=en&client=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]
RE: lookupdispatchaction and validator
Hi. arnaud. I hope I understand your question. Each jsp pages for the lookupdispatchaction should have a page element added: Then in your validation.xml file have: name="wizardForm"> the action mappings should look something like this: I hope this helps. --Brad -Original Message- From: arnaud gonzales [mailto:[EMAIL PROTECTED] Sent: Wed 11/2/2005 6:36 AM To: user@struts.apache.org Subject: 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. - 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: Regular pushbuttons Image button 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: 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
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-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 ? 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]
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]
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: > 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: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: > > 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 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: > 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 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: > 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: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, 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?
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
When you have you get a whatever.x and whatever.y returned as request parameters with x and y intergers showing the coordinates of the button press on the client. The simplest code you can have solving the problem is the ones at www.michaelmcgrady.com and mentioned by Jouravlev recently. I have got a kick out of him having the solution, supposedly on his own, without understanding the problem at all. This is another interesting and humorous instance of that amazing phenomenon. LOL If you provide a know value for whatever, such as "create" or "delete" in a CRUD applications, then you can run the request parameters through a loop and get the value of the image clicked without paying any attention to the value of the parameter. Note that the value attribute does not give you the value of the parameter attribute but can be used for other purposes. Good luck On 6/14/05, Michael Jouravlev <[EMAIL PROTECTED]> wrote: > > You need to specify method name in "value" attribute. Since it is an > > image, it won't be shown: > > > > > value="myProcName" src="myimage.gif" /> > > > > The above should produce request like this: > > method.x=51&method.y=16&method=myProcName > > Hmm... Seems like MSIE do not add "method=myProcName" for > value="myProcName" for image tag. Strange. Maybe I need another HTTP > sniffer... > > 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~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction
Actually the images I use *do* scale automagically. It all depends upon how sophisticated you are in this sort of thing. On 6/14/05, Michael Jouravlev <[EMAIL PROTECTED]> wrote: > On 6/14/05, Wendy Smoak <[EMAIL PROTECTED]> wrote: > > If you just want images on the buttons, you can do it with CSS and keep the > > (which you already have working): > > http://www.ampsoft.net/webdesign-l/image-button.html > > Neat! But images do not scale automatically, I prefer not to use them. > With images scaled form looks weird. > > - > 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~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction
From: "Rafael Taboada" <[EMAIL PROTECTED]> > I tried to use css like Wendy said but alt option is missing. Missing from what? There is an 'alt' attribute for the tag. Are you trying to get 'hover text' on your submit button? I think that's the 'title' attribute. If you already have working, I would stick with that... as you've noted, clickable images as submit buttons are a bit of a pain. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction
Yep, MSIE is a sucky one. For the following image button: Firefox generates the following: method.x=48&method.y=20&method=add while MSIE generates just the following: method.x=48&method.y=20 Hmm, how to obtain method name on MSIE? I don't know yet. But obviously I need to update my DialogAction to remove stinking ".x" and ".y". See, Jack, I did not know about this image thing. But I know know ;-) Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction
> You need to specify method name in "value" attribute. Since it is an > image, it won't be shown: > > value="myProcName" src="myimage.gif" /> > > The above should produce request like this: > method.x=51&method.y=16&method=myProcName Hmm... Seems like MSIE do not add "method=myProcName" for value="myProcName" for image tag. Strange. Maybe I need another HTTP sniffer... Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction
Rafael, first of all, as web developer you should always know what input your application receives. If you use Firefox, go to their plugin site and get LiveHTTPHeaders plugin, an invaluable thing. After you install it, you will be able to trace requests and responses. To save you time, I can tell you that when you click your image, browser sends to server something like this: method.x=51&method.y=16 DispatchAction and LookupDispatchAction expects a "method" parameter, not a "method.x" or "method.y". Also, you need somehow to signal which method do you want to call. You need to specify method name in "value" attribute. Since it is an image, it won't be shown: The above should produce request like this: method.x=51&method.y=16&method=myProcName I hope it works with DispatchAction, but I have not tested it. I think that you do not need LookupDispatchAction for this. Also check Dakota Jack's page: www.michaelmcgrady.com/button Michael. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction
From: "Rafael Taboada" <[EMAIL PROTECTED]> > altKey="ComprasNuevo.imagen.agregararticulo" > border="0" property="method" src="../images/Nuevo.png" /> > > javax.servlet.ServletException: Request[/ComprasNuevo] does not contain > handler parameter named 'method'. Did you look at the request parameters that ARE there? I bet you'll find two parameters: 'method.x' and 'method.y'. The browser is trying to tell you _where_ on the image the user clicked. Check the list archives for ways to deal with this, some people have posted alternate DispatchAction implementations that can handle images. Or maybe one of them has made it into Struts by now... I'm not sure. -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction
I think there are problems with property.x and property.y Do u know about it? How to solve it? -- Rafael Taboada Software Engineer Cell : +511-97753290 "No creo en el destino pues no me gusta tener la idea de controlar mi vida"
Re: LookupDispatchAction
Please. Any suggestions? Do u know about "ImageButtonDispatchAction.java in the archives of 'struts-user '"??? Where can I find it??? -- Rafael Taboada Software Engineer Cell : +511-97753290 "No creo en el destino pues no me gusta tener la idea de controlar mi vida"
Re: LookupDispatchAction
Well my code is like this. In my jsp: In my Action class I extend LookupDispatchAction. Methods: protected Map getKeyMethodMap() { Map map = new HashMap(); map.put("ComprasNuevo.boton.preagregarArticulo", "preagregarArticulo"); map.put("ComprasNuevo.boton.registrar", "agregarArticulo"); return map; } So, when I click on the button. The preagregarArticulo method will be called. As I said, all work fine. But I want to use html:image instead html:submit. Like this: But there is an error: javax.servlet.ServletException: Request[/ComprasNuevo] does not contain handler parameter named 'method'. This may be caused by whitespace in the label text. org.apache.struts.actions.DispatchAction.unspecified(DispatchAction.java :224) org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java :258) org.apache.struts.actions.LookupDispatchAction.execute( LookupDispatchAction.java:162) org.apache.struts.action.RequestProcessor.processActionPerform( RequestProcessor.java:421) org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226) org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164) org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415) javax.servlet.http.HttpServlet.service(HttpServlet.java:709) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter( MonitorFilter.java:362) My ActionMapping: How can I use html:image like html:button?? Maybe property="method" in html:image is called incorrectly??? I tried to use css like Wendy said but alt option is missing. -- Rafael Taboada Software Engineer Cell : +511-97753290 "No creo en el destino pues no me gusta tener la idea de controlar mi vida"
Re: LookupDispatchAction
On 6/14/05, Wendy Smoak <[EMAIL PROTECTED]> wrote: > If you just want images on the buttons, you can do it with CSS and keep the > (which you already have working): > http://www.ampsoft.net/webdesign-l/image-button.html Neat! But images do not scale automatically, I prefer not to use them. With images scaled form looks weird. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction
Hi, create a hidden value that has name of the property of your LookupDispatchAction which is defined in your struts-config.xml . Then set the necessary value to the property when image is clicked. All you need is to send a parameter(property in your struts-config.xml ) with necessary value. hope I could explain well.. On Tue, 2005-06-14 at 09:09 -0500, Rafael Taboada wrote: > Hi folks. I'm using LookupDispatchAction in order to manage several > buttons > in a form. > All work fine, but I want to use html:image instead of html:submit > Please, do u know how to use that? I don't understand its attributes > very > well. > Thanks in advance >
Re: LookupDispatchAction
Cool... Thanks so much =) -- Rafael Taboada Software Engineer Cell : +511-97753290 "No creo en el destino pues no me gusta tener la idea de controlar mi vida"
Re: LookupDispatchAction
From: "Rafael Taboada" <[EMAIL PROTECTED]> > Hi folks. I'm using LookupDispatchAction in order to manage > several buttons in a form. > All work fine, but I want to use html:image instead of html:submit > Please, do u know how to use that? I don't understand its attributes very > well. If you just want images on the buttons, you can do it with CSS and keep the (which you already have working): http://www.ampsoft.net/webdesign-l/image-button.html Here is the list of attributes for : http://struts.apache.org/userGuide/struts-html.html#image What do you need help with? Are you possibly running into the issue where the browser sends buttonName.x and buttonName.y parameters instead of a single parameter? -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction
Dakota Jack worked with image buttons: www.michaelmcgrady.com/button Maybe you find this useful. On 6/14/05, Rafael Taboada <[EMAIL PROTECTED]> wrote: > Hi folks. I'm using LookupDispatchAction in order to manage several buttons > in a form. > All work fine, but I want to use html:image instead of html:submit > Please, do u know how to use that? I don't understand its attributes very > well. > Thanks in advance > > -- > Rafael Taboada > Software Engineer > > Cell : +511-97753290 > > "No creo en el destino pues no me gusta tener la idea de controlar mi vida" > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction - missing resource in key method map
OkayI figured out what I was doing wrong, so I'm going to post this FYI out there just in case someone else makes the same mistake I did. In my form, I had a hidden field with the same name as the parameter (e.g. methodToCall) defined in my action. After my initialization action forwarded to the page, the hidden field was set with the parameter value I was passing in (e.g. methodToCall=addMemory). When I clicked on the add button (button.respondent.add.memory), the "addMemory" value was passed to the LookupDispatchAction as the key to find the method to call instead of "button.respondent.add.memory". Hope this explanation makes sense. I figured it out once I downloaded the code and stepped through the code debug mode. Randy Kennedy wrote: I've banged my head on this problem for at least 4-5 hours, and I'm at my wits end. I've already reviewed several possible solutions, but it appears that I have everything in order for using the LookupDispatchAction class. Here's the message that I receive: --- 10:17:29,172 ERROR [Engine] StandardWrapperValve[action]: Servlet.service() for servlet action threw exception javax.servlet.ServletException: Action[/postRespondentFormAction] missing resource 'addMemory' in key method map --- Here is the excerpt from Application.resources: --- button.respondent.add.memory = continue to protective order --- Here is the excerpt from struts-config.xml: --- --- My RespondentFormAction class extends the LookupDispatchAction class and has the addMemory method: --- public ActionForward addMemory(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { ... } --- I also populate the map as such: --- protected Map getKeyMethodMap() { Map map = new HashMap(); map.put("button.pp.add", "add"); map.put("button.respondent.add.memory", "addMemory"); return map; } --- Funny thing is is that I have other LookupDispatchActions working correctly in other places. I don't know what I'm overlooking and doing differently with this one. Any suggestions? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction (Bug?)
How are you setting the value of "dispatch" in your page? A hidden field? Is it hard-coded or do you set it when the button is clicked. Is there more than one form in the page such that Enter might be submitting a different form than you expect? You might need some javascript to ensure that the Enter event is handled by the form you want. K.C. P.S. If that doesn't help, post your JSP source and we'll figure it out. Tim Christopher wrote: Hi, I have the following code within a jsp: When the user clicks on the 'Update' button it goes off and updates the record as you would expect. The problem I'm having is that every time the user presses the 'enter key' to submit the form it results in an error: Request[/secure/admin/programmeAction] does not contain handler parameter named 'dispatch'. This may be caused by whitespace in the label text. In an attempt to try and figure out where it was going wrong I created an 'unspecified' method within the LookupDispatchAction file and printed out the value of the dispatch parameter. I have noticed that every time the user submits the form by clicking on the 'update button' it runs perfectly, but if the user presses the 'enter key' to submit the form it calls the unspecified method and prints null (as the value for the dispatch parameter). Does anyone know how I can fix this? Any help would be much appreciated. Tim Christopher - 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: LookupDispatchAction (Bug?)
Tim Christopher wrote the following on 3/15/2005 1:46 PM: I have the following code within a jsp: When the user clicks on the 'Update' button it goes off and updates the record as you would expect. The problem I'm having is that every time the user presses the 'enter key' to submit the form it results in an error: Request[/secure/admin/programmeAction] does not contain handler parameter named 'dispatch'. This may be caused by whitespace in the label text. First off are you sure that's your only submit button on the form? If you have more than one button, I believe enter will use the first one it comes to. Assuming that the update button is the only button, I vaguely remembering running into an issue like this once before. The way I ended up fixing this is I now like to use Javascript to set my dispatch property. By default I have a default one set up on the page: (You could even make this a form bean property if you want and have it set up in your action so it could be more dynamic: assuming you have a dispatch property in your form bean and set it to a default value somewhere) Then if you have other buttons on the page that need to change the dispatch value I just use javascript: (Above would be more clean if you use a resuable javascript method to set the dispatch property) -- Rick - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: LookupDispatchAction : Cancel Button : html:cancel
Hi Toll, Your observation is correct. If you use LookupDispatchAction for creating your own action class, and if you specify validate="true" in your struts-config.xml then Struts will always validate the input regardless which method in your action class is invoked. One of the solution is to set validate="true" in the struts-config.xml and ask Struts to perform or bypass the validation in your corresponding execute methods in the action class. Like: errors = form.validate(mapping, request); if (!errors.isEmpty()) { saveMessages(request, errors); return new ActionForward(mapping.getInput()); } I hope this will help you. Moreover, try to avoid LookupDispatchAction because of the performance issues in it because it creates a reverse map to lookup the method to execute. Rather try to use the plain DispatchAction. It is just a suggestion from my own experience. Regards Sujan Sujan Deb [EMAIL PROTECTED] 20 Dundas Street W, 6th Floor Toronto, ON, Canada 416-861-5242 2-5242 -Original Message- From: Toll, Marvin (M.) [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 25, 2005 11:01 AM To: user@struts.apache.org Subject: LookupDispatchAction : Cancel Button : html:cancel It appears that extending LookupDispatchAction does *not* cause validation to be bypassed when the following tag is used in a JSP: Two Questions 1) Are we incorrect in our observation? 2) Does anyone have a better solution than the attached? // Message for cancel button. public static final String CANCEL_BUTTON_RESOURCE = "common.button.cancel"; public static final String BACK_BUTTON_RESOURCE = "common.button.back"; // LookupDispatchAction parameter name. public static final String LOOKUP_DISPATCH_ACTION_PARAMETER = "method"; /** * This method is overridden to support page * submission without validating in three specific contexts * when the action class extends LookupDispatchAction. * (1) A drop-down list box submitted via JavaScript * whose selection is used to trigger initialization of other attributes. * (2) A cancel button was used for submission. (3) A back button was * used for submission. * * @param request The servlet request we are processing * @param response The servlet response we are creating * @param form The ActionForm instance we are populating * @param mapping The ActionMapping we are using * * @exception IOException if an input/output error occurs * @exception ServletException if a servlet exception occurs */ protected boolean processValidate( HttpServletRequest request, HttpServletResponse response, ActionForm form, ActionMapping mapping) throws IOException, ServletException { String METHOD_NAME = "processValidate"; log.entering(CLASS_NAME, METHOD_NAME); // Declaration. boolean valid; // Determine if LookupDispatchAction is being extended for this request. if (mapping.getParameter() != null && mapping.getParameter().equals( Constants.LOOKUP_DISPATCH_ACTION_PARAMETER)) { // Obtain the message resource bundle. MessageResources messageResources = this.getResources(request); // Determine if a value has not been established in the request object. if (request .getParameter(Constants.LOOKUP_DISPATCH_ACTION_PARAMETER) == null) { // Initialize the method name to be supported in a LookupDispatchAction. String[] methodName = { Constants.METHOD_RETURN_TO_PAGE }; // Establish the default - supportable as a base class method. request.getParameterMap().put( Constants.LOOKUP_DISPATCH_ACTION_PARAMETER, methodName); // Return without validating. valid = true; // Determine if the cancel or back button was selected. } else if ( request.getParameter( Constants.LOOKUP_DISPATCH_ACTION_PARAMETER).equals( messageResources.getMessage( Constants.CANCEL_BUTTON_RESOURCE)) || request.getParameter( Constants.LOOKUP_DISPATCH_ACTION_PARAMETER).equals( messageResources.getMessage( Constants.BACK_BUTTON_RESOURCE))) { // Return without validating. valid = true; } else { // Process validations. valid = super.processValidate(request, response, form, mapping); } } else { // Process validations. valid = super.processValidate(request, response, form, mapping); } log.exiting(CLASS_NAME, METHOD_NAME); return valid; }
Re: LookupDispatchAction Help
You can do the same thing WITHOUT the parameter values in the struts-config.xml and the following code: New if you what the method to be "new(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) and you use the following class (with logging changes) instead of LookupDispatchAction: public abstract class StateBaseAction extends Action { private static final String DISPATCH_METHOD_SUFFIX = ".method"; private static final String EXECUTE= "execute"; private static final String PERFORM= "perform"; private static final String DISPATCH_RECURSIVE = "dispatch.recursive"; private static final String DISPATCH_METHOD= "dispatch.method"; protectedHashMap methods= new HashMap(); protectedClass [] types = { ActionMapping.class, ActionForm.class, HttpServletRequest.class, HttpServletResponse.class }; public abstract ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException, NoSuchMethodException; protected void saveMessages(HttpServletRequest request, ActionMessages errors) { if ((errors == null) || errors.isEmpty()) { request.removeAttribute(Globals.ERROR_KEY); return; } request.setAttribute(Globals.ERROR_KEY, errors); } public String getMessage(HttpServletRequest request, String key) throws IOException, ServletException { HttpSession session = request.getSession(); Locale locale = (Locale)session.getAttribute(Globals.LOCALE_KEY); MessageResources messages = this.getResources(request); return messages.getMessage(locale,key); } protected ActionForward method(Action action, ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { Class clazz = action.getClass(); String methodName = getMethodName(request,mapping); if (EXECUTE.equals(methodName) || PERFORM.equals(methodName)){ MessageResources messages = MessageResources.getMessageResources ("org.apache.struts.actions.LocalStrings"); String message = messages.getMessage(DISPATCH_RECURSIVE, mapping.getPath()); throw new ServletException(message); } Method method = null; try { method = getMethod(clazz,methodName); } catch(NoSuchMethodException nsme) { MessageResources messages = MessageResources.getMessageResources ("org.apache.struts.actions.LocalStrings"); String message = messages.getMessage(DISPATCH_METHOD, mapping.getPath(), methodName); throw nsme; } ActionForward forward = null; try { Object args[] = { mapping, form, request, response }; forward = (ActionForward)method.invoke(action, args); } catch(ClassCastException cce) { StdOut.log(SiteConstant.ERROR_LOG,"StateBaseAction error 108 = " + cce.getMessage()); } catch(IllegalAccessException iae) { StdOut.log(SiteConstant.ERROR_LOG,"StateBaseAction errorn 110 = " + iae.getMessage()); } catch(InvocationTargetException ite) { Throwable t = ite.getTargetException(); if (t instanceof Exception) { StdOut.log(SiteConstant.ERROR_LOG,"StateBaseAction error 115 = " + ((Exception)t).getMessage()); } else { StdOut.log(SiteConstant.ERROR_LOG,"StateBaseAction error 117 = " + ite.getMessage()); } } return forward; } private static String getMethodName(HttpServletRequest request, ActionMapping mapping) { String methodName = null; String buttonValue = null; String paramProperty = mapping.getParameter(); if((paramProperty != null)) { int index = paramProperty.indexOf('.'); if(index > -1) { methodName = paramProperty.substring(0,index); } else { return methodName = paramProperty; } } Enumeration enum = request.getParameterNames(); while(enum.hasMoreElements()) { buttonValue = (String)enum.nextElement(); if(buttonValue.indexOf(DISPATCH_METHOD_SUFFIX) >= 0) { methodName = buttonValue; break; } } if(methodName == null) { return null; } return methodName.substring(0,methodName.indexOf('.')); } private Method getMethod(
Re: LookupDispatchAction Help
On Fri, 14 Jan 2005 18:01:25 -0200, Flávio Maldonado <[EMAIL PROTECTED]> wrote: > Hello... > > When I use this tags above, the Button works well, but the Link doesn't > work. > > > key="button.new"/> > New Try the following code below <% String message = org.apache.struts.taglib.TagUtils.getInstance().message(pageContext, org.apache.struts.Globals.MESSAGES_KEY, org.apache.struts.Globals.LOCALE_KEY, "button.new"); pageContext.setAttribute("message", message); %> New With a LookupDispatchAction you should send the value for a key in the ApplicationResources.properties file and not the key as a request parameter > > > At the first moment, both are putting the "button.new" into the action > variable. > When I press the button, works well. But I need that the link do the same > function of the button but I receive this error message when I try click on > the link: > > java.lang.NullPointerException >java.lang.Class.searchMethods(Class.java:1877) >java.lang.Class.getMethod0(Class.java:1901) >java.lang.Class.getMethod(Class.java:984) > > org.apache.struts.actions.DispatchAction.getMethod(DispatchAction.java:332) > > org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:264) > > org.apache.struts.actions.LookupDispatchAction.execute(LookupDispatchAction.java:234) > > org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:465) > > org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274) >org.apache.struts.action.ActionServlet.process(ActionServlet.java:1422) >org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:505) >javax.servlet.http.HttpServlet.service(HttpServlet.java:743) >javax.servlet.http.HttpServlet.service(HttpServlet.java:856) > > I extend my Action from LookupDispatchAction, and I implement this method... > >protected Map getKeyMethodMap() { >Map map = new HashMap(); >map.put("button.new", "newUser"); >return map; >} > > With this mapping, I hope that the method above be executed... > > public ActionForward newUser(ActionMapping mapping, ActionForm form, > HttpServletRequest request, HttpServletResponse response){ > return mapping.getInputForward(); > } > > but it's not happening... > > Some body can Help-me? > > I'm sorry for my bad english... ;) > > Thanks... > > Flávio Vilasboas Maldonado > Diretor de Desenvolvimento > SedNet Soluções em TI > (35)3471-9381 > > - > 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: LookupDispatchAction Help
From: "Flávio Maldonado" <[EMAIL PROTECTED]> > New > LDA follows the parameter value back to the property name, and uses the property name to pick a method. So instead of 'button.new' here, you need whatever text mapped to in the [usually] ApplicationResources.properties file. Maybe... button.new=Add New User There's supposed to be a way to add a parameter to the link, but I could not puzzle out which attributes of should be used together to make it happen. I'd have to play with it and see what works. http://struts.apache.org/userGuide/struts-html.html#link -- Wendy Smoak - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction issue
Since this is at issue, I would suggest that you not use LookupDispatchAction at all. It is clever but too convoluted. There are better solutions. See http://www.michaelmcgrady.com/button/ and http://www.michaelmcgrady.com/button/jsp/button_talk.jsp . As always, I recommend DispatchUtil in the options presented. Jack On Fri, 10 Dec 2004 16:14:47 +0100, Vadim Petrenko <[EMAIL PROTECTED]> wrote: > I would suggest not doing it like that, define a hidden property instead, > otherwise one day when you decide to debug your page and add method="get" to > the form tag (attribute, not parameter) you'd be surprised that it doesn't > work. > > > > > Also with this construction you can quite elegantly add an onclick event to > your submit buttons which would set value of "method" to the value related > to the clicked button. > > > > > -Original Message- > From: andy wix [mailto:[EMAIL PROTECTED] > Sent: Friday, December 10, 2004 2:56 PM > To: [EMAIL PROTECTED] > Subject: RE: LookupDispatchAction issue > > Hi, > > This is now fixed. It was because I didn't have a 'default' method > specified in the form tag. I.e., > > > > Regards, > andy > > _ > It's fast, it's easy and it's free. Get MSN Messenger today! > http://www.msn.co.uk/messenger > > - > 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] > > -- "You can't wake a person who is pretending to be asleep." ~Native Proverb~ "Each man is good in His sight. It is not necessary for eagles to be crows." ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: LookupDispatchAction issue
I would suggest not doing it like that, define a hidden property instead, otherwise one day when you decide to debug your page and add method="get" to the form tag (attribute, not parameter) you'd be surprised that it doesn't work. Also with this construction you can quite elegantly add an onclick event to your submit buttons which would set value of "method" to the value related to the clicked button. -Original Message- From: andy wix [mailto:[EMAIL PROTECTED] Sent: Friday, December 10, 2004 2:56 PM To: [EMAIL PROTECTED] Subject: RE: LookupDispatchAction issue Hi, This is now fixed. It was because I didn't have a 'default' method specified in the form tag. I.e., Regards, andy _ It's fast, it's easy and it's free. Get MSN Messenger today! http://www.msn.co.uk/messenger - 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: LookupDispatchAction issue
Hi, This is now fixed. It was because I didn't have a 'default' method specified in the form tag. I.e., Regards, andy _ It's fast, it's easy and it's free. Get MSN Messenger today! http://www.msn.co.uk/messenger - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction doesn't lookup mapping
What he is putting on the page and what is in his application resources properties cannot determine, ever, what keyMethodMap is returning. These are wrong avenues IF Alexander is accurate when he says the class is seeking the method "weiter". That can ONLY be the case if the keyMethodMap holds the value "weiter" under the key being called. If a method is being returned at all, everything else is working the way it should. Did you change "weiter" to "forward" and forget to recompile? Jack On Wed, 8 Dec 2004 09:13:34 -0700, Jim Barrows <[EMAIL PROTECTED]> wrote: > > > > > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, December 08, 2004 8:03 AM > > To: [EMAIL PROTECTED] > > Subject: RE: LookupDispatchAction doesn't lookup mapping > > > > > > Hi > > > > You write that : The LookupDispatchAction tries to call a method named > > "weiter" instead > > of "forward", while it calls the "back"-method as expected. > > > > As far as I remember "weiter" is the German word for "forward" - There > > might be a locale issue here. > > That would be possible if he was getting the english version instead of the > german version he's apparently putting on the page. > > > > > Hermod > > > > > > > > -Original Message- > > From: Alexander Czernay [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, December 08, 2004 2:14 PM > > To: Struts Users Mailing List > > Subject: Re: LookupDispatchAction doesn't lookup mapping > > > > > > Dakota Jack wrote: > > > My experience is that the computer is always right, so I > > would look in > > > my properites file, if I were you, and see whether or not I had > > > reversed the myButtonForward=go to go=myButtonForward. Did you? I > > > feel compelled to reiterate that LookupDispatchAction is a > > fairly poor > > > example of the code needed to do this stuff, in my opinion. > > > > > > Jack > > > > > > > > > > I will definitely try your suggestion out, but before that, I > > wanted to > > figure out, what I had done wrong using the LookupDispatchAction. > > > > So now some direct copy & paste from my code. > > My ApplicationRessurces.properties looks like this: > > > > authors-form.button.forward = weiter > > authors-form.button.back = zurück > > > > > > The jsp: > > > > > property="submit"> > key="authors-form.button.back"/> > > > property="submit"> > key="authors-form.button.forward"/> > > > > > > And finally the Action-Map: > > > > protected Map getKeyMethodMap() { > > Map map = new HashMap(); > > map.put("authors-form.button.create", > > "create"); > > map.put("authors-form.button.edit", "edit"); > > map.put("authors-form.button.remove", > > "remove"); > > map.put("authors-form.button.forward", > > "forward"); > > map.put("authors-form.button.back", "back"); > > return map; > > } > > > > > > The back-button works, while the forward doesn't. > > > > The LookupDispatchAction tries to call a method named > > "weiter" instead > > of "forward", while it calls the "back"-method as expected. > > > > Alexander > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > > * * * * * * * > > > > This email with attachments is solely for the use of the individual or > > entity to whom it is addressed. Please also be aware that the > > DnB NOR Group > > cannot accept any payment orders or other legally binding > > correspondence with > > customers as a part of an email. > > > > This email message has been virus checked by the virus programs used > > in the DnB NOR Group. > > > > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > > * * * * * * * > > > > > > - > > 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] > > -- "You can't wake a person who is pretending to be asleep." ~Native Proverb~ "Each man is good in His sight. It is not necessary for eagles to be crows." ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: LookupDispatchAction doesn't lookup mapping
> -Original Message- > From: Dakota Jack [mailto:[EMAIL PROTECTED] > Sent: Wednesday, December 08, 2004 11:28 AM > To: Struts Users Mailing List > Subject: Re: LookupDispatchAction doesn't lookup mapping > > > Sorry if this is not helpful to you, Jim. However, I meant the > opposite of what you are saying. I am saying that the computer is > doing exactly what is coded and, so, the answer lies in tracking the > output. I would never think that the impossible is possible or any > other such philosophical drivel. Sorry I gave that impression. I am > a preeminently practical person. That is what I mean when I say "the > computer is always right'. Hopefully my next suggestion makes that > clear. I think this is really a simple problem to solve if one merely > debugs following the LookupDispatchAction code and determines where > the wrong value appears. This is not a rocket science problem. That > is my point. You missed my point. Entirely. Everything looks correct in your setup. Looks exactly like what I'm using right now, in production. Can't be that. So.. what else is different. The unecessary multiple use of > Jack > > > On Wed, 8 Dec 2004 09:09:46 -0700, Jim Barrows > <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > -Original Message- > > > From: Alexander Czernay [mailto:[EMAIL PROTECTED] > > > Sent: Wednesday, December 08, 2004 6:14 AM > > > To: Struts Users Mailing List > > > Subject: Re: LookupDispatchAction doesn't lookup mapping > > > > > > > > > Dakota Jack wrote: > > > > My experience is that the computer is always right, so I > > > would look in > > > > my properites file, if I were you, and see whether or not I had > > > > reversed the myButtonForward=go to go=myButtonForward. > Did you? I > > > > feel compelled to reiterate that LookupDispatchAction is a > > > fairly poor > > > > example of the code needed to do this stuff, in my opinion. > > > > > > > > Jack > > > > > > > > > > > > > > I will definitely try your suggestion out, but before that, I > > > wanted to > > > figure out, what I had done wrong using the LookupDispatchAction. > > > > > > So now some direct copy & paste from my code. > > > My ApplicationRessurces.properties looks like this: > > > > > > authors-form.button.forward = weiter > > > authors-form.button.back = zurück > > > > > > > > > The jsp: > > > > This suggestion comes under the heading "When only the > impossible is left, the impossible must be possible". I > don't think this is it. > > Why do you have with either button. It shouldn't matter, but everything else > looks right, and exactly the way I have it working in my > code, except for the double form thing. No idea why it would > make a difference... and don't really think it should... but.. > > > > > > > > > > > > > > > > property="submit"> > > key="authors-form.button.back"/> > > > > > property="submit"> > > key="authors-form.button.forward"/> > > > > > > > > > And finally the Action-Map: > > > > > > protected Map getKeyMethodMap() { > > > Map map = new HashMap(); > > > map.put("authors-form.button.create", > > > "create"); > > > map.put("authors-form.button.edit", > "edit"); > > > map.put("authors-form.button.remove", > > > "remove"); > > > map.put("authors-form.button.forward", > > > "forward"); > > > map.put("authors-form.button.back", > "back"); > > > return map; > > > } > > > > > > > > > The back-button works, while the forward doesn't. > > > > > > The LookupDispatchAction tries to call a method named > > > "weiter" instead > > > of "forward", while it calls the "back"-method as expected. > > > > > > Alexander > > > > > > > - > > > 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] > > > > > > > -- > > > "You can't wake a person who is pretending to be asleep." > > ~Native Proverb~ > > "Each man is good in His sight. It is not necessary for > eagles to be crows." > > ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction doesn't lookup mapping
Given the accuracy of what Alexander has said, if the method return is "weiter" from the keyMethodMap, then the key being called is returning a value of "weiter" and that has to be in the key method map. That is not guesswork. That is what has to be having, if the debug information on this thread is correct. Jack On Wed, 8 Dec 2004 09:09:46 -0700, Jim Barrows <[EMAIL PROTECTED]> wrote: > > > > > > -Original Message- > > From: Alexander Czernay [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, December 08, 2004 6:14 AM > > To: Struts Users Mailing List > > Subject: Re: LookupDispatchAction doesn't lookup mapping > > > > > > Dakota Jack wrote: > > > My experience is that the computer is always right, so I > > would look in > > > my properites file, if I were you, and see whether or not I had > > > reversed the myButtonForward=go to go=myButtonForward. Did you? I > > > feel compelled to reiterate that LookupDispatchAction is a > > fairly poor > > > example of the code needed to do this stuff, in my opinion. > > > > > > Jack > > > > > > > > > > I will definitely try your suggestion out, but before that, I > > wanted to > > figure out, what I had done wrong using the LookupDispatchAction. > > > > So now some direct copy & paste from my code. > > My ApplicationRessurces.properties looks like this: > > > > authors-form.button.forward = weiter > > authors-form.button.back = zurück > > > > > > The jsp: > > This suggestion comes under the heading "When only the impossible is left, > the impossible must be possible". I don't think this is it. > Why do you have It shouldn't matter, but everything else looks right, and exactly the way I > have it working in my code, except for the double form thing. No idea why it > would make a difference... and don't really think it should... but.. > > > > > > > > > property="submit"> > key="authors-form.button.back"/> > > > property="submit"> > key="authors-form.button.forward"/> > > > > > > And finally the Action-Map: > > > > protected Map getKeyMethodMap() { > > Map map = new HashMap(); > > map.put("authors-form.button.create", > > "create"); > > map.put("authors-form.button.edit", "edit"); > > map.put("authors-form.button.remove", > > "remove"); > > map.put("authors-form.button.forward", > > "forward"); > > map.put("authors-form.button.back", "back"); > > return map; > > } > > > > > > The back-button works, while the forward doesn't. > > > > The LookupDispatchAction tries to call a method named > > "weiter" instead > > of "forward", while it calls the "back"-method as expected. > > > > Alexander > > > > - > > 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] > > -- "You can't wake a person who is pretending to be asleep." ~Native Proverb~ "Each man is good in His sight. It is not necessary for eagles to be crows." ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction doesn't lookup mapping
Sorry if this is not helpful to you, Jim. However, I meant the opposite of what you are saying. I am saying that the computer is doing exactly what is coded and, so, the answer lies in tracking the output. I would never think that the impossible is possible or any other such philosophical drivel. Sorry I gave that impression. I am a preeminently practical person. That is what I mean when I say "the computer is always right'. Hopefully my next suggestion makes that clear. I think this is really a simple problem to solve if one merely debugs following the LookupDispatchAction code and determines where the wrong value appears. This is not a rocket science problem. That is my point. Jack On Wed, 8 Dec 2004 09:09:46 -0700, Jim Barrows <[EMAIL PROTECTED]> wrote: > > > > > > -Original Message- > > From: Alexander Czernay [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, December 08, 2004 6:14 AM > > To: Struts Users Mailing List > > Subject: Re: LookupDispatchAction doesn't lookup mapping > > > > > > Dakota Jack wrote: > > > My experience is that the computer is always right, so I > > would look in > > > my properites file, if I were you, and see whether or not I had > > > reversed the myButtonForward=go to go=myButtonForward. Did you? I > > > feel compelled to reiterate that LookupDispatchAction is a > > fairly poor > > > example of the code needed to do this stuff, in my opinion. > > > > > > Jack > > > > > > > > > > I will definitely try your suggestion out, but before that, I > > wanted to > > figure out, what I had done wrong using the LookupDispatchAction. > > > > So now some direct copy & paste from my code. > > My ApplicationRessurces.properties looks like this: > > > > authors-form.button.forward = weiter > > authors-form.button.back = zurück > > > > > > The jsp: > > This suggestion comes under the heading "When only the impossible is left, > the impossible must be possible". I don't think this is it. > Why do you have It shouldn't matter, but everything else looks right, and exactly the way I > have it working in my code, except for the double form thing. No idea why it > would make a difference... and don't really think it should... but.. > > > > > > > > > property="submit"> > key="authors-form.button.back"/> > > > property="submit"> > key="authors-form.button.forward"/> > > > > > > And finally the Action-Map: > > > > protected Map getKeyMethodMap() { > > Map map = new HashMap(); > > map.put("authors-form.button.create", > > "create"); > > map.put("authors-form.button.edit", "edit"); > > map.put("authors-form.button.remove", > > "remove"); > > map.put("authors-form.button.forward", > > "forward"); > > map.put("authors-form.button.back", "back"); > > return map; > > } > > > > > > The back-button works, while the forward doesn't. > > > > The LookupDispatchAction tries to call a method named > > "weiter" instead > > of "forward", while it calls the "back"-method as expected. > > > > Alexander > > > > - > > 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] > > -- "You can't wake a person who is pretending to be asleep." ~Native Proverb~ "Each man is good in His sight. It is not necessary for eagles to be crows." ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction doesn't lookup mapping
The problem with this analysis, Hermod, is that the determination of what method to call happens after the correct key is found, and the correct key can be found only if there is no locale issue. I am assuming that when Alexander says the method weiter is being called he means that. Jack On Wed, 8 Dec 2004 16:03:27 +0100, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hi > > You write that : The LookupDispatchAction tries to call a method named > "weiter" instead > of "forward", while it calls the "back"-method as expected. > > As far as I remember "weiter" is the German word for "forward" - There > might be a locale issue here. > > Hermod > > > > > -Original Message- > From: Alexander Czernay [mailto:[EMAIL PROTECTED] > Sent: Wednesday, December 08, 2004 2:14 PM > To: Struts Users Mailing List > Subject: Re: LookupDispatchAction doesn't lookup mapping > > Dakota Jack wrote: > > My experience is that the computer is always right, so I would look in > > my properites file, if I were you, and see whether or not I had > > reversed the myButtonForward=go to go=myButtonForward. Did you? I > > feel compelled to reiterate that LookupDispatchAction is a fairly poor > > example of the code needed to do this stuff, in my opinion. > > > > Jack > > > > > > I will definitely try your suggestion out, but before that, I wanted to > figure out, what I had done wrong using the LookupDispatchAction. > > So now some direct copy & paste from my code. > My ApplicationRessurces.properties looks like this: > > authors-form.button.forward = weiter > authors-form.button.back = zurück > > > The jsp: > > property="submit"> key="authors-form.button.back"/> > property="submit"> key="authors-form.button.forward"/> > > > > > And finally the Action-Map: > > protected Map getKeyMethodMap() { > Map map = new HashMap(); > map.put("authors-form.button.create", > "create"); > map.put("authors-form.button.edit", "edit"); > map.put("authors-form.button.remove", > "remove"); > map.put("authors-form.button.forward", > "forward"); > map.put("authors-form.button.back", "back"); > return map; > } > > > The back-button works, while the forward doesn't. > > The LookupDispatchAction tries to call a method named "weiter" instead > of "forward", while it calls the "back"-method as expected. > > Alexander > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > > This email with attachments is solely for the use of the individual or > entity to whom it is addressed. Please also be aware that the DnB NOR Group > cannot accept any payment orders or other legally binding correspondence with > customers as a part of an email. > > This email message has been virus checked by the virus programs used > in the DnB NOR Group. > > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- "You can't wake a person who is pretending to be asleep." ~Native Proverb~ "Each man is good in His sight. It is not necessary for eagles to be crows." ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction doesn't lookup mapping
The code in LookupDispatchAction is: String key = (String) lookupMap.get(name); String methodName = (String) keyMethodMap.get(key); Therefore, if you know what your code is returning as "key" and you know what your code is returning as "methodName" and if the "key" is correct, the keyMethodMap has to contain the wrong value for the "key". Jack On Wed, 08 Dec 2004 14:14:18 +0100, Alexander Czernay <[EMAIL PROTECTED]> wrote: > Dakota Jack wrote: > > My experience is that the computer is always right, so I would look in > > my properites file, if I were you, and see whether or not I had > > reversed the myButtonForward=go to go=myButtonForward. Did you? I > > feel compelled to reiterate that LookupDispatchAction is a fairly poor > > example of the code needed to do this stuff, in my opinion. > > > > Jack > > > > > > I will definitely try your suggestion out, but before that, I wanted to > figure out, what I had done wrong using the LookupDispatchAction. > > So now some direct copy & paste from my code. > My ApplicationRessurces.properties looks like this: > > authors-form.button.forward = weiter > authors-form.button.back = zurück > > > The jsp: > > property="submit"> key="authors-form.button.back"/> > property="submit"> key="authors-form.button.forward"/> > > > And finally the Action-Map: > > protected Map getKeyMethodMap() { > Map map = new HashMap(); > map.put("authors-form.button.create", "create"); > map.put("authors-form.button.edit", "edit"); > map.put("authors-form.button.remove", "remove"); > map.put("authors-form.button.forward","forward"); > map.put("authors-form.button.back", "back"); > return map; > } > > > The back-button works, while the forward doesn't. > > The LookupDispatchAction tries to call a method named "weiter" instead > of "forward", while it calls the "back"-method as expected. > > > > Alexander > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- "You can't wake a person who is pretending to be asleep." ~Native Proverb~ "Each man is good in His sight. It is not necessary for eagles to be crows." ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: LookupDispatchAction doesn't lookup mapping
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Sent: Wednesday, December 08, 2004 8:03 AM > To: [EMAIL PROTECTED] > Subject: RE: LookupDispatchAction doesn't lookup mapping > > > Hi > > You write that : The LookupDispatchAction tries to call a method named > "weiter" instead > of "forward", while it calls the "back"-method as expected. > > As far as I remember "weiter" is the German word for "forward" - There > might be a locale issue here. That would be possible if he was getting the english version instead of the german version he's apparently putting on the page. > > Hermod > > > -Original Message- > From: Alexander Czernay [mailto:[EMAIL PROTECTED] > Sent: Wednesday, December 08, 2004 2:14 PM > To: Struts Users Mailing List > Subject: Re: LookupDispatchAction doesn't lookup mapping > > > Dakota Jack wrote: > > My experience is that the computer is always right, so I > would look in > > my properites file, if I were you, and see whether or not I had > > reversed the myButtonForward=go to go=myButtonForward. Did you? I > > feel compelled to reiterate that LookupDispatchAction is a > fairly poor > > example of the code needed to do this stuff, in my opinion. > > > > Jack > > > > > > I will definitely try your suggestion out, but before that, I > wanted to > figure out, what I had done wrong using the LookupDispatchAction. > > So now some direct copy & paste from my code. > My ApplicationRessurces.properties looks like this: > > authors-form.button.forward = weiter > authors-form.button.back = zurück > > > The jsp: > > property="submit"> key="authors-form.button.back"/> > property="submit"> key="authors-form.button.forward"/> > > > And finally the Action-Map: > > protected Map getKeyMethodMap() { > Map map = new HashMap(); > map.put("authors-form.button.create", > "create"); > map.put("authors-form.button.edit", "edit"); > map.put("authors-form.button.remove", > "remove"); > map.put("authors-form.button.forward", > "forward"); > map.put("authors-form.button.back", "back"); > return map; > } > > > The back-button works, while the forward doesn't. > > The LookupDispatchAction tries to call a method named > "weiter" instead > of "forward", while it calls the "back"-method as expected. > > Alexander > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > * * * * * * * > > This email with attachments is solely for the use of the individual or > entity to whom it is addressed. Please also be aware that the > DnB NOR Group > cannot accept any payment orders or other legally binding > correspondence with > customers as a part of an email. > > This email message has been virus checked by the virus programs used > in the DnB NOR Group. > > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > * * * * * * * > > > - > 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: LookupDispatchAction doesn't lookup mapping
> -Original Message- > From: Alexander Czernay [mailto:[EMAIL PROTECTED] > Sent: Wednesday, December 08, 2004 6:14 AM > To: Struts Users Mailing List > Subject: Re: LookupDispatchAction doesn't lookup mapping > > > Dakota Jack wrote: > > My experience is that the computer is always right, so I > would look in > > my properites file, if I were you, and see whether or not I had > > reversed the myButtonForward=go to go=myButtonForward. Did you? I > > feel compelled to reiterate that LookupDispatchAction is a > fairly poor > > example of the code needed to do this stuff, in my opinion. > > > > Jack > > > > > > I will definitely try your suggestion out, but before that, I > wanted to > figure out, what I had done wrong using the LookupDispatchAction. > > So now some direct copy & paste from my code. > My ApplicationRessurces.properties looks like this: > > authors-form.button.forward = weiter > authors-form.button.back = zurück > > > The jsp: This suggestion comes under the heading "When only the impossible is left, the impossible must be possible". I don't think this is it. Why do you have > property="submit"> key="authors-form.button.back"/> > property="submit"> key="authors-form.button.forward"/> > > > And finally the Action-Map: > > protected Map getKeyMethodMap() { > Map map = new HashMap(); > map.put("authors-form.button.create", > "create"); > map.put("authors-form.button.edit", "edit"); > map.put("authors-form.button.remove", > "remove"); > map.put("authors-form.button.forward", > "forward"); > map.put("authors-form.button.back", "back"); > return map; > } > > > The back-button works, while the forward doesn't. > > The LookupDispatchAction tries to call a method named > "weiter" instead > of "forward", while it calls the "back"-method as expected. > > Alexander > > - > 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: LookupDispatchAction doesn't lookup mapping
Hi You write that : The LookupDispatchAction tries to call a method named "weiter" instead of "forward", while it calls the "back"-method as expected. As far as I remember "weiter" is the German word for "forward" - There might be a locale issue here. Hermod -Original Message- From: Alexander Czernay [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 08, 2004 2:14 PM To: Struts Users Mailing List Subject: Re: LookupDispatchAction doesn't lookup mapping Dakota Jack wrote: > My experience is that the computer is always right, so I would look in > my properites file, if I were you, and see whether or not I had > reversed the myButtonForward=go to go=myButtonForward. Did you? I > feel compelled to reiterate that LookupDispatchAction is a fairly poor > example of the code needed to do this stuff, in my opinion. > > Jack > > I will definitely try your suggestion out, but before that, I wanted to figure out, what I had done wrong using the LookupDispatchAction. So now some direct copy & paste from my code. My ApplicationRessurces.properties looks like this: authors-form.button.forward = weiter authors-form.button.back = zurück The jsp: And finally the Action-Map: protected Map getKeyMethodMap() { Map map = new HashMap(); map.put("authors-form.button.create", "create"); map.put("authors-form.button.edit", "edit"); map.put("authors-form.button.remove", "remove"); map.put("authors-form.button.forward", "forward"); map.put("authors-form.button.back", "back"); return map; } The back-button works, while the forward doesn't. The LookupDispatchAction tries to call a method named "weiter" instead of "forward", while it calls the "back"-method as expected. Alexander - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: LookupDispatchAction doesn't lookup mapping
Please ignore this message. -Original Message- From: Dakota Jack [mailto:[EMAIL PROTECTED] Sent: Wednesday, December 08, 2004 7:47 AM To: Struts Users Mailing List Subject: Re: LookupDispatchAction doesn't lookup mapping My experience is that the computer is always right, so I would look in my properites file, if I were you, and see whether or not I had reversed the myButtonForward=go to go=myButtonForward. Did you? I feel compelled to reiterate that LookupDispatchAction is a fairly poor example of the code needed to do this stuff, in my opinion. Jack On Wed, 08 Dec 2004 09:51:58 +0100, Alexander Czernay <[EMAIL PROTECTED]> wrote: > Dakota Jack wrote: > > > > On Tue, 07 Dec 2004 12:02:52 +0100, Alexander Czernay > > <[EMAIL PROTECTED]> wrote: > > > >> The problem is, that only one of those buttons > >>works, while the other throws a MissingResourceAction. That sounds like > >>a typo, but the strange thing is, that it tries to lookup the button's > >>value rather than it's name (eg. having a ressource mapping like > >>mybutton.forward=go it would try to lookup "go"). > > > > > > I presume that you know that lookup dispatch action DOES lookup the > > buttons value rather than its name? I just mention this because your > > wording half indicates that you find this surprising. > > > > Jack > > > > Well, as far as I understand it, it takes the button value (eg. "go") > and tries to match it in Application.properties, where it should find > "mybutton.forward" that it looks up in the getKeyMethodMap() inside the > LookupDispatchAction. My problem is, that my application tries to lookup > "go" rather than "mybutton.forward" for one button, while it works for > the other. > > I double-checked all occurences of the lookup-string and also tried to > rename it in case of some cruel naming conflict. It just doesn't work. > > Alexander > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- "You can't wake a person who is pretending to be asleep." ~Native Proverb~ "Each man is good in His sight. It is not necessary for eagles to be crows." ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Note: The information contained in this email and in any attachments is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. The recipient should check this email and any attachments for the presence of viruses. Sender accepts no liability for any damages caused by any virus transmitted by this email. If you have received this email in error, please notify us immediately by replying to the message and delete the email from your computer. This e-mail is and any response to it will be unencrypted and, therefore, potentially unsecure. Thank you. NOVA Information Systems, Inc. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction doesn't lookup mapping
Dakota Jack wrote: My experience is that the computer is always right, so I would look in my properites file, if I were you, and see whether or not I had reversed the myButtonForward=go to go=myButtonForward. Did you? I feel compelled to reiterate that LookupDispatchAction is a fairly poor example of the code needed to do this stuff, in my opinion. Jack I will definitely try your suggestion out, but before that, I wanted to figure out, what I had done wrong using the LookupDispatchAction. So now some direct copy & paste from my code. My ApplicationRessurces.properties looks like this: authors-form.button.forward = weiter authors-form.button.back = zurück The jsp: And finally the Action-Map: protected Map getKeyMethodMap() { Map map = new HashMap(); map.put("authors-form.button.create", "create"); map.put("authors-form.button.edit", "edit"); map.put("authors-form.button.remove", "remove"); map.put("authors-form.button.forward", "forward"); map.put("authors-form.button.back", "back"); return map; } The back-button works, while the forward doesn't. The LookupDispatchAction tries to call a method named "weiter" instead of "forward", while it calls the "back"-method as expected. Alexander - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction doesn't lookup mapping
I meant mybutton.forward=go to go=mybutton.forward On Wed, 8 Dec 2004 04:46:58 -0800, Dakota Jack <[EMAIL PROTECTED]> wrote: > My experience is that the computer is always right, so I would look in > my properites file, if I were you, and see whether or not I had > reversed the myButtonForward=go to go=myButtonForward. Did you? I > feel compelled to reiterate that LookupDispatchAction is a fairly poor > example of the code needed to do this stuff, in my opinion. > > Jack > > On Wed, 08 Dec 2004 09:51:58 +0100, Alexander Czernay > > > <[EMAIL PROTECTED]> wrote: > > Dakota Jack wrote: > > > > > > > On Tue, 07 Dec 2004 12:02:52 +0100, Alexander Czernay > > > <[EMAIL PROTECTED]> wrote: > > > > > >> The problem is, that only one of those buttons > > >>works, while the other throws a MissingResourceAction. That sounds like > > >>a typo, but the strange thing is, that it tries to lookup the button's > > >>value rather than it's name (eg. having a ressource mapping like > > >>mybutton.forward=go it would try to lookup "go"). > > > > > > > > > I presume that you know that lookup dispatch action DOES lookup the > > > buttons value rather than its name? I just mention this because your > > > wording half indicates that you find this surprising. > > > > > > Jack > > > > > > > Well, as far as I understand it, it takes the button value (eg. "go") > > and tries to match it in Application.properties, where it should find > > "mybutton.forward" that it looks up in the getKeyMethodMap() inside the > > LookupDispatchAction. My problem is, that my application tries to lookup > > "go" rather than "mybutton.forward" for one button, while it works for > > the other. > > > > I double-checked all occurences of the lookup-string and also tried to > > rename it in case of some cruel naming conflict. It just doesn't work. > > > > Alexander > > > > > > > > - > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > -- > > "You can't wake a person who is pretending to be asleep." > > ~Native Proverb~ > > "Each man is good in His sight. It is not necessary for eagles to be crows." > > ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ > -- "You can't wake a person who is pretending to be asleep." ~Native Proverb~ "Each man is good in His sight. It is not necessary for eagles to be crows." ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction doesn't lookup mapping
My experience is that the computer is always right, so I would look in my properites file, if I were you, and see whether or not I had reversed the myButtonForward=go to go=myButtonForward. Did you? I feel compelled to reiterate that LookupDispatchAction is a fairly poor example of the code needed to do this stuff, in my opinion. Jack On Wed, 08 Dec 2004 09:51:58 +0100, Alexander Czernay <[EMAIL PROTECTED]> wrote: > Dakota Jack wrote: > > > > On Tue, 07 Dec 2004 12:02:52 +0100, Alexander Czernay > > <[EMAIL PROTECTED]> wrote: > > > >> The problem is, that only one of those buttons > >>works, while the other throws a MissingResourceAction. That sounds like > >>a typo, but the strange thing is, that it tries to lookup the button's > >>value rather than it's name (eg. having a ressource mapping like > >>mybutton.forward=go it would try to lookup "go"). > > > > > > I presume that you know that lookup dispatch action DOES lookup the > > buttons value rather than its name? I just mention this because your > > wording half indicates that you find this surprising. > > > > Jack > > > > Well, as far as I understand it, it takes the button value (eg. "go") > and tries to match it in Application.properties, where it should find > "mybutton.forward" that it looks up in the getKeyMethodMap() inside the > LookupDispatchAction. My problem is, that my application tries to lookup > "go" rather than "mybutton.forward" for one button, while it works for > the other. > > I double-checked all occurences of the lookup-string and also tried to > rename it in case of some cruel naming conflict. It just doesn't work. > > Alexander > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- "You can't wake a person who is pretending to be asleep." ~Native Proverb~ "Each man is good in His sight. It is not necessary for eagles to be crows." ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction doesn't lookup mapping
Dakota Jack wrote: On Tue, 07 Dec 2004 12:02:52 +0100, Alexander Czernay <[EMAIL PROTECTED]> wrote: The problem is, that only one of those buttons works, while the other throws a MissingResourceAction. That sounds like a typo, but the strange thing is, that it tries to lookup the button's value rather than it's name (eg. having a ressource mapping like mybutton.forward=go it would try to lookup "go"). I presume that you know that lookup dispatch action DOES lookup the buttons value rather than its name? I just mention this because your wording half indicates that you find this surprising. Jack Well, as far as I understand it, it takes the button value (eg. "go") and tries to match it in Application.properties, where it should find "mybutton.forward" that it looks up in the getKeyMethodMap() inside the LookupDispatchAction. My problem is, that my application tries to lookup "go" rather than "mybutton.forward" for one button, while it works for the other. I double-checked all occurences of the lookup-string and also tried to rename it in case of some cruel naming conflict. It just doesn't work. Alexander - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction doesn't lookup mapping
On Tue, 07 Dec 2004 12:02:52 +0100, Alexander Czernay <[EMAIL PROTECTED]> wrote: > The problem is, that only one of those buttons > works, while the other throws a MissingResourceAction. That sounds like > a typo, but the strange thing is, that it tries to lookup the button's > value rather than it's name (eg. having a ressource mapping like > mybutton.forward=go it would try to lookup "go"). I presume that you know that lookup dispatch action DOES lookup the buttons value rather than its name? I just mention this because your wording half indicates that you find this surprising. Jack -- "You can't wake a person who is pretending to be asleep." ~Native Proverb~ "Each man is good in His sight. It is not necessary for eagles to be crows." ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: LookupDispatchAction doesn't lookup mapping
> -Original Message- > From: Susan Bradeen [mailto:[EMAIL PROTECTED] > Sent: Tuesday, December 07, 2004 12:07 PM > To: Struts Users Mailing List > Subject: Re: LookupDispatchAction doesn't lookup mapping > > > On Tue, 07 Dec 2004 15:54:20 +0100, Alexander Czernay > <[EMAIL PROTECTED]> wrote: > > Susan Bradeen wrote: > > > > > > > > > > > > > > > > > >>/** > > >> * Key method for mapping methods to buttons > > >> */ > > >>protected Map getKeyMethodMap() { > > >> Map map = new HashMap(); > > >> map.put("authors-form.button.create", > "create"); > > >> map.put("authors-form.button.edit", > "edit"); > > >> map.put("authors-form.button.remove", > "remove"); > > >> map.put("authors-form.button.forwar", > "forward"); > > > > > > > > > Is the above line in your code correct ... > "authors-form.button.forwar" ? > > > > > > > That was just a copy & paste mistake. That's not actually > in my code. > > Alexander > > > > > > Ok, bummer. Doesn't look to me like there's any difference in your > code set up for 'back' and 'forward', and if 'back' is working, I am > not seeing where the problem is. Does stepping through a debugger tell > you what class is actually throwing the "MissingResourceAction' > exception? I've not heard of that one before, but I don't have a whole > lof of experience with LookupDispatchAction. > Haven't followed this thread but I recently encountered this when then keys weren't in the ApplicationResource.properties file. It was somewhat troublesome because it was a copy and paste error that looked like it was correct. I had org.blah instead of com.blah... both in the resource file and in the message configuration portion of the struts-config file. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction doesn't lookup mapping
On Tue, 07 Dec 2004 15:54:20 +0100, Alexander Czernay <[EMAIL PROTECTED]> wrote: > Susan Bradeen wrote: > > > > > > > > > > >>/** > >> * Key method for mapping methods to buttons > >> */ > >>protected Map getKeyMethodMap() { > >> Map map = new HashMap(); > >> map.put("authors-form.button.create", "create"); > >> map.put("authors-form.button.edit", "edit"); > >> map.put("authors-form.button.remove", "remove"); > >> map.put("authors-form.button.forwar", > >> "forward"); > > > > > > Is the above line in your code correct ... "authors-form.button.forwar" ? > > > > That was just a copy & paste mistake. That's not actually in my code. > Alexander > > Ok, bummer. Doesn't look to me like there's any difference in your code set up for 'back' and 'forward', and if 'back' is working, I am not seeing where the problem is. Does stepping through a debugger tell you what class is actually throwing the "MissingResourceAction' exception? I've not heard of that one before, but I don't have a whole lof of experience with LookupDispatchAction. > > - > 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: LookupDispatchAction doesn't lookup mapping
Susan Bradeen wrote: /** * Key method for mapping methods to buttons */ protected Map getKeyMethodMap() { Map map = new HashMap(); map.put("authors-form.button.create", "create"); map.put("authors-form.button.edit", "edit"); map.put("authors-form.button.remove", "remove"); map.put("authors-form.button.forwar", "forward"); Is the above line in your code correct ... "authors-form.button.forwar" ? That was just a copy & paste mistake. That's not actually in my code. Alexander - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction doesn't lookup mapping
On Tue, 07 Dec 2004 12:02:52 +0100, Alexander Czernay <[EMAIL PROTECTED]> wrote: > I have a strange problem with LookupDispatchAction: > I built a form displaying several entries from a db as a list. There are > several buttons for editing/removing the entries an also two buttons for > paging though the list. The problem is, that only one of those buttons > works, while the other throws a MissingResourceAction. That sounds like > a typo, but the strange thing is, that it tries to lookup the button's > value rather than it's name (eg. having a ressource mapping like > mybutton.forward=go it would try to lookup "go"). All this works > perfectly well with my back-button on the same page, using the same action. > > Any ideas? > > Alexander > > /** > * Key method for mapping methods to buttons > */ > protected Map getKeyMethodMap() { > Map map = new HashMap(); > map.put("authors-form.button.create", "create"); > map.put("authors-form.button.edit", "edit"); > map.put("authors-form.button.remove", "remove"); > map.put("authors-form.button.forwar", > "forward"); Is the above line in your code correct ... "authors-form.button.forwar" ? > map.put("authors-form.button.back", "back"); > return map; > } > > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction doesn't lookup mapping
You might want to look at http://www.michaelmcgrady.com/button/jsp/dispatch_util.jsp. This would mean, for example, that you could do what you want with the following code, requiring nothing else: JSP CODE (changes property="submit" for example, to property="edit.dispatch") ACTION CODE (you code the actions, e.g. edit(...) and remove( ...) in your action as before) ActionForward forward= null; try { forward = new DispatchUtil().dispatch(this,mapping,form,request,response); } catch (Exception e) { } return forward; LookupDispatchAction is pretty complicated, and perhaps unnecessarily so: http://www.michaelmcgrady.com/button/jsp/button_talk.jsp . Jack On Tue, 07 Dec 2004 12:02:52 +0100, Alexander Czernay <[EMAIL PROTECTED]> wrote: > I have a strange problem with LookupDispatchAction: > I built a form displaying several entries from a db as a list. There are > several buttons for editing/removing the entries an also two buttons for > paging though the list. The problem is, that only one of those buttons > works, while the other throws a MissingResourceAction. That sounds like > a typo, but the strange thing is, that it tries to lookup the button's > value rather than it's name (eg. having a ressource mapping like > mybutton.forward=go it would try to lookup "go"). All this works > perfectly well with my back-button on the same page, using the same action. > > Any ideas? > > Alexander > > ApplicationRessources.properties: > # Form Labels > authors-form.button.create = Autor hinzufügen > authors-form.button.remove = Autor löschen > authors-form.button.edit = Autor bearbeiten > authors-form.button.list = Autoren auflisten > authors-form.button.forward = weiter > authors-form.button.back = zurück > > list.jsp > <%@ page language="java"%> > <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean"; prefix="bean"%> > <%@ taglib uri="http://jakarta.apache.org/struts/tags-html"; prefix="html"%> > <%@ taglib uri="http://jakarta.apache.org/struts/tags-logic"; > prefix="logic"%> > > > > > > > > > > > > > > > > property="submit"> key="authors-form.button.create"/> > property="submit"> key="authors-form.button.back"/> > > property="submit"> key="authors-form.button.forward"/> > > > > CommandAuthor > > property="submit"> key="authors-form.button.edit"/> property="submit"> key="authors-form.button.remove"/> property="id" name="author"/> name="author" property="name"/> - property="description"/> > > > > > property="submit"> key="authors-form.button.create"/> > > > AuthorsActionList.java > package de.sbow.struts.action.Authors; > > import java.util.HashMap; > import java.util.Map; > > import javax.servlet.http.HttpServletRequest; > import javax.servlet.http.HttpServletResponse; > > import org.apache.commons.beanutils.BeanUtils; > import org.apache.commons.logging.Log; > import org.apache.struts.action.ActionForm; > import org.apache.struts.action.ActionForward; > import org.apache.struts.action.ActionMapping; > import org.apache.struts.actions.LookupDispatchAction; > > import de.sbow.MSys.Authors.value.AuthorBeanValue; > import de.sbow.common.ServiceLocator; > import de.sbow.struts.form.AuthorEditForm; > import de.sbow.struts.model.AuthorModel; > > /** > * @author Alexander > * > * The Struts action-class for presenting > * the Authors list. > * > */ > public class AuthorsListAction extends LookupDispatchAction { > private static Log log = ServiceLocator.getInstance().getLog( > AuthorsListAction.class); > > /** > * Key method for mapping methods to buttons > */ > protected Map getKeyMethodMap() { > Map map = new HashMap(); > map.put("authors-form.button.create", "create"); > map.put("authors-form.button.edit", "edit"); > map.put("authors-form.button.remove", "remove"); > map.put("authors-form.button.forwar", > "forward"); > map.put("authors-form.button.back", "back"); > return map; > } > > /** > * Method create > * @param mapping > * @param form > * @param request > * @param response > * @return ActionForward > */ > public ActionForward create( > ActionMapping mapping, > ActionForm form, > HttpServletRequest request, > HttpServletResponse response) throws Exception { > > // get form > AuthorEditForm authorForm = (AuthorEditForm) form; > // TODO check if this makes sense! > authorForm.reset(mapping, request); > >
Re: LookUpDispatchAction weakness?
LUDA is just too complex and too outmoded, as Paul says. However, since you want to use LUDA, I don't get what your problem is. Can you provide the code? Here is what I understand: A. you are using javascript to set the action. B. then you have "separate methods" for each action. You need to spell out what B means, if we are to assist you. At any rate, I cannot tell what B means in your case. So, either change to something other than LUDA (recommended) or let us know what you are doing in more detail? Presumably, since you are using LUDA, you have a set number of methods no matter what action is being set by your javascript and this set number have the same names in each action. (This architectrue seems suspect to me. But, I don't know what you are doing, so it might make a lot of sense that is not obvious.) I hope I am not being obtuse. If so, please advise. Thanks. Jack On Thu, 4 Nov 2004 14:47:28 +0100, Václavík Radek <[EMAIL PROTECTED]> wrote: > Hi, > > I wanted to follow best practices and thus using LUDA, but I found the > following weekness: I have to rewrite code common to all of the actions in > every action method. > > When using JavaScript to set e.g. the action attribute, I can do some common > stuff in the execute method and then decide (if) what specific code to do > based on the action. However, if there are separate methods for each action, > I would have to either rewrite that code or make some common method and move > the code there (then there is problem with returning variables, or having > them as class variables - both doesn't seem very nice). > > Am I missing something here? How are you guys dealing with this? > > Thx for tips. > > Radek > > -- "You can't wake a person who is pretending to be asleep." ~Native Proverb~ "Each man is good in His sight. It is not necessary for eagles to be crows." ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookUpDispatchAction weakness?
You can override the execute method in your action and do your common stuff, then just call super.execute() to let LUDA do it's thing (which will include dispatching to your action-specific methods, of course). -- Jeff Václavík Radek wrote: Hi, I wanted to follow best practices and thus using LUDA, but I found the following weekness: I have to rewrite code common to all of the actions in every action method. When using JavaScript to set e.g. the action attribute, I can do some common stuff in the execute method and then decide (if) what specific code to do based on the action. However, if there are separate methods for each action, I would have to either rewrite that code or make some common method and move the code there (then there is problem with returning variables, or having them as class variables - both doesn't seem very nice). Am I missing something here? How are you guys dealing with this? Thx for tips. Radek - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: LookUpDispatchAction weakness?
I've come round to Michael McGrady's way of thinking. LUDA is far more complex than it needs to be. See http://wiki.apache.org/struts/StrutsCatalogVariousButtonSolutions Paul > -Original Message- > From: Vaclavik Radek [mailto:[EMAIL PROTECTED] > Sent: Thursday, November 04, 2004 1:47 PM > To: '[EMAIL PROTECTED]' > Subject: LookUpDispatchAction weakness? > > > Hi, > > I wanted to follow best practices and thus using LUDA, but I found the > following weekness: I have to rewrite code common to all of > the actions in > every action method. > > When using JavaScript to set e.g. the action attribute, I can > do some common > stuff in the execute method and then decide (if) what > specific code to do > based on the action. However, if there are separate methods > for each action, > I would have to either rewrite that code or make some common > method and move > the code there (then there is problem with returning > variables, or having > them as class variables - both doesn't seem very nice). > > Am I missing something here? How are you guys dealing with this? > > Thx for tips. > > Radek > ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction problem with double byte resource files - working with DisplayTag ?
The code has nothing to do with myAction.dispatch. And, the code is not mine. You have it all wrong: dispatch is not connected to the action but to the html. There is nothing related to action chaining inconsistent with any of the alternatives. I don't know what you've done with the code, but - have fun! And, good luck with this. Jack On Sat, 30 Oct 2004 18:49:33 -0700 (PDT), lixin chu <[EMAIL PROTECTED]> wrote: > Hi Jack, > you are right, it is indeed mixed up - all becuase I > need to support action chaining. So I had to modify > your code a bit 'cus it seems that the simple > MyAction.dispatch can not support my case. > > secondly, I just realize that even my > code is wrong becuase 'value=xxx' will be used as > label as well. > > it seems that i can not simply use myAction.dispatch > way to indicate which method I need and decouple the > label/action at the same time. > but your code certainly inspires me a lot. i am still > working on this now. > > thanks a lot. > > > li xin > > --- Dakota Jack <[EMAIL PROTECTED]> wrote: > > > Hello, Chu, > > > > You seem to be a bit mixed up. I am not even sure > > which solution you > > are using anymore. However, if you are using the > > solution at > > www.michaelmcgrady.com/button we discussed, then you > > have this coded > > wrong. > > > > First, you should have nothing in the parameter > > attribute of your > > action mapping. That is, the following code should > > be deleted. > > > > > > ... > > > > ... > > > > > > Second, the code > > > > > property="ListPermission.dispatch" value="done"> > > > > > > > > is right only if you are trying to use a method > > called > > "ListPermission". If you are trying to use a method > > called "done" > > with an action called "ListPermission", then this > > code should be: > > > > >property='done.dispatch"> > > > > > > > > This will result in the following parameters, for > > example, being in > > the request: done.dispatch.x=9 and > > done.dispatch.y=37. > > > > You are making things too complex. The solution > > simply needs whatever > > action [myAction' you want to be the value of the > > property attribute > > with ".dispatch" as a suffix, e.g. > > property=myAction.suffix. > > > > Jack > > > > > > On Sat, 30 Oct 2004 05:18:41 -0700 (PDT), lixin chu > > <[EMAIL PROTECTED]> wrote: > > > problem solved - I made a mistake in the JSP file, > > > here is the right one to return a parameter for a > > > submit button: > > > > > property="ListPermission.dispatch" > > value="done"> > > > > > > > > > > > > So in this case, if the Done button is pressed, > > > 'ListPermission.dispatch=done' is sent to the > > server. > > > > > > So now I hope I have a complete decoupled, I18N > > aware > > > DispatchAction. Thanks Jack !!! > > > > > > li xin > > > > > > > > > > > > > > > --- lixin chu <[EMAIL PROTECTED]> wrote: > > > > > > > I realize that the problem is action chaining. > > > > > > > > In my code, action one goes on to the next > > action - > > > > I > > > > persume that the parameters passed to the first > > > > action > > > > are still passed on to the next. here the > > problem > > > > comes in: new parameter is appended at end so > > > > getMethodName always gets the earlier parameter. > > > > > > > > So I tried to use a class specific parameter > > > > (together > > > > with the parameter used in Action mapping). This > > > > solves action chaining but them I got the submit > > > > button problem: > > > > > > > > here is my jsp file: > > > > > > > property="ListPermission.dispatch=done"> > > > > > > > > > > > > > > > > here is the partial action mapping: > > > > > > > > ... > > > > > > > > ... > > > > > > > > > > > > the intersting thing is that when the 'Done' > > button > > > > is > > > > clicked, the property is not passed in as > > parameter. > > > > I > > > > am lost. do not know why it is like this. > > > > > > > > anyway, thank you very much for your code and > > > > anwser. > > > > > > > > li xin > > > > > > > > > > > > > > > > --- Dakota Jack <[EMAIL PROTECTED]> wrote: > > > > > > > > > I notice that your original question had to do > > > > with > > > > > multiple submit > > > > > buttons, but that your code here only has one > > > > submit > > > > > button. You > > > > > cannot necessarily take a solution for one > > problem > > > > > and use if for > > > > > others. I don't know about the display tag, > > so I > > > > am > > > > > not sure if you > > > > > are doing the right thing here. I don't have > > time > > > > > to look at it in > > > > > further detail at this time. > > > > > > > > > > Jack > > > > > > > > > > On Fri, 29 Oct 2004 19:46:53 -0700 (PDT), > > lixin > > > > chu > > > > > <[EMAIL PROTECTED]> wrote: > > > > > > hi jack, > > > > > > thanks, the solution is cool ! I am trying > > it. > > > > > > > > > > > > a small problem i am experiencing now is > > that (i > > > > > am > > > > > > not sure if there is something wrong in m
Re: LookupDispatchAction problem with double byte resource files - working with DisplayTag ?
Hi Jack, you are right, it is indeed mixed up - all becuase I need to support action chaining. So I had to modify your code a bit 'cus it seems that the simple MyAction.dispatch can not support my case. secondly, I just realize that even my code is wrong becuase 'value=xxx' will be used as label as well. it seems that i can not simply use myAction.dispatch way to indicate which method I need and decouple the label/action at the same time. but your code certainly inspires me a lot. i am still working on this now. thanks a lot. li xin --- Dakota Jack <[EMAIL PROTECTED]> wrote: > Hello, Chu, > > You seem to be a bit mixed up. I am not even sure > which solution you > are using anymore. However, if you are using the > solution at > www.michaelmcgrady.com/button we discussed, then you > have this coded > wrong. > > First, you should have nothing in the parameter > attribute of your > action mapping. That is, the following code should > be deleted. > > > ... > > ... > > > Second, the code > >property="ListPermission.dispatch" value="done"> > > > > is right only if you are trying to use a method > called > "ListPermission". If you are trying to use a method > called "done" > with an action called "ListPermission", then this > code should be: > > property='done.dispatch"> > > > > This will result in the following parameters, for > example, being in > the request: done.dispatch.x=9 and > done.dispatch.y=37. > > You are making things too complex. The solution > simply needs whatever > action [myAction' you want to be the value of the > property attribute > with ".dispatch" as a suffix, e.g. > property=myAction.suffix. > > Jack > > > On Sat, 30 Oct 2004 05:18:41 -0700 (PDT), lixin chu > <[EMAIL PROTECTED]> wrote: > > problem solved - I made a mistake in the JSP file, > > here is the right one to return a parameter for a > > submit button: > > > property="ListPermission.dispatch" > value="done"> > > > > > > > > So in this case, if the Done button is pressed, > > 'ListPermission.dispatch=done' is sent to the > server. > > > > So now I hope I have a complete decoupled, I18N > aware > > DispatchAction. Thanks Jack !!! > > > > li xin > > > > > > > > > > --- lixin chu <[EMAIL PROTECTED]> wrote: > > > > > I realize that the problem is action chaining. > > > > > > In my code, action one goes on to the next > action - > > > I > > > persume that the parameters passed to the first > > > action > > > are still passed on to the next. here the > problem > > > comes in: new parameter is appended at end so > > > getMethodName always gets the earlier parameter. > > > > > > So I tried to use a class specific parameter > > > (together > > > with the parameter used in Action mapping). This > > > solves action chaining but them I got the submit > > > button problem: > > > > > > here is my jsp file: > > > > > property="ListPermission.dispatch=done"> > > > > > > > > > > > > here is the partial action mapping: > > > > > > ... > > > > > > ... > > > > > > > > > the intersting thing is that when the 'Done' > button > > > is > > > clicked, the property is not passed in as > parameter. > > > I > > > am lost. do not know why it is like this. > > > > > > anyway, thank you very much for your code and > > > anwser. > > > > > > li xin > > > > > > > > > > > > --- Dakota Jack <[EMAIL PROTECTED]> wrote: > > > > > > > I notice that your original question had to do > > > with > > > > multiple submit > > > > buttons, but that your code here only has one > > > submit > > > > button. You > > > > cannot necessarily take a solution for one > problem > > > > and use if for > > > > others. I don't know about the display tag, > so I > > > am > > > > not sure if you > > > > are doing the right thing here. I don't have > time > > > > to look at it in > > > > further detail at this time. > > > > > > > > Jack > > > > > > > > On Fri, 29 Oct 2004 19:46:53 -0700 (PDT), > lixin > > > chu > > > > <[EMAIL PROTECTED]> wrote: > > > > > hi jack, > > > > > thanks, the solution is cool ! I am trying > it. > > > > > > > > > > a small problem i am experiencing now is > that (i > > > > am > > > > > not sure if there is something wrong in my > > > > > configuration), the parameter on one page is > > > > passed on > > > > > to the next page, so when we getMethod, the > > > > earlier > > > > > method name is returned. > > > > > > > > > > I have one 'Search Template' page, which > gets > > > the > > > > > search criteria and then pass the results to > the > > > > > ListTemplate.jsp page after pressing the > Search > > > > button > > > > > (it is associated with the 'search.dispatch' > > > > > parameter). The 'list parameter' page has a > > > > sortable > > > > > table (i am using DisplayTag): > > > > > > > > > > > > > > > > > > >pagesize="10" > > > > >id="templates" > > > > >sort="list" export="true" > > > > >requestURI="/Canal/admin/ListTemplate.do?
Re: LookupDispatchAction problem with double byte resource files - working with DisplayTag ?
Hello, Chu, You seem to be a bit mixed up. I am not even sure which solution you are using anymore. However, if you are using the solution at www.michaelmcgrady.com/button we discussed, then you have this coded wrong. First, you should have nothing in the parameter attribute of your action mapping. That is, the following code should be deleted. ... ... Second, the code is right only if you are trying to use a method called "ListPermission". If you are trying to use a method called "done" with an action called "ListPermission", then this code should be: This will result in the following parameters, for example, being in the request: done.dispatch.x=9 and done.dispatch.y=37. You are making things too complex. The solution simply needs whatever action [myAction' you want to be the value of the property attribute with ".dispatch" as a suffix, e.g. property=myAction.suffix. Jack On Sat, 30 Oct 2004 05:18:41 -0700 (PDT), lixin chu <[EMAIL PROTECTED]> wrote: > problem solved - I made a mistake in the JSP file, > here is the right one to return a parameter for a > submit button: >property="ListPermission.dispatch" value="done"> > > > > So in this case, if the Done button is pressed, > 'ListPermission.dispatch=done' is sent to the server. > > So now I hope I have a complete decoupled, I18N aware > DispatchAction. Thanks Jack !!! > > li xin > > > > > --- lixin chu <[EMAIL PROTECTED]> wrote: > > > I realize that the problem is action chaining. > > > > In my code, action one goes on to the next action - > > I > > persume that the parameters passed to the first > > action > > are still passed on to the next. here the problem > > comes in: new parameter is appended at end so > > getMethodName always gets the earlier parameter. > > > > So I tried to use a class specific parameter > > (together > > with the parameter used in Action mapping). This > > solves action chaining but them I got the submit > > button problem: > > > > here is my jsp file: > > > property="ListPermission.dispatch=done"> > > > > > > > > here is the partial action mapping: > > > > ... > > > > ... > > > > > > the intersting thing is that when the 'Done' button > > is > > clicked, the property is not passed in as parameter. > > I > > am lost. do not know why it is like this. > > > > anyway, thank you very much for your code and > > anwser. > > > > li xin > > > > > > > > --- Dakota Jack <[EMAIL PROTECTED]> wrote: > > > > > I notice that your original question had to do > > with > > > multiple submit > > > buttons, but that your code here only has one > > submit > > > button. You > > > cannot necessarily take a solution for one problem > > > and use if for > > > others. I don't know about the display tag, so I > > am > > > not sure if you > > > are doing the right thing here. I don't have time > > > to look at it in > > > further detail at this time. > > > > > > Jack > > > > > > On Fri, 29 Oct 2004 19:46:53 -0700 (PDT), lixin > > chu > > > <[EMAIL PROTECTED]> wrote: > > > > hi jack, > > > > thanks, the solution is cool ! I am trying it. > > > > > > > > a small problem i am experiencing now is that (i > > > am > > > > not sure if there is something wrong in my > > > > configuration), the parameter on one page is > > > passed on > > > > to the next page, so when we getMethod, the > > > earlier > > > > method name is returned. > > > > > > > > I have one 'Search Template' page, which gets > > the > > > > search criteria and then pass the results to the > > > > ListTemplate.jsp page after pressing the Search > > > button > > > > (it is associated with the 'search.dispatch' > > > > parameter). The 'list parameter' page has a > > > sortable > > > > table (i am using DisplayTag): > > > > > > > > > > > > > > >pagesize="10" > > > >id="templates" > > > >sort="list" export="true" > > > >requestURI="/Canal/admin/ListTemplate.do? > > > >sort.dispatch"> > > > > > > > > > name="basic.empty.showtable" > > > > value="true"/> > > > > > > > > > > > name="value( > > name="templates" > > > > property="id"/>)" value="x"/> > > > > > > > > > > > sortable="true" > > > > > > > href="TemplateManager.do?prepare.dispatch" > > > >paramId="templateID" > > > paramProperty="id"/> > > > > > > >property="category.name" > > > sortable="true" > > > > > > > href="TemplateManager.do?prepare.dispatch" > > > >paramId="templateID" > > > paramProperty="id"/> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > the problem is that the additional > > > > search.dispatch=Search is inserted into the > > > requestURI > > > > when I 'view source'. I have no idea. > > > > > > > > I am not sure if it is the DisplayTag limitation > > > > though ... > > > > > > > > thanks > > > > li xin > > > > > > > > --- Dakota Jack <[EMAIL PROTECTED]
Re: LookupDispatchAction problem with double byte resource files - working with DisplayTag ?
problem solved - I made a mistake in the JSP file, here is the right one to return a parameter for a submit button: So in this case, if the Done button is pressed, 'ListPermission.dispatch=done' is sent to the server. So now I hope I have a complete decoupled, I18N aware DispatchAction. Thanks Jack !!! li xin --- lixin chu <[EMAIL PROTECTED]> wrote: > I realize that the problem is action chaining. > > In my code, action one goes on to the next action - > I > persume that the parameters passed to the first > action > are still passed on to the next. here the problem > comes in: new parameter is appended at end so > getMethodName always gets the earlier parameter. > > So I tried to use a class specific parameter > (together > with the parameter used in Action mapping). This > solves action chaining but them I got the submit > button problem: > > here is my jsp file: > property="ListPermission.dispatch=done"> > > > > here is the partial action mapping: > > ... > > ... > > > the intersting thing is that when the 'Done' button > is > clicked, the property is not passed in as parameter. > I > am lost. do not know why it is like this. > > anyway, thank you very much for your code and > anwser. > > li xin > > > > --- Dakota Jack <[EMAIL PROTECTED]> wrote: > > > I notice that your original question had to do > with > > multiple submit > > buttons, but that your code here only has one > submit > > button. You > > cannot necessarily take a solution for one problem > > and use if for > > others. I don't know about the display tag, so I > am > > not sure if you > > are doing the right thing here. I don't have time > > to look at it in > > further detail at this time. > > > > Jack > > > > On Fri, 29 Oct 2004 19:46:53 -0700 (PDT), lixin > chu > > <[EMAIL PROTECTED]> wrote: > > > hi jack, > > > thanks, the solution is cool ! I am trying it. > > > > > > a small problem i am experiencing now is that (i > > am > > > not sure if there is something wrong in my > > > configuration), the parameter on one page is > > passed on > > > to the next page, so when we getMethod, the > > earlier > > > method name is returned. > > > > > > I have one 'Search Template' page, which gets > the > > > search criteria and then pass the results to the > > > ListTemplate.jsp page after pressing the Search > > button > > > (it is associated with the 'search.dispatch' > > > parameter). The 'list parameter' page has a > > sortable > > > table (i am using DisplayTag): > > > > > > > > > > >pagesize="10" > > >id="templates" > > >sort="list" export="true" > > >requestURI="/Canal/admin/ListTemplate.do? > > >sort.dispatch"> > > > > > > name="basic.empty.showtable" > > > value="true"/> > > > > > > > > name="value( > name="templates" > > > property="id"/>)" value="x"/> > > > > > > > > sortable="true" > > > > > href="TemplateManager.do?prepare.dispatch" > > >paramId="templateID" > > paramProperty="id"/> > > > > >property="category.name" > > sortable="true" > > > > > href="TemplateManager.do?prepare.dispatch" > > >paramId="templateID" > > paramProperty="id"/> > > > > > > > > > > > > > > > > > > > > > > > > > > > the problem is that the additional > > > search.dispatch=Search is inserted into the > > requestURI > > > when I 'view source'. I have no idea. > > > > > > I am not sure if it is the DisplayTag limitation > > > though ... > > > > > > thanks > > > li xin > > > > > > --- Dakota Jack <[EMAIL PROTECTED]> wrote: > > > > > > > All of your problems are caused because > > > > LookupDispatchAction creates a > > > > reverse mapping from the value of a parameter > to > > its > > > > key, in order to > > > > get the method name. This is not only > resource > > > > intensive but also a > > > > constant source of the sorts of difficulties > you > > are > > > > experiencing. You > > > > can find what are better alternatives in > various > > > > places. Some of them > > > > are itemized at > > > > http://www.michaelmcgrady.com/button/ . > > > > > > > > Jack > > > > > > > > > > > > On Wed, 27 Oct 2004 22:17:56 -0600, Kumar V > > Kadiyala > > > > <[EMAIL PROTECTED]> wrote: > > > > > Hi all, > > > > > > > > > > I'm using LookupDispatchAction to submit a > > form > > > > with multiple submit > > > > > buttons. The labels of the buttons are > > translated. > > > > The translated strings > > > > > are in a .properties file. I'm able to run > the > > web > > > > app fine in English but > > > > > when I switch to Korean none of the the > submit > > > > buttons work and I see the > > > > > following message in the log. > > > > > [10/27/04 21:40:39:631 MDT] 67f967f9 > > DispatchActio > > > > E > > > > > org.apache.struts.actions.DispatchAction > > > > Request[/tag] does not contain > > > > > handler parameter name
Re: LookupDispatchAction problem with double byte resource files - working with DisplayTag ?
I realize that the problem is action chaining. In my code, action one goes on to the next action - I persume that the parameters passed to the first action are still passed on to the next. here the problem comes in: new parameter is appended at end so getMethodName always gets the earlier parameter. So I tried to use a class specific parameter (together with the parameter used in Action mapping). This solves action chaining but them I got the submit button problem: here is my jsp file: here is the partial action mapping: ... ... the intersting thing is that when the 'Done' button is clicked, the property is not passed in as parameter. I am lost. do not know why it is like this. anyway, thank you very much for your code and anwser. li xin --- Dakota Jack <[EMAIL PROTECTED]> wrote: > I notice that your original question had to do with > multiple submit > buttons, but that your code here only has one submit > button. You > cannot necessarily take a solution for one problem > and use if for > others. I don't know about the display tag, so I am > not sure if you > are doing the right thing here. I don't have time > to look at it in > further detail at this time. > > Jack > > On Fri, 29 Oct 2004 19:46:53 -0700 (PDT), lixin chu > <[EMAIL PROTECTED]> wrote: > > hi jack, > > thanks, the solution is cool ! I am trying it. > > > > a small problem i am experiencing now is that (i > am > > not sure if there is something wrong in my > > configuration), the parameter on one page is > passed on > > to the next page, so when we getMethod, the > earlier > > method name is returned. > > > > I have one 'Search Template' page, which gets the > > search criteria and then pass the results to the > > ListTemplate.jsp page after pressing the Search > button > > (it is associated with the 'search.dispatch' > > parameter). The 'list parameter' page has a > sortable > > table (i am using DisplayTag): > > > > > > >pagesize="10" > >id="templates" > >sort="list" export="true" > >requestURI="/Canal/admin/ListTemplate.do? > >sort.dispatch"> > > > > > value="true"/> > > > > > name="value( name="templates" > > property="id"/>)" value="x"/> > > > > > sortable="true" > > > href="TemplateManager.do?prepare.dispatch" > >paramId="templateID" > paramProperty="id"/> > > >property="category.name" > sortable="true" > > > href="TemplateManager.do?prepare.dispatch" > >paramId="templateID" > paramProperty="id"/> > > > > > > > > > > > > > > > > > > the problem is that the additional > > search.dispatch=Search is inserted into the > requestURI > > when I 'view source'. I have no idea. > > > > I am not sure if it is the DisplayTag limitation > > though ... > > > > thanks > > li xin > > > > --- Dakota Jack <[EMAIL PROTECTED]> wrote: > > > > > All of your problems are caused because > > > LookupDispatchAction creates a > > > reverse mapping from the value of a parameter to > its > > > key, in order to > > > get the method name. This is not only resource > > > intensive but also a > > > constant source of the sorts of difficulties you > are > > > experiencing. You > > > can find what are better alternatives in various > > > places. Some of them > > > are itemized at > > > http://www.michaelmcgrady.com/button/ . > > > > > > Jack > > > > > > > > > On Wed, 27 Oct 2004 22:17:56 -0600, Kumar V > Kadiyala > > > <[EMAIL PROTECTED]> wrote: > > > > Hi all, > > > > > > > > I'm using LookupDispatchAction to submit a > form > > > with multiple submit > > > > buttons. The labels of the buttons are > translated. > > > The translated strings > > > > are in a .properties file. I'm able to run the > web > > > app fine in English but > > > > when I switch to Korean none of the the submit > > > buttons work and I see the > > > > following message in the log. > > > > [10/27/04 21:40:39:631 MDT] 67f967f9 > DispatchActio > > > E > > > > org.apache.struts.actions.DispatchAction > > > Request[/tag] does not contain > > > > handler parameter named method > > > > > > > > The Korean .properties was converted to ascii > > > (using nativetoascii) from > > > > its native encoding. Does this have to do > anything > > > with what I'm noticing? > > > > Should something additional be done when > > > .properties files are coverted to > > > > ascii? > > > > > > > > Help appreciated, > > > > Kumar > > > > > > > > > > > > > -- > > > "You can't wake a person who is pretending to be > > > asleep." > > > > > > ~Native Proverb~ > > > > > > "Each man is good in His sight. It is not > necessary > > > for eagles to be crows." > > > > > > ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ > > > > > > > > > - > > > To unsubscribe, e-mail: > > > [EMAIL PROTECTED] > > > For additional commands, e-
Re: LookupDispatchAction problem with double byte resource files - working with DisplayTag ?
I notice that your original question had to do with multiple submit buttons, but that your code here only has one submit button. You cannot necessarily take a solution for one problem and use if for others. I don't know about the display tag, so I am not sure if you are doing the right thing here. I don't have time to look at it in further detail at this time. Jack On Fri, 29 Oct 2004 19:46:53 -0700 (PDT), lixin chu <[EMAIL PROTECTED]> wrote: > hi jack, > thanks, the solution is cool ! I am trying it. > > a small problem i am experiencing now is that (i am > not sure if there is something wrong in my > configuration), the parameter on one page is passed on > to the next page, so when we getMethod, the earlier > method name is returned. > > I have one 'Search Template' page, which gets the > search criteria and then pass the results to the > ListTemplate.jsp page after pressing the Search button > (it is associated with the 'search.dispatch' > parameter). The 'list parameter' page has a sortable > table (i am using DisplayTag): > > > pagesize="10" >id="templates" >sort="list" export="true" >requestURI="/Canal/admin/ListTemplate.do? >sort.dispatch"> > > value="true"/> > > name="value( property="id"/>)" value="x"/> > > sortable="true" >href="TemplateManager.do?prepare.dispatch" >paramId="templateID" paramProperty="id"/> >property="category.name" sortable="true" >href="TemplateManager.do?prepare.dispatch" >paramId="templateID" paramProperty="id"/> > > > > > > > > > the problem is that the additional > search.dispatch=Search is inserted into the requestURI > when I 'view source'. I have no idea. > > I am not sure if it is the DisplayTag limitation > though ... > > thanks > li xin > > --- Dakota Jack <[EMAIL PROTECTED]> wrote: > > > All of your problems are caused because > > LookupDispatchAction creates a > > reverse mapping from the value of a parameter to its > > key, in order to > > get the method name. This is not only resource > > intensive but also a > > constant source of the sorts of difficulties you are > > experiencing. You > > can find what are better alternatives in various > > places. Some of them > > are itemized at > > http://www.michaelmcgrady.com/button/ . > > > > Jack > > > > > > On Wed, 27 Oct 2004 22:17:56 -0600, Kumar V Kadiyala > > <[EMAIL PROTECTED]> wrote: > > > Hi all, > > > > > > I'm using LookupDispatchAction to submit a form > > with multiple submit > > > buttons. The labels of the buttons are translated. > > The translated strings > > > are in a .properties file. I'm able to run the web > > app fine in English but > > > when I switch to Korean none of the the submit > > buttons work and I see the > > > following message in the log. > > > [10/27/04 21:40:39:631 MDT] 67f967f9 DispatchActio > > E > > > org.apache.struts.actions.DispatchAction > > Request[/tag] does not contain > > > handler parameter named method > > > > > > The Korean .properties was converted to ascii > > (using nativetoascii) from > > > its native encoding. Does this have to do anything > > with what I'm noticing? > > > Should something additional be done when > > .properties files are coverted to > > > ascii? > > > > > > Help appreciated, > > > Kumar > > > > > > > > > -- > > "You can't wake a person who is pretending to be > > asleep." > > > > ~Native Proverb~ > > > > "Each man is good in His sight. It is not necessary > > for eagles to be crows." > > > > ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ > > > > > - > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > __ > Do you Yahoo!? > Yahoo! Mail - Helps protect you from nasty viruses. > http://promotions.yahoo.com/new_mail > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- "You can't wake a person who is pretending to be asleep." ~Native Proverb~ "Each man is good in His sight. It is not necessary for eagles to be crows." ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction problem with double byte resource files - working with DisplayTag ?
You do not have to use the parameter at all to do this. Just use the name for the submit with .dispatch. Go back to the website I noted to you and you will see. The DispatchAction there is a complete substitute not for DispatchAction but for DispatchAction, LookupDispatchAction and the other other dispatch action in struts whose name I have forgotten. Anyway, with that you don't need the parameter value or to use struts-config at all, except for other issues with respect to action mapping. Jack On Fri, 29 Oct 2004 19:46:53 -0700 (PDT), lixin chu <[EMAIL PROTECTED]> wrote: > hi jack, > thanks, the solution is cool ! I am trying it. > > a small problem i am experiencing now is that (i am > not sure if there is something wrong in my > configuration), the parameter on one page is passed on > to the next page, so when we getMethod, the earlier > method name is returned. > > I have one 'Search Template' page, which gets the > search criteria and then pass the results to the > ListTemplate.jsp page after pressing the Search button > (it is associated with the 'search.dispatch' > parameter). The 'list parameter' page has a sortable > table (i am using DisplayTag): > > > pagesize="10" >id="templates" >sort="list" export="true" >requestURI="/Canal/admin/ListTemplate.do? >sort.dispatch"> > > value="true"/> > > name="value( property="id"/>)" value="x"/> > > sortable="true" >href="TemplateManager.do?prepare.dispatch" >paramId="templateID" paramProperty="id"/> >property="category.name" sortable="true" >href="TemplateManager.do?prepare.dispatch" >paramId="templateID" paramProperty="id"/> > > > > > > > > > the problem is that the additional > search.dispatch=Search is inserted into the requestURI > when I 'view source'. I have no idea. > > I am not sure if it is the DisplayTag limitation > though ... > > thanks > li xin > > --- Dakota Jack <[EMAIL PROTECTED]> wrote: > > > All of your problems are caused because > > LookupDispatchAction creates a > > reverse mapping from the value of a parameter to its > > key, in order to > > get the method name. This is not only resource > > intensive but also a > > constant source of the sorts of difficulties you are > > experiencing. You > > can find what are better alternatives in various > > places. Some of them > > are itemized at > > http://www.michaelmcgrady.com/button/ . > > > > Jack > > > > > > On Wed, 27 Oct 2004 22:17:56 -0600, Kumar V Kadiyala > > <[EMAIL PROTECTED]> wrote: > > > Hi all, > > > > > > I'm using LookupDispatchAction to submit a form > > with multiple submit > > > buttons. The labels of the buttons are translated. > > The translated strings > > > are in a .properties file. I'm able to run the web > > app fine in English but > > > when I switch to Korean none of the the submit > > buttons work and I see the > > > following message in the log. > > > [10/27/04 21:40:39:631 MDT] 67f967f9 DispatchActio > > E > > > org.apache.struts.actions.DispatchAction > > Request[/tag] does not contain > > > handler parameter named method > > > > > > The Korean .properties was converted to ascii > > (using nativetoascii) from > > > its native encoding. Does this have to do anything > > with what I'm noticing? > > > Should something additional be done when > > .properties files are coverted to > > > ascii? > > > > > > Help appreciated, > > > Kumar > > > > > > > > > -- > > "You can't wake a person who is pretending to be > > asleep." > > > > ~Native Proverb~ > > > > "Each man is good in His sight. It is not necessary > > for eagles to be crows." > > > > ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ > > > > > - > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > __ > Do you Yahoo!? > Yahoo! Mail - Helps protect you from nasty viruses. > http://promotions.yahoo.com/new_mail > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- "You can't wake a person who is pretending to be asleep." ~Native Proverb~ "Each man is good in His sight. It is not necessary for eagles to be crows." ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction problem with double byte resource files - working with DisplayTag ?
hi jack, thanks, the solution is cool ! I am trying it. a small problem i am experiencing now is that (i am not sure if there is something wrong in my configuration), the parameter on one page is passed on to the next page, so when we getMethod, the earlier method name is returned. I have one 'Search Template' page, which gets the search criteria and then pass the results to the ListTemplate.jsp page after pressing the Search button (it is associated with the 'search.dispatch' parameter). The 'list parameter' page has a sortable table (i am using DisplayTag): )" value="x"/> the problem is that the additional search.dispatch=Search is inserted into the requestURI when I 'view source'. I have no idea. I am not sure if it is the DisplayTag limitation though ... thanks li xin --- Dakota Jack <[EMAIL PROTECTED]> wrote: > All of your problems are caused because > LookupDispatchAction creates a > reverse mapping from the value of a parameter to its > key, in order to > get the method name. This is not only resource > intensive but also a > constant source of the sorts of difficulties you are > experiencing. You > can find what are better alternatives in various > places. Some of them > are itemized at > http://www.michaelmcgrady.com/button/ . > > Jack > > > On Wed, 27 Oct 2004 22:17:56 -0600, Kumar V Kadiyala > <[EMAIL PROTECTED]> wrote: > > Hi all, > > > > I'm using LookupDispatchAction to submit a form > with multiple submit > > buttons. The labels of the buttons are translated. > The translated strings > > are in a .properties file. I'm able to run the web > app fine in English but > > when I switch to Korean none of the the submit > buttons work and I see the > > following message in the log. > > [10/27/04 21:40:39:631 MDT] 67f967f9 DispatchActio > E > > org.apache.struts.actions.DispatchAction > Request[/tag] does not contain > > handler parameter named method > > > > The Korean .properties was converted to ascii > (using nativetoascii) from > > its native encoding. Does this have to do anything > with what I'm noticing? > > Should something additional be done when > .properties files are coverted to > > ascii? > > > > Help appreciated, > > Kumar > > > > > -- > "You can't wake a person who is pretending to be > asleep." > > ~Native Proverb~ > > "Each man is good in His sight. It is not necessary > for eagles to be crows." > > ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > __ Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty viruses. http://promotions.yahoo.com/new_mail - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction problem with double byte resource files
All of your problems are caused because LookupDispatchAction creates a reverse mapping from the value of a parameter to its key, in order to get the method name. This is not only resource intensive but also a constant source of the sorts of difficulties you are experiencing. You can find what are better alternatives in various places. Some of them are itemized at http://www.michaelmcgrady.com/button/ . Jack On Wed, 27 Oct 2004 22:17:56 -0600, Kumar V Kadiyala <[EMAIL PROTECTED]> wrote: > Hi all, > > I'm using LookupDispatchAction to submit a form with multiple submit > buttons. The labels of the buttons are translated. The translated strings > are in a .properties file. I'm able to run the web app fine in English but > when I switch to Korean none of the the submit buttons work and I see the > following message in the log. > [10/27/04 21:40:39:631 MDT] 67f967f9 DispatchActio E > org.apache.struts.actions.DispatchAction Request[/tag] does not contain > handler parameter named method > > The Korean .properties was converted to ascii (using nativetoascii) from > its native encoding. Does this have to do anything with what I'm noticing? > Should something additional be done when .properties files are coverted to > ascii? > > Help appreciated, > Kumar > -- "You can't wake a person who is pretending to be asleep." ~Native Proverb~ "Each man is good in His sight. It is not necessary for eagles to be crows." ~Hunkesni (Sitting Bull), Hunkpapa Sioux~ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction (Newbie)
LOL -- There is nothing, as well, wrong with Leandro's decision to use versus to the same end. The only reason I suggest it my way with submits, which I don't use anyway, is that it gives the same logic for image and submit buttons. Actually, what I do is: This is a tag which creates an image button as indicated. The actual HTML in this case ends up as: The weird "src" attribute code is on the Struts wiki too as http://wiki.apache.org/struts/StrutsCatalogEschewUrlForProtocol and is unnecessary. I have recently discovered a way to use images for file uploads and will soon provide an open source solution to the dynamic generation of images for any use whatsoever. The tag caches images after use. The only thing you have to do with the tag is to provide the values given to the image button in the "button" attribute in your ApplicationResources.properties file. (The tag is i18n enabled.) This is a tag which creates an image button as indicated. The actual HTML in this case ends up as:I have recently discovered a way to use images with downloading files, and will soon offer an open source solution generally for the dynamic generation of images Paul McCulloch wrote: Doh! Cheers, Paul -Original Message- From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent: Friday, August 27, 2004 3:23 PM To: Struts Users Mailing List Subject: Re: LookupDispatchAction (Newbie) I just assumed on the wiki that people would extend to submit as follows: I will amend the wiki to reflect that possibility. This just mimics the functionality of the tag. Michael Paul McCulloch wrote: I'm confused. Looking at the wiki (ImageTagUtil class) it seems that a non null command will only be returned if there is a request parameter with name ending in ".x". My understanding of html is that only type="image" .../> tags send the x & y coordinates to the server in submission. What am I missing? Thanks, Paul -Original Message- From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent: Friday, August 27, 2004 2:54 PM To: Struts Users Mailing List Subject: Re: LookupDispatchAction (Newbie) Paul McCulloch wrote: Am I right in thinking that your solution works for image buttons, whereas the LookupDispatchAction is for text labeled buttons? Paul No, my solution works for both, Paul. The code mined is decoupled entirely from the display. Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] * * Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. * * - 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] ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should d
RE: LookupDispatchAction (Newbie)
Doh! Cheers, Paul > -Original Message- > From: Michael McGrady [mailto:[EMAIL PROTECTED] > Sent: Friday, August 27, 2004 3:23 PM > To: Struts Users Mailing List > Subject: Re: LookupDispatchAction (Newbie) > > > I just assumed on the wiki that people would extend to submit > as follows: > > > > > > > > > > I will amend the wiki to reflect that possibility. This just > mimics the > functionality of the tag. > > Michael > > Paul McCulloch wrote: > > >I'm confused. Looking at the wiki (ImageTagUtil class) it > seems that a non > >null command will only be returned if there is a request > parameter with name > >ending in ".x". My understanding of html is that only type="image" > >.../> tags send the x & y coordinates to the server in submission. > > > >What am I missing? > > > >Thanks, > > > >Paul > > > > > > > > > >>-Original Message- > >>From: Michael McGrady [mailto:[EMAIL PROTECTED] > >>Sent: Friday, August 27, 2004 2:54 PM > >>To: Struts Users Mailing List > >>Subject: Re: LookupDispatchAction (Newbie) > >> > >> > >>Paul McCulloch wrote: > >> > >> > >> > >>>Am I right in thinking that your solution works for image > >>> > >>> > >>buttons, whereas > >> > >> > >>>the LookupDispatchAction is for text labeled buttons? > >>> > >>>Paul > >>> > >>> > >>> > >>No, my solution works for both, Paul. The code mined is decoupled > >>entirely from the display. > >> > >>Michael > >> > >> > >> > - > >>To unsubscribe, e-mail: [EMAIL PROTECTED] > >>For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > >> > > > > > >* > * > >Axios Email Confidentiality Footer > >Privileged/Confidential Information may be contained in this > message. If you are not the addressee indicated in this > message (or responsible for delivery of the message to such > person), you may not copy or deliver this message to anyone. > In such case, you should destroy this message, and notify us > immediately. If you or your employer does not consent to > Internet email messages of this kind, please advise us > immediately. Opinions, conclusions and other information > expressed in this message are not given or endorsed by my > Company or employer unless otherwise indicated by an > authorised representative independent of this message. > >WARNING: > >While Axios Systems Ltd takes steps to prevent computer > viruses from being transmitted via electronic mail > attachments we cannot guarantee that attachments do not > contain computer virus code. You are therefore strongly > advised to undertake anti virus checks prior to accessing the > attachment to this electronic mail. Axios Systems Ltd grants > no warranties regarding performance use or quality of any > attachment and undertakes no liability for loss or damage > howsoever caused. > >* > * > > > > > >- > >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] > ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction (Newbie)
I misunderstood your solution, Leandro. I thought you were talking about the "method" that is an attribute in the tag. Sorry! Your solution is the same, of course. Michael Leandro Melo wrote: Michael, i`d preffer to do it the way i described. Having all "submit" buttons with the it`s name beeing "method" por exemplo, and then checking if the return of getName() is null. If it is -> String methodName request.getParameter("method") dipatchMethod(..., methodName); --- Michael McGrady <[EMAIL PROTECTED]> escreveu: I just assumed on the wiki that people would extend to submit as follows: I will amend the wiki to reflect that possibility. This just mimics the functionality of the tag. Michael Paul McCulloch wrote: I'm confused. Looking at the wiki (ImageTagUtil class) it seems that a non null command will only be returned if there is a request parameter with name ending in ".x". My understanding of html is that only .../> tags send the x & y coordinates to the server in submission. What am I missing? Thanks, Paul -Original Message- From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent: Friday, August 27, 2004 2:54 PM To: Struts Users Mailing List Subject: Re: LookupDispatchAction (Newbie) Paul McCulloch wrote: Am I right in thinking that your solution works for image buttons, whereas the LookupDispatchAction is for text labeled buttons? Paul No, my solution works for both, Paul. The code mined is decoupled entirely from the display. Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. ** - 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] __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - 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: LookupDispatchAction (Newbie)
Michael, i`d preffer to do it the way i described. Having all "submit" buttons with the it`s name beeing "method" por exemplo, and then checking if the return of getName() is null. If it is -> String methodName request.getParameter("method") dipatchMethod(..., methodName); --- Michael McGrady <[EMAIL PROTECTED]> escreveu: > I just assumed on the wiki that people would extend > to submit as follows: > > > > > value='add'> > value='delete'> > > > > I will amend the wiki to reflect that possibility. > This just mimics the > functionality of the tag. > > Michael > > Paul McCulloch wrote: > > >I'm confused. Looking at the wiki (ImageTagUtil > class) it seems that a non > >null command will only be returned if there is a > request parameter with name > >ending in ".x". My understanding of html is that > only >.../> tags send the x & y coordinates to the server > in submission. > > > >What am I missing? > > > >Thanks, > > > >Paul > > > > > > > > > >>-Original Message- > >>From: Michael McGrady > [mailto:[EMAIL PROTECTED] > >>Sent: Friday, August 27, 2004 2:54 PM > >>To: Struts Users Mailing List > >>Subject: Re: LookupDispatchAction (Newbie) > >> > >> > >>Paul McCulloch wrote: > >> > >> > >> > >>>Am I right in thinking that your solution works > for image > >>> > >>> > >>buttons, whereas > >> > >> > >>>the LookupDispatchAction is for text labeled > buttons? > >>> > >>>Paul > >>> > >>> > >>> > >>No, my solution works for both, Paul. The code > mined is decoupled > >>entirely from the display. > >> > >>Michael > >> > >> > >>- > >>To unsubscribe, e-mail: > [EMAIL PROTECTED] > >>For additional commands, e-mail: > [EMAIL PROTECTED] > >> > >> > >> > > > > > >** > >Axios Email Confidentiality Footer > >Privileged/Confidential Information may be > contained in this message. If you are not the > addressee indicated in this message (or responsible > for delivery of the message to such person), you may > not copy or deliver this message to anyone. In such > case, you should destroy this message, and notify us > immediately. If you or your employer does not > consent to Internet email messages of this kind, > please advise us immediately. Opinions, conclusions > and other information expressed in this message are > not given or endorsed by my Company or employer > unless otherwise indicated by an authorised > representative independent of this message. > >WARNING: > >While Axios Systems Ltd takes steps to prevent > computer viruses from being transmitted via > electronic mail attachments we cannot guarantee that > attachments do not contain computer virus code. You > are therefore strongly advised to undertake anti > virus checks prior to accessing the attachment to > this electronic mail. Axios Systems Ltd grants no > warranties regarding performance use or quality of > any attachment and undertakes no liability for loss > or damage howsoever caused. > >** > > > > > >- > >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] > > __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction (Newbie)
Leandro Melo wrote: In my application, i decided to make of my submissions that go for Actions must have the parameter "method=nameOfMethodToBeCalled" in the cases the submissions don`t came from image buttons. This is way too complicated, Leandro. Just do the following and use the solution I gave you with images. KISS! Or, is it KIZZ and MAKEUP? LOL Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction (Newbie)
I added a http://wiki.apache.org/struts/StrutsCatalogMultipleSubmitTagsSimplified to the wiki which links to the http://wiki.apache.org/struts/StrutsCatalogMultipleImageTagsSimplified which now provides a note to this solution as well in the title of the wiki. Michael Michael McGrady wrote: I just assumed on the wiki that people would extend to submit as follows: I will amend the wiki to reflect that possibility. This just mimics the functionality of the tag. Michael Paul McCulloch wrote: I'm confused. Looking at the wiki (ImageTagUtil class) it seems that a non null command will only be returned if there is a request parameter with name ending in ".x". My understanding of html is that only .../> tags send the x & y coordinates to the server in submission. What am I missing? Thanks, Paul -Original Message- From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent: Friday, August 27, 2004 2:54 PM To: Struts Users Mailing List Subject: Re: LookupDispatchAction (Newbie) Paul McCulloch wrote: Am I right in thinking that your solution works for image buttons, whereas the LookupDispatchAction is for text labeled buttons? Paul No, my solution works for both, Paul. The code mined is decoupled entirely from the display. Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. ** - 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]
Re: LookupDispatchAction (Newbie)
I just assumed on the wiki that people would extend to submit as follows: I will amend the wiki to reflect that possibility. This just mimics the functionality of the tag. Michael Paul McCulloch wrote: I'm confused. Looking at the wiki (ImageTagUtil class) it seems that a non null command will only be returned if there is a request parameter with name ending in ".x". My understanding of html is that only tags send the x & y coordinates to the server in submission. What am I missing? Thanks, Paul -Original Message- From: Michael McGrady [mailto:[EMAIL PROTECTED] Sent: Friday, August 27, 2004 2:54 PM To: Struts Users Mailing List Subject: Re: LookupDispatchAction (Newbie) Paul McCulloch wrote: Am I right in thinking that your solution works for image buttons, whereas the LookupDispatchAction is for text labeled buttons? Paul No, my solution works for both, Paul. The code mined is decoupled entirely from the display. Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. ** - 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: LookupDispatchAction (Newbie)
I gues the point of the ImageTagUtil class is specially for use with "submit" image buttons. However you can do build your wokraround for use in any cases. In my case for example, here`s what i do. In my application, i decided to make of my submissions that go for Actions must have the parameter "method=nameOfMethodToBeCalled" in the cases the submissions don`t came from image buttons. Then i if the ImateTagUtil class returns null for the name of the button, i get the parameter "method" and dispatches to the specific method. --- Paul McCulloch <[EMAIL PROTECTED]> escreveu: > I'm confused. Looking at the wiki (ImageTagUtil > class) it seems that a non > null command will only be returned if there is a > request parameter with name > ending in ".x". My understanding of html is that > only .../> tags send the x & y coordinates to the server > in submission. > > What am I missing? > > Thanks, > > Paul > > > > -Original Message- > > From: Michael McGrady > [mailto:[EMAIL PROTECTED] > > Sent: Friday, August 27, 2004 2:54 PM > > To: Struts Users Mailing List > > Subject: Re: LookupDispatchAction (Newbie) > > > > > > Paul McCulloch wrote: > > > > >Am I right in thinking that your solution works > for image > > buttons, whereas > > >the LookupDispatchAction is for text labeled > buttons? > > > > > >Paul > > > > > > > No, my solution works for both, Paul. The code > mined is decoupled > > entirely from the display. > > > > Michael > > > > > > > - > > To unsubscribe, e-mail: > [EMAIL PROTECTED] > > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > ** > Axios Email Confidentiality Footer > Privileged/Confidential Information may be contained > in this message. If you are not the addressee > indicated in this message (or responsible for > delivery of the message to such person), you may not > copy or deliver this message to anyone. In such > case, you should destroy this message, and notify us > immediately. If you or your employer does not > consent to Internet email messages of this kind, > please advise us immediately. Opinions, conclusions > and other information expressed in this message are > not given or endorsed by my Company or employer > unless otherwise indicated by an authorised > representative independent of this message. > WARNING: > While Axios Systems Ltd takes steps to prevent > computer viruses from being transmitted via > electronic mail attachments we cannot guarantee that > attachments do not contain computer virus code. You > are therefore strongly advised to undertake anti > virus checks prior to accessing the attachment to > this electronic mail. Axios Systems Ltd grants no > warranties regarding performance use or quality of > any attachment and undertakes no liability for loss > or damage howsoever caused. > ** > > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: LookupDispatchAction (Newbie)
I'm confused. Looking at the wiki (ImageTagUtil class) it seems that a non null command will only be returned if there is a request parameter with name ending in ".x". My understanding of html is that only tags send the x & y coordinates to the server in submission. What am I missing? Thanks, Paul > -Original Message- > From: Michael McGrady [mailto:[EMAIL PROTECTED] > Sent: Friday, August 27, 2004 2:54 PM > To: Struts Users Mailing List > Subject: Re: LookupDispatchAction (Newbie) > > > Paul McCulloch wrote: > > >Am I right in thinking that your solution works for image > buttons, whereas > >the LookupDispatchAction is for text labeled buttons? > > > >Paul > > > > No, my solution works for both, Paul. The code mined is decoupled > entirely from the display. > > Michael > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction (Newbie)
Paul McCulloch wrote: Am I right in thinking that your solution works for image buttons, whereas the LookupDispatchAction is for text labeled buttons? Paul No, my solution works for both, Paul. The code mined is decoupled entirely from the display. Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: LookupDispatchAction (Newbie)
Am I right in thinking that your solution works for image buttons, whereas the LookupDispatchAction is for text labeled buttons? Paul > -Original Message- > From: Michael McGrady [mailto:[EMAIL PROTECTED] > Sent: Friday, August 27, 2004 2:35 PM > To: Struts Users Mailing List > Subject: Re: LookupDispatchAction (Newbie) > > > Once you see how LookupDispatchAction works, you should also > see that it > is an unnecessarily complicated solution. Try > http://wiki.apache.org/struts/StrutsCatalogMultipleImageTagsSi > mplified > which shows that all you have to do is: > > String button = null; > Enumeration enum = request.getParameterNames(); > String parameterName = null; > while(enum.hasMoreElements()) { > parameterName = (String)enum.nextElement(); > if(parameterName.endsWith(".x")) { > button = > parameterName.substring(0,parameterName.indexOf('.')); > } > > } > > Isn't that a great deal simpler? If you want to solve it > with a class, > then do somethin like: > > *public class ImageTagUtil { > public static String getName(HttpServletRequest request) { > String command = null; > String buttonValue = null; > Enumeration enum = request.getParameterNames(); > > while(enum.hasMoreElements()) { > buttonValue = (String)enum.nextElement(); > if(buttonValue.endsWith(".x")) { > command = buttonValue.substring(0,buttonValue.indexOf('.')); > } > } > return command; > } > }* > > However, if you love the complications, essentially the idea > is to put > the paramter value together with method names in order to map the > buttons to methods. So, if you have buttons returning button.add and > button.delete, your parameter value will be "button". Once you know > that the parameter is button, then you can search for button.? and ? > will be the method name. This is a totally unnecessary complication, > since we already have .x and .y at the end so generously > supplied by the > standard HTML. So the above code does the same thing without > tying the > solution to the parameter value, which frees the parameter value for > other uses and which decouples the solution from struts. > > Regards, > > Michael > > > > > > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > ** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. ** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction (Newbie)
Once you see how LookupDispatchAction works, you should also see that it is an unnecessarily complicated solution. Try http://wiki.apache.org/struts/StrutsCatalogMultipleImageTagsSimplified which shows that all you have to do is: String button = null; Enumeration enum = request.getParameterNames(); String parameterName = null; while(enum.hasMoreElements()) { parameterName = (String)enum.nextElement(); if(parameterName.endsWith(".x")) { button = parameterName.substring(0,parameterName.indexOf('.')); } } Isn't that a great deal simpler? If you want to solve it with a class, then do somethin like: *public class ImageTagUtil { public static String getName(HttpServletRequest request) { String command = null; String buttonValue = null; Enumeration enum = request.getParameterNames(); while(enum.hasMoreElements()) { buttonValue = (String)enum.nextElement(); if(buttonValue.endsWith(".x")) { command = buttonValue.substring(0,buttonValue.indexOf('.')); } } return command; } }* However, if you love the complications, essentially the idea is to put the paramter value together with method names in order to map the buttons to methods. So, if you have buttons returning button.add and button.delete, your parameter value will be "button". Once you know that the parameter is button, then you can search for button.? and ? will be the method name. This is a totally unnecessary complication, since we already have .x and .y at the end so generously supplied by the standard HTML. So the above code does the same thing without tying the solution to the parameter value, which frees the parameter value for other uses and which decouples the solution from struts. Regards, Michael - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction (Newbie)
http://struts.apache.org/api/org/apache/struts/actions/LookupDispatchAction.html Bill Siggelkow Varley, Roger wrote: Hi I have implemented a LookupDispatchAction action class to deal with a form that contains multiple submit buttons as outlined in the sample chapter from "The Struts Survival Guide" at http://www.objectsource.com/Chapter4.pdf I've got everything working but I would be grateful if someone could either explain or point me to documentation explaining, *why* it works? Regards Roger __ This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Atos Origin group liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted. __ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction (Newbie)
A quick look at the DispatchAction source (if you don`t have the source, you can download it) would the best way for you to understand. It`s not that complicated. I never took a detailed look at the source, but basically, it gets the mapping for the method specified in struts-config.xml and then get the value of this parameter. After that it dispatches the request to the specifc method a calling to dispatchMethod() method. --- "Varley, Roger" <[EMAIL PROTECTED]> escreveu: > Hi > > I have implemented a LookupDispatchAction action > class to deal with a form that contains multiple > submit buttons as outlined in the sample chapter > from "The Struts Survival Guide" at > http://www.objectsource.com/Chapter4.pdf I've got > everything working but I would be grateful if > someone could either explain or point me to > documentation explaining, *why* it works? > > Regards > Roger > > > __ > This e-mail and the documents attached are > confidential and intended > solely for the addressee; it may also be privileged. > If you receive this > e-mail in error, please notify the sender > immediately and destroy it. > As its integrity cannot be secured on the Internet, > the Atos Origin group > liability cannot be triggered for the message > content. Although the > sender endeavours to maintain a computer virus-free > network, the sender > does not warrant that this transmission is > virus-free and will not be > liable for any damages resulting from any virus > transmitted. > __ > > - > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > ___ Yahoo! Acesso Grátis - navegue de graça com conexão de qualidade! http://br.acesso.yahoo.com/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction and html:image
--- Darryl Smith <[EMAIL PROTECTED]> wrote: > Has anyone got the two to work together? > In my ApplicationResources.properties file, I have entries such as: lookupDispatchParameter=action button.signin=Sign In button.image.signin=/images/standardButtons2/signin.gif My header.jsp file makes this Javascript function available on every page: function set(f, v) { f..value = v; } I include this at the top of each form: And my buttons look like this: ');"/> - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: LookupDispatchAction and html:image
This may help, although its a modification of DispatchAction not LookupDispatchAction http://issues.apache.org/bugzilla/show_bug.cgi?id=19925 robert > -Original Message- > From: Darryl Smith [mailto:[EMAIL PROTECTED] > Sent: Friday, July 09, 2004 11:22 AM > To: Struts Users Mailing List > Subject: LookupDispatchAction and html:image > > > Has anyone got the two to work together? > > - > 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: LookupDispatchAction Error When Pressing Enter Key
Hmm .. I just tested using a LookupDispatchAction and Firefox 0.9 -- I found that when I pressed Enter it submitted using the first submit button defined. That being said, you can override the "unspecified" method of DispatchAction -- this method will be called instead of a ServletException being thrown if an unknown or empty method is received. Rodney Paul wrote: Hi All, I have a problem in regards to the LookupDispatchAction Struts class. My problem is in regards to a user pressing the "Enter" key on a keyboard. In this scenario, a form submit has been activated via html, with no submit buttons having been pressed. When Struts see's this, the Struts engine displays a java error indicating that the parameter being used for lookup's doesnt exist in the request. Now is there a way of indicating to Struts that if the user presses the "Enter" key a default action will occur. In other words, without using Javascript for trapping the "Enter" key, is there a way to tell struts to execute a default method if the user presses the "Enter" key. In particular a descriptor value indicating the default method to execute. If possible could anyone help me with a solution to this problem. Cheers Rodney Paul ps. Could Ted Husted please have a look at this. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: LookupDispatchAction Default Action
The easy answer is that you can have your framework do whatever you want it to do when it receives a URL. If the URL is directed to the Struts ActionServlet by your server, you can also code further choices, etc. there. At 08:33 PM 6/27/2004, Rodney Paul wrote: Hi All, I have a problem in regards to the LookupDispatchAction Struts class. My problem is in regards to a user pressing the "Enter" key on a keyboard. In this scenario, a form submit has been activated via html, with no submit buttons having been pressed. When Struts see's this, the Struts engine displays a java error indicating that the parameter being used for lookup's doesnt exist in the request. Now is there a way of indicating to Struts that if the user presses the "Enter" key a default action will occur. In other words, without using Javascript for trapping the "Enter" key, is there a way to tell struts to execute a default method if the user presses the "Enter" key. In particular a descriptor value indicating the default method to execute. If possible could anyone help me with a solution to this problem. Cheers Rodney Paul ps. Could Ted Husted please have a look at this. - 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: LookupDispatchAction and Form validation + DispatchAction
Another way is to check which dispatch action is being activated and then run validation or not depending on which action is being run. e.g. /foo.do?method=save mapping.getParameter() return the name of the parameter used to dispatch with. In this case "method" request.getParameter(mapping.getParameter()) returns the value in the parameter map for the dispatch in this case "save" you can then check if in this is a dispatchaction you wish to validate and go from there. You can call super.validate() to use validations in the validation.xml file, although I have a personal preference to just use action form and validate using java (old struts 1.0) rather than use validator framework as I think it has greater clarity than using the validator. I originally learnt this here posted by Haroon Rafique http://raibledesigns.com/wiki/Wiki.jsp?page=ValidatorDispatchAction ActionErrors errors = new ActionErrors(); String parameter = mapping.getParameter(); if(parameter == null) { return null; } /* we only need to validate when the save method is called */ if(parameter != null) { String name = request.getParameter(parameter); String message = Resources.getMessage(request,"button.save"); if(name == null || !name.equals(message)) { return null; } } //rest of the validations here The reference provides a means of using the validator framework, which I just cant be bothered with anymore as IMO overriding the validate method is a lot clearer in terms of design what the action form is for, and when you need to validate uploads or other more complex validations everything is in the same place. The disadvantages of what I do is that you don't have the javascript generated for you, and validation is harder to palm off on a site builder (this would depend on who in your team deals with this stuff). There are other advantages to using action forms over dynaaction forms that go beyond the scope of this response. Mark On 16 Jun 2004, at 03:40, Niall Pemberton wrote: DynaValidatorForm has been refactored slightly to make it easier to override the key to use for the validator plugin (available in the nightlies and will be in next release of Struts). If you extend DynaValidatorForm and override the getValidationKey() method maybe you could use combination of the form and method name for the validator plugin rules. For an example of this look at DynaValidatorActionForm: http://cvs.apache.org/viewcvs.cgi/jakarta-struts/src/share/org/apache/ struts/validator/ Niall - Original Message - From: "Josh Holtzman" <[EMAIL PROTECTED]> To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]> Sent: Tuesday, June 15, 2004 10:18 PM Subject: RE: LookupDispatchAction and Form validation + DispatchAction David, I too am having a similar concern, albeit, with the DispatchAction class. I am currently have a form that is backed by a DynaActionForm and validation occurs through the Validator pluggin. When binding the validation routine to the action by specifying "validate='true'" in my Action configuration (within the struts-config.xml file) I believe it will run my validation against all methods called within the DispatchAction class for this action. In my situation, I only want the validation to be performed on 2 of the 6 methods within my DispatchAction class. Is there a way to do this while still using the Validator Pluggin and a DynaActionForm? Here are some alternatives I have devised: 1. Create 1 DispatchAction class to handle the two methods with validation, and 1 for all other methods. 2. Do not use the Validator pluggin, and perform validation within the DispatchAction class only when the specific methods are called. I don't like either of these options very much (particularly number 2) since they require a significant increase in maintenance. Any suggestions would be greatly appreciated. Thanks. Josh Holtzman AMERICAN DATA COMPANY Developing and Supporting your Online Applications [EMAIL PROTECTED] Voice: (310) 470-1257 Fax:(310) 362-8454 Sun Microsystems iForce Partner -Original Message- From: Ellingson, David [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 15, 2004 1:50 PM To: '[EMAIL PROTECTED]' Subject: LookupDispatchAction and Form validation I am trying to implement a LookupDispatchAction class, and I'm not sure if I'm trying to use Form validation in an unintended manner. I see that the LookupDispatchAction class is designed to handle multiple methods, bu