【发布时间】:2011-11-25 09:14:56
【问题描述】:
例如,我有一个网址:/test.action?a=1&b=2 现在我想在 jsp 页面中使用只从 URL 中获取“a=1&b=2”,该怎么做?
【问题讨论】:
例如,我有一个网址:/test.action?a=1&b=2 现在我想在 jsp 页面中使用只从 URL 中获取“a=1&b=2”,该怎么做?
【问题讨论】:
操作代码
public class MyAction extends ActionSupport {
private String a;
private String a;
public String execute() throws Exception {
// do something here
return SUCCESS;
}
public String getA() {
return a;
}
public void setA(final String a) {
this.a= a;
}
public String getB() {
return b;
}
public void setB(final String b) {
this.a= a;
}
}
使用 Struts 标签:
<s:property value="a"/>
<s:property value="b"/>
我仍然不确定您的要求到底是什么,因为您的问题不是很清楚
Just a side note <s:url> This tag is used to create a URL
【讨论】: