三个页面,
result
import java.util.HashMap;import java.util.Map;import net.sf.json.JSONObject;import com.opensymphony.xwork2.ActionSupport;public class checkuserAction extends ActionSupport { private String username; private JSONObject obj; private String result; /** * @return */ public String execute() { String msg = ""; if (username.equals("admin")) { msg="已经注册啦,不行"; } else { msg="可以注册,放心"; } Mapmap = new HashMap (); map.put("msg", msg); obj=JSONObject.fromObject(map); result=obj.toString(); return SUCCESS; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public JSONObject getObj() { return obj; } public void setObj(JSONObject obj) { this.obj = obj; } public String getResult() { return result; } public void setResult(String result) { this.result = result; }}
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%><% String path = request.getContextPath(); String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";%>My JSP 'index.jsp' starting page
版权声明:本文为博主原创文章,未经博主允许不得转载。