target is null for setProperty

本文解决了一个在jsp页面中使用<s:hidden>标签出现的配置问题,并提供了在action中实现message及其get()、set()方法的解决方案。重点讨论了如何避免因配置缺失导致的默认行为,通过在action类中正确定义message属性,确保页面功能正常运行。

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

- No configuration found for the specified action: 'login.action' in namespace: ''. Form action defaulting to 'action' attribute's literal value.
- No configuration found for the specified action: 'login.action' in namespace: ''. Form action defaulting to 'action' attribute's literal value.
- No configuration found for the specified action: 'toSearchybgwForDo.action' in namespace: '/'. Form action defaulting to 'action' attribute's literal value.
- No configuration found for the specified action: 'toSearchybgwForDo.action' in namespace: '/'. Form action defaulting to 'action' attribute's literal value.
- No configuration found for the specified action: 'addNewReadDocument.action' in namespace: '/'. Form action defaulting to 'action' attribute's literal value.
- No configuration found for the specified action: 'addNewReadDocument.action' in namespace: '/'. Form action defaulting to 'action' attribute's literal value.
- Error setting expression 'message.type' with value '[Ljava.lang.String;@18195b3'
ognl.OgnlException: target is null for setProperty(null, "type", [Ljava.lang.String;@18195b3)

 

错误原因:在jsp使用到<s:hidden name="message.type" value="1"></s:hidden>,但是没有在action中定义message和他的get()、set()方法

解决方案:在action中定义message和他的get()、set()方法,重启Tomcat

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值