wood burning stoves 2.0*
The moose likes Struts and the fly likes html:submit  setter not being called Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "html:submit  setter not being called" Watch "html:submit  setter not being called" New topic
Author

html:submit setter not being called

Steph DeGuire
Greenhorn

Joined: Aug 14, 2006
Posts: 2
Has anybody ever run into setter problems when you create a form which doesn't extend ActionForm directly?

I have XYZForm which extends CommonForm, which extends ButtonsForm which extends ActionForm (whew!)

In XYZForm, I have a boolean assignFormButton and the following setter:

public void setAssignFormButton(final String button) {
this.assignFormButton = buttonStringToBoolean(button);
}

(buttonStringToBoolean just takes the string and returns a boolean if not null)

In my JSP, I have:
<html:submit property="assignFormButton" styleId="assignProjectSubmitLink" tabindex="5>ASSIGN</html:submit>

assignFormButon=ASSIGN is indeed in the URL..however, it is never been called in the form.

However, I have other form elements in the JSP and XYZForm which ARE being set properly.

Ideas?

Stephanie
Ray Stojonic
Ranch Hand

Joined: Aug 08, 2003
Posts: 326
While this is an intriguing use of html:submit, I don't believe the auto-population feature of Struts extends to the submit property.

As such, my Actions are littered with

if( request.getParameter( "some.submit.button" ) != null ) {
//handle this type of request
}
Steph DeGuire
Greenhorn

Joined: Aug 14, 2006
Posts: 2
Actually, not to get into too much details of our design, but common buttons (ex: save, cancel, reset, return) are in a class of their own called ButtonsForm. Each of our ActionForms extend this form.

The setters work perfectly for the buttons inside the ButtonsForm but don't for the ones that are in classes that extend it.

Quite frustrating.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: html:submit setter not being called
 
Similar Threads
Struts calls reset before form is submitted
Issue in Struts Dropdown(Need Help Ranchers)
Problem with Nested forms in struts
Avoiding validation when hitting the Cancel button
LookupDispatchAction with link, Please Help Me!!!