Struts2 devMode Exception when using “key” attribute in submit tag

前端 未结 1 1336
走了就别回头了
走了就别回头了 2021-01-16 06:51

I\'m using Struts2 with devMode turned on to catch as many warnings and errors as possible. Now I got across with some SEVERE notification that is only notified

1条回答
  •  -上瘾入骨i
    2021-01-16 07:20

    You have used a key attribute's value that didn't bind a submit button to the action. Struts UI tags usually bind the name attribute's value to the action. According to Struts docs page a key parameter is

    Set the key (name, value, label) for this particular component

    The first is a name attribute is used to parse for OGNL expression to set a value to the value stack. As far as you don't have such value the OGNL exception is thrown, but parameters interceptor used to catch and ignore this kind of exceptions. And only if you have devMode is turned on you can see this exception in the logs.

    Usually if you are using a key attribute in the Struts tag you should use the same property name as a key in the properties file, so it correctly bind the action property.

    0 讨论(0)
提交回复
热议问题