struts2中自己出現的異常,發現一個更新一個(持續更新中)

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值和跳轉內容

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章