aspose file tools*
The moose likes Struts and the fly likes Action Form not populate with JSP hidden value Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Action Form not populate with JSP hidden value" Watch "Action Form not populate with JSP hidden value" New topic
Author

Action Form not populate with JSP hidden value

thomas jacob
Ranch Hand

Joined: May 19, 2005
Posts: 91
JSP

<input type="hidden" id="projIds"/>

The hidden id is populated in the JSP not shown here


struts-config.xml

form-bean name="myForm"
type="com.MyForm"/>

ActionForm

public class MyForm extends ActionForm{

private String projIds;

public String getProjViewIds() {
return projIds;
}

public void setProjViewIds(String projViewIds) {
this.projIds = projIds;
}
}

Action mapping
<action path="/doit"
name="myForm"
type="com.MyAction"
validate="true">
</action>

I am not able to populate to the ActionForm with the JSP hidden field

What am I doing wrong?

Thanks
Thomas
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Which error/exception you got?
And your ActionForm code is not valid bean, there is NO getter/setter methods for the property "projIds"


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
thomas jacob
Ranch Hand

Joined: May 19, 2005
Posts: 91
Sorry the ActionForm is

private String projViewIds;

public String getProjViewIds() {
return projViewIds;
}

public void setProjViewIds(String projViewIds) {
this.projViewIds = projViewIds;
}

However I am not able to populate the actionform with the hidden variable
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

There's still no getter/setter methods for the property "projIds"...

Please use "code" tags when posting source; it's much easier to read. Thanks!
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

thomas jacob wrote:
private String projViewIds;

public String getProjViewIds() {
return projViewIds;
}

public void setProjViewIds(String projViewIds) {
this.projViewIds = projViewIds;
}

This is changed, but what about this ?
 
 
subject: Action Form not populate with JSP hidden value