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. Plz send me steps to configure and run project to
View Tutorial          By: sandeep kale at 2009-04-08 07:23:45

2. I'm getting the following error even after several
View Tutorial          By: Joe85 at 2011-03-18 08:58:04

3. good job.. i understand it clearly..
its in

View Tutorial          By: xmplexd at 2010-08-04 02:12:30

4. can i using stack in microsoft access 2007
View Tutorial          By: pxin at 2015-03-24 05:45:56

5. hello
thanks for your code
It works

View Tutorial          By: m_karimi at 2008-10-24 12:08:06

6. I am very comfortable with this example, its very
View Tutorial          By: Inam at 2010-11-07 03:04:46

7. i see that lots of people get this exception : jav
View Tutorial          By: oded at 2008-09-28 03:33:33

8. could anyone run this program on Netbean? If there
View Tutorial          By: Wei Long at 2008-06-16 19:23:48

9. Wow Its awesome.
Thank you for giving such

View Tutorial          By: sukumar maji at 2010-07-25 12:47:30

10. Can u show how to do text to speech with servlet.
View Tutorial          By: Rotika at 2011-01-23 20:54:40