struts2中自己出现的异常,发现一个更新一个(持续更新中)

来源:互联网 发布:足球联赛赛程排序软件 编辑:程序博客网 时间:2024/06/05 14:45

ognl.NoSuchPropertyException(没有对应属性异常)

警告: Error setting expression 'user.username' with value '[Ljava.lang.String;@6dc63791'
ognl.NoSuchPropertyException: com.shengxian.entity.User.username

异常原因:

账号:<input type="text" name="user.username"/></br>

我在表单中给一个对象的username属性赋值,但是它没有这个属性,属性名写错了,应该为name,但是页面能继续执行跳转。

解决办法:

把jsp中错误的属性名改成正确的程序运行正常

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

警告: Could not find action or result

No result defined for action com.shengxian.action.LoginAction and result

异常原因:

页面中:

HTTP Status 404 - No result defined for action com.shengxian.action.LoginAction and result

Action中返回一个字符串,但是在xml中没有规定这个字符串要跳转的页面或action

解决办法:

在xml中写关于这个跳转对应的result的name值和跳转内容

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
原创粉丝点击