|
Struts的javadoc中有关于<html:form name>的论述
DEPRECATED: The bean name will be determined from the corresponding ActionMapping.
Name of the request scope or session scope bean (as defined by the scope attribute) whose properties will be used to populate the input field values. If no such bean is found, a new bean will be created and added to the appropriate scope, using the Java class name specified by the type attribute.
If this attribute is not specified, the name of the bean will be calculated by using the value of the action attribute to look up the corresponding ActionMapping element, from which the specified form bean name will be selected.
我不知道如何去理解这段文字,有想用到form的name属性,请问,该如何调用?
---------------------------------------------------------------
根据提交到的action调用哪个formbean来判断
---------------------------------------------------------------
form的name会自动赋值的
---------------------------------------------------------------
实现重置功能用javascript脚本语言,不要用类提供的方法。
我想这是因为jsp容器在编译时不会自动生成这种类方法的脚本的缘故,也就是不支持把java语言转换成java脚本语言。好像也没有那个jsp容器提供了这个功能。
---------------------------------------------------------------
strut中form 的name属性一定要与type结合使用!!!!
type为对应的ActionForm的完全限定类名!!!!!
给分~~~~~~~~
---------------------------------------------------------------
html:form中没必要定义name。
自己去查struts的帮助文档最清楚。
struts的html:image会转化成<input type="image" >,这种形式的图片点击它就会执行submit,你可以试试html:img。
---------------------------------------------------------------
airlulu(airlulu)说得很清楚了!name 属性和type属性要以其使用,在struts理,<html:form acton="a.do" name = "form1" type = "webapp.form.form1">
或者你直接就写<html:form acton="a.do">,然后自己去ie窗口里看他的source,他的名字是你在struts-config.xml定义的
---------------------------------------------------------------
与表单相关的ActionForm bean的名称。如果没有设置这个属性,bean的名称将会从配置信息中获得
---------------------------------------------------------------
1 name与type必然的联系?建议你去看看<html:form>得原码,
2 你是想通过点击图片执行reset操作吗?还是什么?如果是,那么reset可是public 方法,你想怎么用就怎么用吧,不过那时要进行一个提交操作的,建议使用javascript
---------------------------------------------------------------
<html:rest/>也可以实现,
---------------------------------------------------------------
name好象变成property了把
|