Struts2项目中关于Struts标签的相关问题

本文解决Struts2项目中特定警告的问题,详细说明了如何通过调整s:form标签中的namespace属性来消除关于/admin_login配置未找到的警告。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


Struts2项目中出现以下警告:虽然不影响程序得的运行,但看着很纠结~

警告: No configuration found for the specified action: '/admin_login' in namespace: ''. Form action defaulting to 'action' attribute's literal value.

2016-11-30 9:39:23 org.apache.struts2.components.ServletUrlRenderer warn

警告: No configuration found for the specified action: '/admin_login' in namespace: ''. Form action defaulting to 'action' attribute's literal value.



原因分析:login.jspz中的Struts标签
  <s:form action="/admin_login" method="post" theme="simple" >
  <table border="1" align="center" cellpadding="5" cellspacing="0">
 

中的nanamespace=""默认为空  需修改如下

<s:form action="admin_login" method="post" theme="simple" namespace="/" >
  <table border="1" align="center" cellpadding="5" cellspacing="0">

action中的“/”  得去掉,问题就解决了。


更多详解请点击:点击打开链接

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值