标签:路径 space ram 哪些 dex pattern 报表 width soft
扎心了,老铁~这依然是一个注册。
1、reg.jsp
<%@page contentType="text/html; charset=utf-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html> <head> <title>新用户注册</title> <script src="js/jquery-1.8.1.js"></script> <script> $(function(){ $("#account").blur(function(){ $.ajax({ url:"userManager_checkUserIsRegist", //请求的URL路径 type: "post", //请求方法 data:"account="+$("#account").val(),//获取文本框输入的文本值 dataType:"json",//返回json的数据格式 success:function(data){//操作成功后执行的回调函数 //alert(data); //循环遍历data集合 //{"errorMsg":"对不起该账号已经被注册"} $.each(data, function (key, value) { alert(value); }); } }); }); }); </script> </head> <body> <form action="userManager_checkUserIsRegist"> 用户帐号:<input name="textfield" type="text" id="account" name="account"/> 用户密码:<input name="textfield" type="text" /> </form> </body> </html>
2、UserManagerAction.java
package com.cn.action; public class UserManagerAction { private String account; private String errorMsg; public String checkUserIsRegist(){ String[] registAccount={"aa","bb","cc","dd"}; for(String act:registAccount){ if(act.equals(account)){ errorMsg="对不起该账号已经被注册"; break; }else{ errorMsg="恭喜您该账号可以使用"; } } return "regist"; } public String getAccount(){ return account; } public void setAccount(String account){ this.account=account; } public String getErrorMsg() { return errorMsg; } }
3、struts.xml
<?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.3//EN" "http://struts.apache.org/dtds/struts-2.3.dtd"> <struts> <constant name="struts.enable.DynamicMethodInvocation" value="true"/> <package name="jsonPlugin" namespace="/" extends="json-default"> <action name="userManager_*" class="com.cn.action.UserManagerAction" method="{1}"> <!--返回类型必须为json--> <result type="json" name="regist"> <!--Action中哪些属性需要转换成JSON数据格式--> <param name="includeProperties">errorMsg</param> </result> </action> </package> <package name="jfreechartPlugin" namespace="/" extends="jfreechart-default"> <action name="jFreeChart_*" class="com.cn.action.JFreeChartAction" method="{1}"> <result name="success" type="chart"> <!--定义JFreeChart报表的大小--> <param name="width">800</param> <param name="height">600</param> </result> </action> </package> </struts>
4、web.xml
<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <filter> <filter-name>struts2</filter-name> <filter-class> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter </filter-class> </filter> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app>
标签:路径 space ram 哪些 dex pattern 报表 width soft
原文地址:http://www.cnblogs.com/Vito-Yan/p/7435666.html