日期:2014-05-17 浏览次数:20783 次
public String hahaha(){ String xx="测试"; HttpServletRequest request = ServletActionContext.getRequest(); HttpServletResponse res = ServletActionContext.getResponse(); String pm=request.getParameter("pm"); res.setCharacterEncoding("UTF-8"); try { res.getWriter().write(pm+xx); } catch (IOException e) { e.printStackTrace(); } return "test"; }
function ckkey(){ var url="wsAtn!hahaha.action"; var px={pp:'页面来的'}; jQuery.post(url,px,callbackFun); } function callbackFun(data){ alert(data); }
<package name="ws_Action" extends="struts-default"> <action name="wsAtn" class="wsAct"> <result name="test">xx.jsp</result> </action> </package>