This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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

JavaRanch » Java Forums » Frameworks » Struts
Bookmark "html:submit  setter not being called" Watch "html:submit  setter not being called" New topic

html:submit setter not being called

Steph DeGuire

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.


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

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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: html:submit setter not being called
It's not a secret anymore!