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

 

 

表单提交的方式:

<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"                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

转载于:https://www.cnblogs.com/xiaota/p/3515361.html

猜你喜欢

转载自blog.csdn.net/weixin_34162228/article/details/94506402