>
41 < name > theme </ name >
42 < required > false </ required >
43 < rtexprvalue > true </ rtexprvalue >
44 </ attribute >
45 </ tag >
46 </ taglib >
47
蛍匈炎禰(2)
扮寂:2011-01-21 BlogJava tobyxiong
2.Pages.java
1package cn.com.sunrise.home.util;
2
3import java.io.IOException;
4import java.io.Writer;
5import java.util.Map;
6import java.util.logging.Level;
7import java.util.logging.Logger;
8
9import javax.servlet.http.HttpServletRequest;
10
11import org.apache.struts2.StrutsStatics;
12import org.apache.struts2.components.Component;
13import org.apache.struts2.dispatcher.StrutsRequestWrapper;
14
15import com.opensymphony.xwork2.util.ValueStack;
16
17/**
18 * 蛍匈貸辞Bean
19 * @author xiongwei
20 */
21public class Pages extends Component {
22
23 private HttpServletRequest request;
24
25 private String pageNo;
26 private String total;
27 private String styleClass;
28 private String theme;
29 private String includes;
30
31 public String getTheme() {
32 return theme;
33 }
34 public void setTheme(String theme) {
35 this.theme = theme;
36 }
37 public String getIncludes() {
38 return includes;
39 }
40 public void setIncludes(String includes) {
41 this.includes = includes;
42 }
43 public String getStyleClass() {
44 return styleClass;
45 }
46 public void setStyleClass(String styleClass) {
47 this.styleClass = styleClass;
48 }
49 public String getPageNo() {
50 return pageNo;
51 }
52 public void setPageNo(String pageNo) {
53 this.pageNo = pageNo;
54 }
55 public String getTotal() {
56 return total;
57 }
58 public void setTotal(String total) {
59 this.total = total;
60 }
61
62
63 public Pages(ValueStack arg0, HttpServletRequest request) {
64 super(arg0);
65 this.request = request;
66 }
67
68 @Override
69 public boolean start(Writer writer) {
70
71 boolean result = super.start(writer);
72 try {
73 StringBuilder str = new StringBuilder();
74 Map cont=this.getStack().getContext();
75 StrutsRequestWrapper req=(StrutsRequestWrapper)cont.get(StrutsStatics.HTTP_REQUEST);
76
77 String url=(String)req.getAttribute("javax.servlet.forward.request_uri");
78
79 //貫ValueStack嶄函竃方峙
80
|