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. practical example of funcation overloding
View Tutorial          By: yogesh at 2010-12-19 08:39:06

2. very nice content
View Tutorial          By: sarat at 2012-08-22 12:17:26

3. i will make to try for rms :)
View Tutorial          By: sebo at 2010-05-20 07:38:28

4. Great Help...
View Tutorial          By: adity at 2012-04-27 05:34:26

5. hi..i can send 4 or 5 sms per mnt..is there any wa
View Tutorial          By: rahul at 2011-02-11 00:17:51

6. input can be taken simly with Console class

View Tutorial          By: Dinesh at 2012-06-29 11:18:23

7. Great Article! Thanks
View Tutorial          By: Rachid at 2011-06-21 13:01:39

8. Good Information... Plz give some more examples wi
View Tutorial          By: Uetian at 2010-04-01 04:26:55

9. no output as well, i'm getting portlist and portId
View Tutorial          By: raul at 2015-10-09 20:05:02

10. thankyou Mr Ramlak for your help but please can yo
View Tutorial          By: yash at 2008-05-12 16:46:18