天天看點

el表達式_EL表達式使用

  EL能直接方法Bean裡面的方法嗎

  例如test下MyBean java檔案

  package test;

 

public class MyBean {
  private int id; //私有屬性
  public MyBean() {
  return();
  }
  public int getId() {return id;}
  public void setId(int id) {this.id=id;}
  }      

  jsp頁面

MyJsp.jsp
  ${ mybean.id } 
  ${ mybean.getId() }