Share on Google+Share on Google+

chandramouli
Struts + HTML:Button not workin
1 Answer(s)      7 years ago
Posted in : Struts
Hi,

I am new to struts. So pls bare with me if my question is fundamental.
I am trying to add 2 Submit buttons in same JSP page.
As a start, i want to display a message when my actionclass is called.

JSP code
--------
<td><html:submit property="button_clicked">
<bean:message key="button.add"/></html:submit>
</td>
<td><html:submit property="button_clicked">
<bean:message key="button.delete"/></html:submit>
</td>

Actionclass
-----------
System.out.println(searchForm.get_button_Clicked());
The above statement displays "null";


I have defined button_clicked in bean class.
I thought when i click ADD button, button_clicked will be set to key of
"button.add" and i can check accordingly in action class.
But it displays null. Please let me know what needs to be corrected.
OR Should i use 2 HTML TAG BUTTON's here instead of 2 HTML TAG SUBMIT's?

Ads

View Answers

March 11, 2010 at 10:28 AM











Related Tutorials/Questions & Answers:
Tutorials   
Java Spring Hibernate Struts Training Dynamic tabs in struts 1.2 Unable to upload a file to mysql database using struts1 Pagination in struts 2 struts2 filterdispatcher is deprecated please use the new filters viewing How to add struts2 dependency in Maven? Struts Exception Handling can you check below code if any erors multimedia how to display the value of termcell name in label class not found exception Where to learn Struts 2? dropdown cacheing Upload and Download Large files in jsp What is Struts 2 framework struts and hibernate based health care project source code struts and hibernate based health care project source code Struts 2 Integration with Struts 1 About captcha of strut2 About captcha of strut2 Which is the good website for struts 2 tutorials? advance java source code source code In Struts 2 how to pass the Struts struts internationalization for Korean language struts2 Struts2 and Hibernate Fetch Data Base Value Struts2 and Hibernate Fetch Data Base Value Struts2 and Hibernate i want to create an application with only a button which on click displays table from database using struts2 and hibernate on eclipse Struts2 and Hibernate Struts2 and Hibernate Struts2 validation Procedure Struts2 validation Procedure Struts2 validation Procedure Struts2 validation Procedure Struts 2 action-validation.xml not loading Struts-2 and Ajax integration STRUTS QUESTION conerting web project into .exe file About Select tag ScartApplication aplicacion ecommerce struts 1.3 struts 1.3 sms prob Need to know struts1 all jar file names struts with hibernate

Ads

 
Advertisement null

Ads