我有一个页面网址,如下所示:
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中更改此属性吗?
答案 0 :(得分:7)
return
是Java编程语言(tm)中的保留关键字。但幸运的是,有一种替代拼写。请改为param['return']
。