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. Thanks !
View Tutorial          By: Swaran at 2010-02-02 23:50:13

2. Just used InstallCert.java successfully so that my
View Tutorial          By: Anthony Pelosi at 2009-12-30 15:52:17

3. Its really good.....
View Tutorial          By: Shivam at 2009-04-02 03:58:51

4. But the above code is not working, when we send SM
View Tutorial          By: SenthilPandi ChandraSekaran at 2011-06-08 07:22:31

5. @Srini

Hi Srini, I can answer your

View Tutorial          By: Sudev Wilson at 2015-04-08 12:23:33

6. Excellent
View Tutorial          By: Dev at 2008-08-01 02:41:25

7. Sir i am doing b.tech and i want to know about Gar
View Tutorial          By: waseem at 2010-10-10 01:28:42

8. I am developing a system for paying electric bill
View Tutorial          By: Isaya at 2007-03-26 01:11:59

9. can i use comma operator in simbolic constant in c
View Tutorial          By: Madheswaran at 2011-12-05 18:44:22

10. What is the difference between an Interface and an
View Tutorial          By: RAJA at 2015-06-26 17:28:31