Struts 1.x:未显示表单
我在 .jsp 页面(使用 Struts + Tiles)中有一个这样的表单:
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html:xhtml/>
<div id="content">
<html:form action="action_newPost" method="post">
<table>
<tr>
<td>Titulo (150 Caracteres Máximo)</td>
</tr>
<tr>
<td><html:text property="titulo" size="45"/><br/>
<html:errors property="tituloError"/></td>
</tr>
<tr>
<td>Post (1000 Caracteres Máximo)</td>
</tr>
<tr>
<td><html:textarea property="contenido" cols="80" rows="7"/><br/>
<html:errors property="cuerpoError"/></td>
</tr>
</table>
<input type="submit" value="Publicar"/>
</html:form>
</div>
问题是表单不会显示,除非我将操作更改为另一个操作(称为 action_EnviarMsg)。 为什么会发生这种情况? 如果您需要其余的代码(struts-config、tiles-defs 或其他)请告诉我将其放在这里...
谢谢!
I have a form like this, in a .jsp page (using Struts + Tiles):
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html:xhtml/>
<div id="content">
<html:form action="action_newPost" method="post">
<table>
<tr>
<td>Titulo (150 Caracteres Máximo)</td>
</tr>
<tr>
<td><html:text property="titulo" size="45"/><br/>
<html:errors property="tituloError"/></td>
</tr>
<tr>
<td>Post (1000 Caracteres Máximo)</td>
</tr>
<tr>
<td><html:textarea property="contenido" cols="80" rows="7"/><br/>
<html:errors property="cuerpoError"/></td>
</tr>
</table>
<input type="submit" value="Publicar"/>
</html:form>
</div>
The problem is that the form isn't shown, unless I change the action to another (called action_EnviarMsg). Why could this be happening? If you need the rest of the code (struts-config, tiles-defs or something) tell me to put it here...
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为对于你所说的,你的行动的前进可能有问题,你应该确保你的行动的前进指向你的图块定义,它会是这样的。
struts-config.xml
tiles-def.xml
希望这有帮助
I think for what you are saying that there could be a problem with the forward of your action, you should make sure that the forward of your action points to your tile definition it would be something like this.
struts-config.xml
tiles-def.xml
Hope this helps