问题描述
JSP:
< s:form action =addfriend>
< s:property value =用户名/>
< s:submit value =Add friend/>
< / s:form>
此代码是否在属性中提交值标记到行为表单中?
不, property tag doesn不会生成输入字段。只需描述属性标签即可。它用于将值栈中的值打印到JSP输出。要将值提交给操作,表单需要生成一个标签,该标签生成HTML input 标签或 textarea 标签。这就是标签提供。
< s:textfield name =Usernamevalue =%{Username}/>
请注意,还有许多其他生成输入字段的标记,您可以看到在HTML浏览器中生成的输出源窗口。
The JSP:
<s:form action = "addfriend"> <s:property value="Username" /> <s:submit value="Add friend" /> </s:form>
Does this code submit the value in the property tag to the action form?
No, property tag doesn't generate input fields. Merely description of the property tag you can find here. It's used to print the value from the value stack to JSP output. To submit the value to the action the form needs to have a tag which generate a HTML input tag or textarea tag. That's what the textfield tag provides.
<s:textfield name="Username" value="%{Username}"/>
Note, there are many other tags that generate input fields, you can see the output generated in HTML browser source window.
这篇关于将属性标记中的值提交给操作表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!