页面代码如下:

<h:commandButton value="forward" action="#{testBean.move(1)}">  </h:commandButton>
        <h:commandButton value="back" action="#{testBean.move(-1)}">  </h:commandButton>

后台代码如下:

    public void move(int step){
            System.out.println(new Date()+" step: "+ step);
            }

可以看出是直接调用testBean中的move方法,参数也是直接写在里面的,
但是这个方法不支持,需要el2.2才行

首先去网上下载el2.2jar包,有两个:el-api-2.2.jarel-impl-2.2.jar
放入到WEB-INF中的lib下,即可

posted on 2015-07-22 11:19  wyang0126  阅读(184)  评论(0编辑  收藏  举报