javax.el.E​​LException:标识符[return]不是有效的Java标识符

时间:2011-06-03 23:04:05

标签: java-ee tomcat7

我有一个页面网址,如下所示:

http://mydomain.com/nodes/32/article/new?return=view

安装tomcat 7后,在尝试访问它时,我遇到了这个例外:

/nodes/${param.id}/article/new?return=${param.return}
contains invalid expression(s): javax.el.ELException: The identifier [return] is not a valid Java identifier as required by section 1.19 of the EL specification (Identifier ::= Java language identifier). This check can be disabled by setting the system property org.apache.el.parser.SKIP_IDENTIFIER_CHECK to true.

我为什么会这样想?要解决它,我应该只在tomcat中更改此属性吗?

1 个答案:

答案 0 :(得分:7)

return是Java编程语言(tm)中的保留关键字。但幸运的是,有一种替代拼写。请改为param['return']