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. lots of thanks for this given example........hope
View Tutorial          By: virgi crisostomo at 2010-08-18 17:18:08

2. very good description ,clear and simple
View Tutorial          By: swapnil at 2011-06-24 06:33:10

3. it is very useful to others............,thanx
View Tutorial          By: jey at 2012-01-06 08:53:22

4. Very nice tutorial. Hi Rintu for attachment u can
View Tutorial          By: ras at 2013-03-14 17:19:47

5. The synchronization schedule function has been red
View Tutorial          By: Kim at 2014-11-12 10:52:13

6. Thanks. Well explanation..
View Tutorial          By: Ebi Divakar at 2011-07-26 04:31:30

7. It was actually useful!!! Thanks for explaining in
View Tutorial          By: steph at 2010-01-28 21:59:06

8. Great examples Eric! Really helped me out a lot, m
View Tutorial          By: Markus at 2008-11-12 05:27:05

9. Thanks...Really nice...
View Tutorial          By: Raj at 2013-02-07 08:58:28

10. Thnx. Very Useful Code...
View Tutorial          By: Ankur Pandya at 2010-09-27 05:14:35