struts 1.1 可以发布到相对路径吗
我有一个 Struts 应用程序,我通过
<html:form action="companyProvAdd"> ....</html:form>
将 html 呈现为的
<form name="companyProvAddForm" method="post" action="/ebig/companyProvAdd.do"> ...</form>
表单构建是否有办法让帖子转到相对 URL?
<form name="companyProvAddForm" method="post" action="companyProvAdd.do"> ...</form>
I have a Struts application and I build by form
<html:form action="companyProvAdd"> ....</html:form>
which renders the html as
<form name="companyProvAddForm" method="post" action="/ebig/companyProvAdd.do"> ...</form>
Is there a way to have the post go to a relative URL?
<form name="companyProvAddForm" method="post" action="companyProvAdd.do"> ...</form>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看起来 Struts 1.1 不支持这个
https://issues.apache.org/jira /browse/STR-768
但我确实找到了解决方法
html:form 标记是必要的,因为表单中的项目取决于它的存在。将其注释掉可以防止浏览器读取它,并为所需的表单行进行硬编码留出空间。
这是一个丑陋的黑客,但它有效。
It looks like Struts 1.1 does not support this
https://issues.apache.org/jira/browse/STR-768
but I did find a workaround
The html:form tag is necessary because items in the form depend on its presence. Commenting it out keeps the browser from reading it and leaves room for the desired form line to be hard coded in.
It is an ugly hack, but it works.