Struts中--原来html中form的name属性现在变成什么了?答着有分!

dabobachelor 2003-01-06 08:33:59
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属性,请问,该如何调用?
...全文
201 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
xxisxx 2003-01-23
  • 打赏
  • 举报
回复
<html:rest/>也可以实现,
xxisxx 2003-01-23
  • 打赏
  • 举报
回复
1 name与type必然的联系?建议你去看看<html:form>得原码,
2 你是想通过点击图片执行reset操作吗?还是什么?如果是,那么reset可是public 方法,你想怎么用就怎么用吧,不过那时要进行一个提交操作的,建议使用javascript
xuxijian2003 2003-01-23
  • 打赏
  • 举报
回复
name好象变成property了把
dabobachelor 2003-01-22
  • 打赏
  • 举报
回复
多谢各位了!
To:superswords(supersword) 我改为html:img后,还是不好用,点击仍是执行submit操作。
To:xxisxx(xx) name与type有什么必然的联系吗?
另外,如何通过图片执行Form提供的reset操作?这个问题还是无法解决,麻烦各位了!
leo2122 2003-01-22
  • 打赏
  • 举报
回复
与表单相关的ActionForm bean的名称。如果没有设置这个属性,bean的名称将会从配置信息中获得
xxisxx 2003-01-22
  • 打赏
  • 举报
回复
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定义的
  • 打赏
  • 举报
回复
html:form中没必要定义name。
自己去查struts的帮助文档最清楚。

struts的html:image会转化成<input type="image" >,这种形式的图片点击它就会执行submit,你可以试试html:img。
dabobachelor 2003-01-22
  • 打赏
  • 举报
回复
能不能说的详细一点!
airlulu 2003-01-21
  • 打赏
  • 举报
回复
strut中form 的name属性一定要与type结合使用!!!!
type为对应的ActionForm的完全限定类名!!!!!
给分~~~~~~~~
ganh 2003-01-09
  • 打赏
  • 举报
回复
实现重置功能用javascript脚本语言,不要用类提供的方法。
我想这是因为jsp容器在编译时不会自动生成这种类方法的脚本的缘故,也就是不支持把java语言转换成java脚本语言。好像也没有那个jsp容器提供了这个功能。
dabobachelor 2003-01-07
  • 打赏
  • 举报
回复
多谢各位,我通过生成的htm源代码确实能找到form的name,但我想执行“重置”的功能,用下面代码,其中logonForm为找到的form名,当点击图片时,系统却执行了“提交”的操作,请问,这是怎么一会事?
<html:image src="images/chongzhi.gif" onclick="document.logonForm.reset()"/>
有什么更好的方法通过图形来执行操作码?
lanmarco 2003-01-07
  • 打赏
  • 举报
回复
或者你自己写一个试试看,看生成的htm源代码里面form的name是什么就明白了
signboy 2003-01-07
  • 打赏
  • 举报
回复
form的name会自动赋值的
lanmarco 2003-01-07
  • 打赏
  • 举报
回复
根据提交到的action调用哪个formbean来判断
dabobachelor 2003-01-07
  • 打赏
  • 举报
回复
???????

81,092

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧