ognl.OgnlException: target is null for setProperty(null, "x", [Ljava.lang.String;@) setProperty(null, "y", [Ljava.lang.String;@)


 

 

表單提交的方式:

<input type="image" name="submit"src="/images/admin/Admin_Login3.gif">

 

提交后 struts 異常:

    警告: Error setting expression 'submit.x' with value '[Ljava.lang.String;@5d4f83d1'
    ognl.OgnlException: target is null for setProperty(null, "x", [Ljava.lang.String;@5d4f83d1)

    警告: Error setting expression 'submit.y' with value '[Ljava.lang.String;@f573e33'
    ognl.OgnlException: target is null for setProperty(null, "y", [Ljava.lang.String;@f573e33)

  未找到 x y

原因:

  當用type="image" 提交表單時,並且同時指定了name 屬性,action 會通過所指定的name 獲取 x, y 參數

  x , y 是單擊圖片的坐標

 

解決辦法:

    可以不指定 name 元素,或者設置 name="none"                                                                                                                                                                                                                                                                                                                                                                                                                                                                    


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM