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



Ask a Question

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. Really helpful way of explanation..And the example
View Tutorial          By: pavan at 2010-04-17 03:10:58

2. Its working ,but it overwrite the old one when run
View Tutorial          By: venkat at 2012-09-17 09:38:53

3. Please help I want to map the data say username an
View Tutorial          By: akshat at 2011-07-25 12:49:06

4. If I have reliance netconnect connected to my lapt
View Tutorial          By: Shaik Allabakash at 2010-02-09 19:38:10

5. Thanks for giving this basic example of Abstract c
View Tutorial          By: Yogendra Kirar at 2010-08-07 07:48:34

6. Please tell me the process, how to compile the mid
View Tutorial          By: Manish at 2008-11-14 13:33:43

7. good
View Tutorial          By: dock at 2013-06-07 15:18:49

8. Exception in thread "Thread-0" java.lang
View Tutorial          By: Ghulam Murtaza at 2012-12-12 06:43:58

9. Thanks for example..
But I have the same p

View Tutorial          By: Lina at 2009-05-02 13:23:33

10. The code gives the following exception :-
<

View Tutorial          By: VIKRAM at 2007-03-11 22:56:16