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



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. Superb

many thanks to you Mashoud.

View Tutorial          By: orchidouest at 2009-05-10 12:58:53

2. Thanks for the digital shell clock: very cool, and
View Tutorial          By: Lol loller at 2012-04-11 15:40:45

3. Hi,
i am using crystal report 9. Once i ins

View Tutorial          By: jeff at 2012-02-12 08:14:15

4. Thanks a lot!!!

Its very useful exp

View Tutorial          By: dipali at 2012-12-31 06:49:41

5. The code runs successfully but, in actual the wasn
View Tutorial          By: Faisal at 2012-12-20 19:46:59

6. It worked. Thank U!
View Tutorial          By: Abhijit Kurane at 2010-12-27 11:01:48

7. hi i am studying java course.i am new to java, ple
View Tutorial          By: Rajeshkumar at 2011-11-14 08:30:29

8. hi.I am new in j2me and really want to learn more.
View Tutorial          By: grace at 2010-10-25 10:40:32

9. thanks for posting
View Tutorial          By: sriram at 2011-11-24 06:38:42

10. Right, so were is the tutorial files.zip?
O

View Tutorial          By: jeremy at 2011-10-24 15:58:40