日期:2014-05-17 浏览次数:20836 次
private void aaa(
string a="1.html";
string b="2.html";
string c="3.html";
string d="4.html";
}
public ActionForward toPage(ActionMapping mapping,ActionForm form, HttpServletRequest request,HttpServletResponse response) {
request.setAttribute("page", aaa());
return mapping.findForward("aaaa");
}
<html id="此页面就是返回的aaaa">
<a href="${a}">1</a> <a href="${b}">2</a> <a href="${c}">3</a> <a href="${d}">4</a>
<html>
Map<String,String> page=new HashMap<String, String>();
page.put("a", "1.html");
page.put("b", "2.html");
page.put("c", "3.html");
page.put("d", "4.html");
request.setAttribute("page",page);
<a href="${page[a]}">1</a> <a href="${page[b]}">2</a> <a href="${page[c]}">3</a> <a href="${page[d]}">4</a>