如何修改已经建好的form?
例如想添加一个text,直接在配置文件可以直接加上吗 搜索更多相关主题的帖子:
form
----------------解决方案--------------------------------------------------------
不知道你说的是什么form,struts的form吗?如果是的话加一个get和set就行了
----------------解决方案--------------------------------------------------------
但是在action中form.后面却不出来新添加的text的set和get方法?
----------------解决方案--------------------------------------------------------
test.jsp
<html:html>
<body>
.......
<html:text property="uname" /><!--新添加 的-->
.......
<body>
</html:html>
TestForm.java
..........
//下面是新添加的
private String uname;
public String getUname()
{return uname:}
public void setUname(String uname)
{this.uname=uname;}
...........
TestAction.java
...........
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
TestForm theForm = (TestForm) form;
String uname = theForm.getUname();
..............
----------------解决方案--------------------------------------------------------
行了 ,3Q
----------------解决方案--------------------------------------------------------