原因: 参数类型转换错误, validation失败
解决:
<%@ taglib prefix="s" uri="/struts-tags"%>
<div style="color:red">
<s:fielderror />
</div>
它就会显示拦截器的错误,并在struts的XML中对应action里加如
<result name="input">/AddProducts.jsp</result>
让他把错误返回到该页面就可以了
本文介绍了解决 Struts 框架中因参数类型转换错误导致 validation 失败的问题。通过使用特定标签显示错误信息,并配置 XML 中 action 的 input 结果来返回错误页面。
原因: 参数类型转换错误, validation失败
解决:
<%@ taglib prefix="s" uri="/struts-tags"%>
<div style="color:red">
<s:fielderror />
</div>
它就会显示拦截器的错误,并在struts的XML中对应action里加如
<result name="input">/AddProducts.jsp</result>
让他把错误返回到该页面就可以了
您可能感兴趣的与本文相关的镜像
Stable-Diffusion-3.5
Stable Diffusion 3.5 (SD 3.5) 是由 Stability AI 推出的新一代文本到图像生成模型,相比 3.0 版本,它提升了图像质量、运行速度和硬件效率
2万+
904

被折叠的 条评论
为什么被折叠?