JSF獲取頁面穿過來的參數(shù)
CommonRequest.getRequest().getParameter("deptID") 1
2
import javax.faces.context.ExternalContext;
3
import javax.faces.context.FacesContext;
4
import javax.servlet.http.HttpServletRequest;
5
6
public class CommonRequest {
7
public CommonRequest() {
8
}
9
10
public static HttpServletRequest getRequest() {
11
FacesContext facesContext = FacesContext.getCurrentInstance();
12
ExternalContext externalContext = facesContext.getExternalContext();
13
return (HttpServletRequest) externalContext.getRequest();
14
15
}
16
}

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

posted on 2008-08-28 14:41 魯勝迪 閱讀(409) 評論(0) 編輯 收藏 所屬分類: 一點點