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. Hi. I have implemented the code and controls just
View Tutorial          By: eibod at 2011-02-13 04:58:44

2. sir, in this example,which value of n is being sto
View Tutorial          By: shivom at 2012-01-15 07:16:49

3. Great stuff, learned more from this example than r
View Tutorial          By: David Bandelin at 2011-03-22 07:10:38

4. If the compiler takes care of this pointer implici
View Tutorial          By: Bhanu Noah at 2012-03-15 16:20:05

5. Your explanation is perfectly clear and not in nee
View Tutorial          By: Percy at 2009-06-08 14:14:39

6. I am new in Java and got good information to under
View Tutorial          By: Umesh Kumar at 2012-01-25 08:42:07

7. You only need 1 main method per application, not 1
View Tutorial          By: Michael at 2011-09-02 02:37:51

8. estimado lo que sucede es que solo cuando es Strin
View Tutorial          By: hormiga at 2013-01-07 00:11:54

9. Hi to every body,

I very new to con

View Tutorial          By: Srinivas at 2011-09-15 10:04:37

10. when i trying this code . i am getting this error<
View Tutorial          By: sharath at 2010-04-06 00:58:29