Comment on Tutorial - Handling multiple buttons in HTML Form in Struts By Charles



Comment Added by : Pierre

Comment Added at : 2009-11-19 20:16:35

Comment on Tutorial : Handling multiple buttons in HTML Form in Struts By Charles
Thanks for the solution. I must say however that this solution works ALL the time, including internationalized apps. Here is how to make it work:

1) in your JSP you refer to the resourceBundle to set the value of the submit button
(i.e. <bean:message key=”button.save”/>)

2) use the same value in your action.
e.g.
ResourceBundle res = ResourceBundle.getBundle("ApplicationResources",(Locale) request.getSession().getAttribute(Globals.LOCALE_KEY));

if(custForm.getStep().equals(res.getString("button.save"))){
//Do your stuff here
{

This way, the resource bundle will always give you the value corresponding to the locale.

Cheers,
Pierre


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. Hello Mr. Developer of above proj....plz let me kn
View Tutorial          By: Prakash Vishwakarma at 2011-07-08 10:02:22

2. Thanks!! This example was very helpful for me...
View Tutorial          By: Jonathas at 2010-03-11 07:47:51

3. very nice but i want some more exapmles
View Tutorial          By: prasad lengare at 2010-10-03 23:12:47

4. Good Luck....
View Tutorial          By: nagarajan at 2011-06-19 03:55:49

5. I don't get it... there seem to be only two differ
View Tutorial          By: bibiki at 2012-04-05 02:01:32

6. Dear Friend,
Your programs is like the one

View Tutorial          By: thomas at 2009-11-02 00:38:18

7. Abstract class example is good, What is the differ
View Tutorial          By: megakumar at 2011-04-10 04:15:10

8. Wow thx, this is really easy for me to understand
View Tutorial          By: brian at 2010-03-22 05:15:47

9. i just got to know about this and i am really imp
View Tutorial          By: spo_mega at 2009-06-11 07:16:38

10. Thank you very much.
View Tutorial          By: allcracked at 2013-09-11 19:10:20