diff --git a/JavaPrj_1/.gitignore b/JavaPrj_1/.gitignore index c85d24e..6a9bf46 100644 --- a/JavaPrj_1/.gitignore +++ b/JavaPrj_1/.gitignore @@ -1,3 +1,4 @@ /.mymetadata /.classpath -*.class \ No newline at end of file +*.class +/bin/ diff --git a/JavaWebCore/bin/.gitignore b/JavaWebCore/bin/.gitignore new file mode 100644 index 0000000..93059fd --- /dev/null +++ b/JavaWebCore/bin/.gitignore @@ -0,0 +1,2 @@ +/build/ +/.classpath diff --git a/JavaWebCore/bin/.project b/JavaWebCore/bin/.project new file mode 100644 index 0000000..718700b --- /dev/null +++ b/JavaWebCore/bin/.project @@ -0,0 +1,31 @@ + + + JavaWebCore + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.jdt.core.javanature + org.eclipse.wst.jsdt.core.jsNature + + diff --git a/JavaWebCore/bin/.settings/.jsdtscope b/JavaWebCore/bin/.settings/.jsdtscope new file mode 100644 index 0000000..92e666d --- /dev/null +++ b/JavaWebCore/bin/.settings/.jsdtscope @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/JavaWebCore/bin/.settings/org.eclipse.jdt.core.prefs b/JavaWebCore/bin/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..f42de36 --- /dev/null +++ b/JavaWebCore/bin/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 +org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/JavaWebCore/bin/.settings/org.eclipse.wst.common.component b/JavaWebCore/bin/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..94e6e8f --- /dev/null +++ b/JavaWebCore/bin/.settings/org.eclipse.wst.common.component @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/JavaWebCore/bin/.settings/org.eclipse.wst.common.project.facet.core.xml b/JavaWebCore/bin/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000..4cda9be --- /dev/null +++ b/JavaWebCore/bin/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/JavaWebCore/bin/.settings/org.eclipse.wst.jsdt.ui.superType.container b/JavaWebCore/bin/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 0000000..3bd5d0a --- /dev/null +++ b/JavaWebCore/bin/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/JavaWebCore/bin/.settings/org.eclipse.wst.jsdt.ui.superType.name b/JavaWebCore/bin/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 0000000..05bd71b --- /dev/null +++ b/JavaWebCore/bin/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/Bean/bookReceive.jsp b/JavaWebCore/bin/WebContent/Bean/bookReceive.jsp new file mode 100644 index 0000000..a7ea484 --- /dev/null +++ b/JavaWebCore/bin/WebContent/Bean/bookReceive.jsp @@ -0,0 +1,29 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@ page import="com.ddb.javaweb.bean.*"%> + + <%-- --%> +<%-- + --%> +<%-- + --%> + + + + + + + + +bookReceive + + +

订 购 图 书 清 单

+
+ 书 名: +
+ 数 量: +
+ + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/Bean/bookReceive2.jsp b/JavaWebCore/bin/WebContent/Bean/bookReceive2.jsp new file mode 100644 index 0000000..638a24c --- /dev/null +++ b/JavaWebCore/bin/WebContent/Bean/bookReceive2.jsp @@ -0,0 +1,29 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@ page import="com.ddb.javaweb.bean.*"%> + + <%-- --%> +<%-- + --%> +<%-- + --%> + + + + + + + + +bookReceive2 + + +

订 购 图 书 清 单

+
+ 书 名: <%= book.getBookName()%> +
+ 数 量: <%= book.getBookNum()%> +
+ + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/Bean/bookSelect.html b/JavaWebCore/bin/WebContent/Bean/bookSelect.html new file mode 100644 index 0000000..e7f43af --- /dev/null +++ b/JavaWebCore/bin/WebContent/Bean/bookSelect.html @@ -0,0 +1,28 @@ + + + + +bookSelect + + + +
+ 选择书目 + +
+ 选择书目 + +
+ + +
+ + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/EL/ELDemo.jsp b/JavaWebCore/bin/WebContent/EL/ELDemo.jsp new file mode 100644 index 0000000..de9f664 --- /dev/null +++ b/JavaWebCore/bin/WebContent/EL/ELDemo.jsp @@ -0,0 +1,86 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Insert title here + + +

基础运算

+
+ 5+3: ${5+3} +
+ 5-3: ${5-3} +
+ 5*3: ${5*3} +
+ 5/3: ${5/3} +
+ <%-- 5 div 3: ${5 div 3} --%> +
+ 5%3: ${5%3} +
+ 5mod3: ${5 mod 3} +
+
+

逻辑运算

+
+ true and true: ${true and true}
+ true && true: ${true && true}
+ true || true: ${true || true}
+ true or true: ${true or true}
+ true: ${true}
+ not true: ${not true}
+ ! true: ${! true}
+ true and false: ${true and false}
+ true && false: ${true && false}
+ true || false: ${true || false}
+ true or false: ${true or false}
+
+

关系运算

+ 7 == 5 :${ 7==5}
+ 7 eq 5 :${ 7 eq 5}
+ <%-- 7 ne 5 :${ 7 ne 5}
--%> + 7 > 5 :${ 7>5}
+ 7 gt 5 :${ 7 gt 5}
+ 7 ≥ 5 :${ 7 gt 5}****
+ 7 >= 5 :${ 7 >= 5}
+ 7 ge 5 :${ 7 ge 5}
+ 7 < 5 :${ 7 < 5}
+ 7 < 5 :${ 7 < 5}
+ 7 lt 5 :${ 7 lt 5}
+ 7 <= 5 :${ 7 <= 5}
+ 7 ≤ :${ 7 <= 5}
+ 7 le 5 :${ 7 le 5}
+
+

空判断:

+ ${ '${'} empty '' }${empty '' }
+ ${ '${'} empty 'abc' }${empty 'abc' }
+ ${ '${'} empty "abc" }${empty "abc" }
+
+

三目运算符:

+ ${'${'}!A? 0:1 }${!A? 0:1 }
+ ${'${'}A? 0:1 }${A? 0:1 }
+ ${'${'}A==true? 0:1 }${A==true ? 0:1 }
+ ${'${'}A!=true? 0:1 }${A!=true ? 0:1 }
+ ${'${'}A=true? 0:1 }${A=true ? 0:1 }
+ ${'${'}A=(true? 0:1) }${A=(true ? 0:1) }
+ ${'${'}A!=0? 0:1 }${A!=0 ? 0:1 }
+ ${'${'}A==0? 0:1 }${A==0 ? 0:1 }
+
+

变量范围:

+ A = ${A }
+ pageScope.A = ${pageScope.A }
+ pageScope[A] = ${pageScope['A']}
+ pageScope[A] = ${pageScope["A"]}
+ pageScope.B = ${pageScope.B }
+ pageScope[B] = ${pageScope['B'] }
+ pageScope[B] = ${pageScope["B"] }
+ <%-- ${'${'}A==0? 1:0 }${A==0 ? 1:0 }
--%> + requestScope.A = ${requestScope.A }
+ sessionScope.A = ${sessionScope.A }
+ applicationScope.A = ${applicationScope.A }
+ + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/EL/ELDemo2.jsp b/JavaWebCore/bin/WebContent/EL/ELDemo2.jsp new file mode 100644 index 0000000..bd21d24 --- /dev/null +++ b/JavaWebCore/bin/WebContent/EL/ELDemo2.jsp @@ -0,0 +1,35 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@ page import="com.ddb.javaweb.bean.*"%> + + <%-- --%> +<%-- + --%> + + +<%-- + --%> + + + + + +Insert title here2 + + + <% + pageContext.setAttribute("book-addr", "hefei"); + pageContext.setAttribute("book_addr", "hefei2"); + %> + 书名--${'${'}book.bookName}:${book.bookName}
+ 数量--${'${'}book.bookNum }:${book.bookNum}
+ 书名--${'${'}book['bookName']}:${book['bookName']}
+ 数量--${'${'}book[ 'bookNum ']}:${book['bookNum']}
+
+ <%-- ${'${'}pageScope.book-addr}
--%> + ${'${'}pageScope['book-addr']}${pageScope['book-addr']}
+ ${'${'}pageScope.book_addr}${pageScope.book_addr}
+ ${'${'}pageScope['book_addr']}${pageScope['book_addr']}
+ + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/EL/ELDemo3.jsp b/JavaWebCore/bin/WebContent/EL/ELDemo3.jsp new file mode 100644 index 0000000..77cdfa3 --- /dev/null +++ b/JavaWebCore/bin/WebContent/EL/ELDemo3.jsp @@ -0,0 +1,25 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%-- <%@ page isELIgnored="true" %> --%> + + + + +Insert title here2 +<% + pageContext.setAttribute("color", "red"); +/* request.setAttribute("color", "blue"); */ +/* session.setAttribute("color", "green"); */ +application.setAttribute("color", "pink"); +%> + + + +<%-- --%> + +<%-- --%> + + **** + ++++ + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/EL/ELDemo4.jsp b/JavaWebCore/bin/WebContent/EL/ELDemo4.jsp new file mode 100644 index 0000000..15bae7d --- /dev/null +++ b/JavaWebCore/bin/WebContent/EL/ELDemo4.jsp @@ -0,0 +1,39 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%-- <%@ page isELIgnored="true" %> --%> + + + + +Insert title here2 +<% + Cookie cookie1 = new Cookie("country","chn"); + cookie1.setMaxAge(120); + response.addCookie(cookie1); +%> + + + 浏览器信息:${header['User-Agent']}
+ ${'${'}10}:${10}
+ ${'${'}null}:${null}
+ ${'${'}10.5}:${10.5}
+ <%-- ${'${'}10.5d}:${10.5d}
--%> + <%-- ${'${'}10.5l}:${10l}
--%> + + ${'${'}pageContext.session.id }:${pageContext.session.id }
+ <%-- ${'${'}pageContext.session.new }:${pageContext.session.new }
--%> + ${'${'}param.count + 20} ${param.count + 20} +
+ ${'${'}cookie.country} ${cookie['country']} + ${'${'}cookie} +
+ ${cookie.country.name}
+ ${cookie.country.value}
+ ${cookie['country'].name }
+ ${cookie['country'].value }
+
+ ${initParam.rri} + <%=(String)application.getInitParameter("rri") %> + + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/EL/ELDemo5.jsp b/JavaWebCore/bin/WebContent/EL/ELDemo5.jsp new file mode 100644 index 0000000..b2d6360 --- /dev/null +++ b/JavaWebCore/bin/WebContent/EL/ELDemo5.jsp @@ -0,0 +1,35 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%-- <%@ page isELIgnored="true" %> --%> + + + + +Insert title here2 +<% + Cookie cookie1 = new Cookie("country","chn"); + cookie1.setMaxAge(120); + response.addCookie(cookie1); +%> + + + request.queryString:${pageContext.request.queryString }
+ request.requestURI:${pageContext.request.requestURI }
+ request.contextPath:${pageContext.request.contextPath }
+ request.localAddr:${pageContext.request.localAddr }
+ request.localName:${pageContext.request.localName }
+ request.localPort:${pageContext.request.localPort }
+ request.pathInfo:${pageContext.request.pathInfo }
+ request.method:${pageContext.request.method }
+ request.protocol:${pageContext.request.protocol}
+ request.remoteAddr:${pageContext.request.remoteAddr}
+ request.remoteHost:${pageContext.request.remoteHost}
+ request.remoteUser:${pageContext.request.remoteUser}
+ request.remotePort:${pageContext.request.remotePort}
+
+ session.id:${pageContext.session.id}
+ <%-- session.id:${pageContext.session.isNew()}
--%> + servletContext.serverInfo:${pageContext.servletContext.serverInfo } + + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/EL/ELDemo6.jsp b/JavaWebCore/bin/WebContent/EL/ELDemo6.jsp new file mode 100644 index 0000000..2d5ea91 --- /dev/null +++ b/JavaWebCore/bin/WebContent/EL/ELDemo6.jsp @@ -0,0 +1,81 @@ +<%@page import="java.util.TreeSet"%> +<%@page import="java.util.HashSet"%> +<%@page import="java.util.Set"%> +<%@page import="java.util.HashMap"%> +<%@page import="java.util.Map"%> +<%@page import="java.util.ArrayList"%> +<%@page import="java.util.List"%> +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%-- <%@ page isELIgnored="true" %> --%> + + + + +Insert title here2 +<% + //List + List list = new ArrayList(); + list.add("abc"); + list.add("cde"); + list.add("def"); + list.add("efg"); + //list.get(index) + pageContext.setAttribute("list", list); + //map + Map map = new HashMap(); + map.put("11", "AA11"); + map.put("12", "AA12"); + map.put("13", "AA13"); + map.put("14", "AA14"); + //map.get(key) + pageContext.setAttribute("map", map); + + //set + Set set = new HashSet(); + /* Set set = new TreeSet(); */ + set.add("abc"); + set.add("cde"); + set.add("def"); + set.add("efg"); + //set. + pageContext.setAttribute("set", set); + + //数组 + String[] strArray = {"A01","A02","A03","A04"}; + pageContext.setAttribute("strArray", strArray); + +%> + + +

${'${'}list}:

${list} +

${'${'}list[0]}:

${list[0]} +

${'${'}list[3]}:

${list[3]} + <%--

${'${'}list['abc']}:

${list['abc']} --%> + <%--

${'${'}list["abc"]}:

${list["abc"]} --%> + <%--

${'${'}list.abc}:

${list.abc} --%> +

${'${'}list.get(0)}:

${list.get(0)} +

list 只能通过索引获取

+
+

${'${'}map}:

${map} +

${'${'}map[0]}:

${map[0]} +

${'${'}map["11"]}:

${map["11"]} +

${'${'}map.get("13")}:

${map.get("13")} + <%--

${'${'}map.11}:

${map.11} +

${'${'}map["14"]}:

${map["14"]} --%> +

map 获取元素是通过键Key!

+
+

${'${'}set}:

${set} + <%--

${'${'}set[0]}

${set[0]} --%> + <%--

${'${'}set["abc"]}

${set["abc"]} --%> +

Set 目前无法获取直接获取其中的元素!

+
+

${'${'}strArray}:

${strArray}
+

${'${'}strArray[0]}:

${strArray[0]}
+

${'${'}strArray[2]}:

${strArray[2]}
+

${'${'}strArray[2]}:

${strArray[2]}
+ <%--

${'${'}strArray.A01}:

${strArray.A01}
--%> + <%--

${'${'}strArray["A01"]}:

${strArray["A01"]}
--%> +

数组的取值,只能使用[]和索引来取值!

+ + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/HelloWorld.jsp b/JavaWebCore/bin/WebContent/HelloWorld.jsp new file mode 100644 index 0000000..205d6f5 --- /dev/null +++ b/JavaWebCore/bin/WebContent/HelloWorld.jsp @@ -0,0 +1,27 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@page import="java.util.*"%> + + + + +HelloWorld + + + +

Hello World!

+ <%-- ...... --%> + <% Date today = new Date(); + int hours = today.getHours(); + if (hours >0 && hours<12) { + out.println("早上好!"); + }else { + out.println("下午好!"); + } + + %> + + <%-- 这是JSP的注释!应该看不见 --%> + <% out.println("Hello World!"); %> + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/Login/login.jsp b/JavaWebCore/bin/WebContent/Login/login.jsp new file mode 100644 index 0000000..950dccd --- /dev/null +++ b/JavaWebCore/bin/WebContent/Login/login.jsp @@ -0,0 +1,20 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Insert title here + + +
+
+ 用户名:
密 码:
+ +
+
+ + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/Login/loginFailed.html b/JavaWebCore/bin/WebContent/Login/loginFailed.html new file mode 100644 index 0000000..4e67e78 --- /dev/null +++ b/JavaWebCore/bin/WebContent/Login/loginFailed.html @@ -0,0 +1,10 @@ + + + + +Insert title here + + +

登录失败!

+ + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/Login/loginReceive.jsp b/JavaWebCore/bin/WebContent/Login/loginReceive.jsp new file mode 100644 index 0000000..66e0359 --- /dev/null +++ b/JavaWebCore/bin/WebContent/Login/loginReceive.jsp @@ -0,0 +1,25 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +loginReceive + + + <% + String uname = request.getParameter("userName"); + String upword = request.getParameter("passWord"); + + if(uname.equals("zhangsan") && upword.equals("123456")) { + %> + + <% + } else{ + %> + + <% + } + %> + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/Login/loginSuccess.html b/JavaWebCore/bin/WebContent/Login/loginSuccess.html new file mode 100644 index 0000000..6052c30 --- /dev/null +++ b/JavaWebCore/bin/WebContent/Login/loginSuccess.html @@ -0,0 +1,10 @@ + + + + +Insert title here + + +

登录成功!

+ + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/META-INF/MANIFEST.MF b/JavaWebCore/bin/WebContent/META-INF/MANIFEST.MF new file mode 100644 index 0000000..5e94951 --- /dev/null +++ b/JavaWebCore/bin/WebContent/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/JavaWebCore/bin/WebContent/WEB-INF/initDemo.jsp b/JavaWebCore/bin/WebContent/WEB-INF/initDemo.jsp new file mode 100644 index 0000000..bcb0243 --- /dev/null +++ b/JavaWebCore/bin/WebContent/WEB-INF/initDemo.jsp @@ -0,0 +1,13 @@ + +<%@ page contentType="text/html" pageEncoding="GBK"%> + +ȡʼϢ + +<% + String dbDriver = config.getInitParameter("driver") ; + String dbUrl = config.getInitParameter("url") ; +%> +

<%=dbDriver%>

+

ӵַ<%=dbUrl%>

+ + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/WEB-INF/lib/jstl.jar b/JavaWebCore/bin/WebContent/WEB-INF/lib/jstl.jar new file mode 100644 index 0000000..a02abec Binary files /dev/null and b/JavaWebCore/bin/WebContent/WEB-INF/lib/jstl.jar differ diff --git a/JavaWebCore/bin/WebContent/WEB-INF/lib/standard.jar b/JavaWebCore/bin/WebContent/WEB-INF/lib/standard.jar new file mode 100644 index 0000000..bc528ac Binary files /dev/null and b/JavaWebCore/bin/WebContent/WEB-INF/lib/standard.jar differ diff --git a/JavaWebCore/bin/WebContent/WEB-INF/web.xml b/JavaWebCore/bin/WebContent/WEB-INF/web.xml new file mode 100644 index 0000000..2a2ad15 --- /dev/null +++ b/JavaWebCore/bin/WebContent/WEB-INF/web.xml @@ -0,0 +1,104 @@ + + + JavaWebCore + + index.html + index.htm + index.jsp + default.html + default.htm + default.jsp + + + + Filter05 + com.ddb.javaweb.filter.EncodingFilter + + charset + UTF-8 + + + + Filter05 + MyLoginServletDemo + + + Filter01 + com.ddb.javaweb.filter.UserNameFilter + + + Filter01 + MyLoginServletDemo + + + Filter03 + com.ddb.javaweb.filter.PasswordFilter + + + Filter03 + MyLoginServletDemo + + + + + + + InitOrderDemo + com.ddb.javaweb.servlet.InitOrderDemo + 1 + + + InitOrderDemo + /servlet/InitOrderDemo + + + InitOrderDemo2 + com.ddb.javaweb.servlet.InitOrderDemo2 + 2 + + + InitOrderDemo2 + /servlet/InitOrderDemo2 + + + InitOrderDemo3 + com.ddb.javaweb.servlet.InitOrderDemo3 + 3 + + + InitOrderDemo3 + /servlet/InitOrderDemo3 + + + ServletDemo + com.ddb.javaweb.servlet.ServletDemo + 1 + + + ServletDemo + /servlet/ServletDemo + + + rri + 1223 + + + dbinit + /WEB-INF/initDemo.jsp + + driver + org.gjt.mm.mysql.Driver + + + url + jdbc:mysql://localhost:3306/abcd + + + + dbinit + /config.abcd + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/filter/loginPasswordLost.html b/JavaWebCore/bin/WebContent/filter/loginPasswordLost.html new file mode 100644 index 0000000..8df6ecf --- /dev/null +++ b/JavaWebCore/bin/WebContent/filter/loginPasswordLost.html @@ -0,0 +1,10 @@ + + + + +没有输入密码 + + +

没有输入密码

+ + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/filter/loginUserNameLost.html b/JavaWebCore/bin/WebContent/filter/loginUserNameLost.html new file mode 100644 index 0000000..03fd366 --- /dev/null +++ b/JavaWebCore/bin/WebContent/filter/loginUserNameLost.html @@ -0,0 +1,10 @@ + + + + +没有输入用户名 + + +

没有输入用户名

+ + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/html/newBook1.html b/JavaWebCore/bin/WebContent/html/newBook1.html new file mode 100644 index 0000000..8f8eaff --- /dev/null +++ b/JavaWebCore/bin/WebContent/html/newBook1.html @@ -0,0 +1,10 @@ + + + + +new book 1 + + +

new book 1

+ + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/html/newBook2.html b/JavaWebCore/bin/WebContent/html/newBook2.html new file mode 100644 index 0000000..eb71f43 --- /dev/null +++ b/JavaWebCore/bin/WebContent/html/newBook2.html @@ -0,0 +1,10 @@ + + + + +new book 2 + + +

new book 2

+ + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/html/newBook3.html b/JavaWebCore/bin/WebContent/html/newBook3.html new file mode 100644 index 0000000..4d36848 --- /dev/null +++ b/JavaWebCore/bin/WebContent/html/newBook3.html @@ -0,0 +1,10 @@ + + + + +new book 3 + + +

new book 3

+ + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/html/newBook4.html b/JavaWebCore/bin/WebContent/html/newBook4.html new file mode 100644 index 0000000..f29806b --- /dev/null +++ b/JavaWebCore/bin/WebContent/html/newBook4.html @@ -0,0 +1,10 @@ + + + + +new book 4 + + +

new book 4

+ + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/index.jsp b/JavaWebCore/bin/WebContent/index.jsp new file mode 100644 index 0000000..e6cf1f3 --- /dev/null +++ b/JavaWebCore/bin/WebContent/index.jsp @@ -0,0 +1,13 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Insert title here + + +

Hello World!

+ <% out.println("Hello World!"); %> + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/Login.jsp b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/Login.jsp new file mode 100644 index 0000000..d7f2f23 --- /dev/null +++ b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/Login.jsp @@ -0,0 +1,36 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Session + + +
+ 用户名: +
+ 密 码: +
+ + +
+ + <% + String userName = request.getParameter("userName"); + String passWord = request.getParameter("passWord"); + if(null != userName && null !=passWord && "zhangsan".equals(userName) && passWord.equals("123456")){ + response.setHeader("refresh", "3;url=loginOK.jsp"); + session.setAttribute("userid", userName); + %> +

登录成功!3秒后跳转到登录成功的页面!

+

如果没有成功跳转,请点击这里进行手动跳转

+ <% + } else{ + %> +

登录失败,错误的用户名或者密码

+ <% + } + %> + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/all_attribute.jsp b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/all_attribute.jsp new file mode 100644 index 0000000..5275bf2 --- /dev/null +++ b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/all_attribute.jsp @@ -0,0 +1,16 @@ +<%@ page contentType="text/html" pageEncoding="GBK"%> +<%@ page import="java.util.*"%> + + + +<% + Enumeration enu = this.getServletContext().getAttributeNames() ; // ȡȫ + while(enu.hasMoreElements()){ + String name = (String) enu.nextElement() ; +%> +

<%=name%> --> <%=this.getServletContext().getAttribute(name)%>

+<% + } +%> + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/get_RealPath_demo01.jsp b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/get_RealPath_demo01.jsp new file mode 100644 index 0000000..664ce34 --- /dev/null +++ b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/get_RealPath_demo01.jsp @@ -0,0 +1,10 @@ +<%@ page contentType="text/html" pageEncoding="GBK"%> + +ȡʵ· + +<% // http://localhost/mldn/ + String path = application.getRealPath("/") ; +%> +

ʵ·<%=path%>

+ + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/get_RealPath_demo02.jsp b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/get_RealPath_demo02.jsp new file mode 100644 index 0000000..903aca7 --- /dev/null +++ b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/get_RealPath_demo02.jsp @@ -0,0 +1,11 @@ +<%@ page contentType="text/html" pageEncoding="GBK"%> + +ȡʵ·2 + +<% + String path = this.getServletContext().getRealPath("/") ; + +%> +

ʵ·<%=path%>

+ + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/get_time.jsp b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/get_time.jsp new file mode 100644 index 0000000..7199aef --- /dev/null +++ b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/get_time.jsp @@ -0,0 +1,12 @@ +<%@ page contentType="text/html" pageEncoding="GBK"%> + +ͣʱ + +<% + long start = session.getCreationTime() ; + long end = session.getLastAccessedTime() ; + long time = (end - start) / 1000 ; +%> +

Ѿͣ<%=time%>룡

+ + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/is_newUser.jsp b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/is_newUser.jsp new file mode 100644 index 0000000..f32b176 --- /dev/null +++ b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/is_newUser.jsp @@ -0,0 +1,17 @@ +<%@ page contentType="text/html" pageEncoding="GBK"%> + +жû + +<% + if(session.isNew()){ +%> +

ӭû٣

+<% + } else { +%> +

Ѿûˣ

+<% + } +%> + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/loginOK.jsp b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/loginOK.jsp new file mode 100644 index 0000000..9d5ef4e --- /dev/null +++ b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/loginOK.jsp @@ -0,0 +1,33 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Login Success + + + <% + String userid = (String)session.getAttribute("userid"); + %> + + <% + if (null != userid) { + %> +

<%=userid %> + 您好,欢迎您登录本系统! +

+
+ 注销 + <% + } else { + %> +

+ 请先进行系统登录! 登录 +

+ <% + } + %> + + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/loginOut.jsp b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/loginOut.jsp new file mode 100644 index 0000000..c51bc8e --- /dev/null +++ b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/loginOut.jsp @@ -0,0 +1,20 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Login Success + + + <% + response.setHeader("refresh", "5;url=Login.jsp"); + session.invalidate(); //让会话失效 + %> +

您已经退出本系统,5秒后将跳转到登录页面。

+

+ 如果系统没有自动跳转,请点击这里 +

+ + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/pagecontext_forward_demo01.jsp b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/pagecontext_forward_demo01.jsp new file mode 100644 index 0000000..d1974a6 --- /dev/null +++ b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/pagecontext_forward_demo01.jsp @@ -0,0 +1,9 @@ +<%@ page contentType="text/html" pageEncoding="GBK"%> + +pageContextҳת1 + +<% + pageContext.forward("pagecontext_forward_demo02.jsp?info=AABB") ; +%> + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/pagecontext_forward_demo02.jsp b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/pagecontext_forward_demo02.jsp new file mode 100644 index 0000000..50a96f7 --- /dev/null +++ b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/pagecontext_forward_demo02.jsp @@ -0,0 +1,12 @@ +<%@ page contentType="text/html" pageEncoding="GBK"%> + +pageContextҳת2 + +<% + // ֱӴpageContextȡrequest + String info = pageContext.getRequest().getParameter("info") ; +%> +

info = <%=info%>

+

realpath = <%=pageContext.getServletContext().getRealPath("/")%>

+ + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/requestDemo.jsp b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/requestDemo.jsp new file mode 100644 index 0000000..47f7b39 --- /dev/null +++ b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/requestDemo.jsp @@ -0,0 +1,38 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +RequestObjDemo + + + <%-- 获取request范围属性值 --%> + <% + String changeSessionId = request.changeSessionId(); + AsyncContext getAsyncContext = request.getAsyncContext(); + String AuthType= request.getAuthType(); + String CharacterEncoding =request.getCharacterEncoding(); + int contentLength= request.getContentLength(); + String ContentType = request.getContentType(); + String contextPath= request.getContextPath(); + String QueryString =request.getQueryString(); + %> + changeSessionId : <%=changeSessionId %> +
+ getAsyncContext : <%=getAsyncContext %> +
+ AuthType : <%=AuthType %> +
+ CharacterEncoding : <%=CharacterEncoding %> +
+ contentLength : <%=contentLength %> +
+ ContentType : <%=ContentType %> +
+ contextPath : <%=contextPath %> +
+ QueryString : <%=QueryString %> + + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/responseDemo.jsp b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/responseDemo.jsp new file mode 100644 index 0000000..c926bb2 --- /dev/null +++ b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/responseDemo.jsp @@ -0,0 +1,23 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +RequestObjDemo + + + <%! int count = 0; %><%-- 定义全局变量 --%> + <% + response.setHeader("refresh", "2"); + //response.setHeader("refresh", "4;url='http://www.baidu.com'"); + %> +

当前刷新次数:

<%= count++ %> + <% + if (count == 15){ + response.sendRedirect("../session2.jsp"); + } + %> + + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/responseDemo2.jsp b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/responseDemo2.jsp new file mode 100644 index 0000000..5f0a8d7 --- /dev/null +++ b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/responseDemo2.jsp @@ -0,0 +1,21 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +RequestObjDemo2 + + + <% + Cookie c1 = new Cookie("name","zhangsan"); + Cookie c2 = new Cookie("age","36"); + c1.setMaxAge(3); + c2.setMaxAge(3); + response.addCookie(c1); + response.addCookie(c2); + %> + 链接 + + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/responseDemo21.jsp b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/responseDemo21.jsp new file mode 100644 index 0000000..02e28f1 --- /dev/null +++ b/JavaWebCore/bin/WebContent/jsp/InnerObjs/ObjDemo/responseDemo21.jsp @@ -0,0 +1,23 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +RequestObjDemo2 + + +

Cookie :

+ <% + Cookie[] cs = request.getCookies(); + for(Cookie c:cs){ + %> + <%=c.getName() %> + <%=c.getValue() %>
+ <% + } + %> + + + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jsp/InnerObjs/application.jsp b/JavaWebCore/bin/WebContent/jsp/InnerObjs/application.jsp new file mode 100644 index 0000000..dbf7ec0 --- /dev/null +++ b/JavaWebCore/bin/WebContent/jsp/InnerObjs/application.jsp @@ -0,0 +1,26 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Insert title here + + + <%-- 设定application范围属性 --%> + <% + application.setAttribute("name", "wanger"); + application.setAttribute("birthday", "1983-11-21"); + %> + + <%-- 获取application范围属性值 --%> + <% + String userName = (String) application.getAttribute("name"); + String userBirth =(String) application.getAttribute("birthday"); + %> +

用户名:

<%=userName %> +

生 日:

<%=userBirth %> + 跳转 + <%-- --%> + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jsp/InnerObjs/application2.jsp b/JavaWebCore/bin/WebContent/jsp/InnerObjs/application2.jsp new file mode 100644 index 0000000..234b326 --- /dev/null +++ b/JavaWebCore/bin/WebContent/jsp/InnerObjs/application2.jsp @@ -0,0 +1,20 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Insert title here + + + + <%-- 获取application范围属性值 --%> + <% + String userName = (String) application.getAttribute("name"); + String userBirth =(String) application.getAttribute("birthday"); + %> +

用户名:

<%=userName %> +

生 日:

<%=userBirth %> + + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jsp/InnerObjs/pageContext.jsp b/JavaWebCore/bin/WebContent/jsp/InnerObjs/pageContext.jsp new file mode 100644 index 0000000..796ff60 --- /dev/null +++ b/JavaWebCore/bin/WebContent/jsp/InnerObjs/pageContext.jsp @@ -0,0 +1,30 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Insert title here + + + <%-- 设定Page范围属性 --%> + <% + pageContext.setAttribute("name", "zhangsan"); + pageContext.setAttribute("birthday", "1980-10-21"); + pageContext.setAttribute("location", "hefei", pageContext.APPLICATION_SCOPE); + %> + + <%-- 获取page范围属性值 --%> + <% + String userName = (String) pageContext.getAttribute("name"); + String userBirth =(String) pageContext.getAttribute("birthday"); + //String locat =(String) pageContext.getAttribute("location"); + String locat =(String) application.getAttribute("location"); + %> +

用户名:

<%=userName %> +

生 日:

<%=userBirth %> +

地 址:

<%=locat %> + 跳转 + <%-- --%> + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jsp/InnerObjs/pageContext2.jsp b/JavaWebCore/bin/WebContent/jsp/InnerObjs/pageContext2.jsp new file mode 100644 index 0000000..34c8b2a --- /dev/null +++ b/JavaWebCore/bin/WebContent/jsp/InnerObjs/pageContext2.jsp @@ -0,0 +1,20 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Insert title here + + + + <%-- 获取page范围属性值 --%> + <% + String userName = (String) pageContext.getAttribute("name"); + String userBirth =(String) pageContext.getAttribute("birthday"); + %> +

用户名:

<%=userName %> +

生 日:

<%=userBirth %> + <%="********" %> + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jsp/InnerObjs/request.jsp b/JavaWebCore/bin/WebContent/jsp/InnerObjs/request.jsp new file mode 100644 index 0000000..dff375f --- /dev/null +++ b/JavaWebCore/bin/WebContent/jsp/InnerObjs/request.jsp @@ -0,0 +1,27 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Insert title here + + + <%-- 设定request范围属性 --%> + <% + request.setAttribute("name", "zhangsan"); + request.setAttribute("birthday", "1980-10-21"); + + %> + + <%-- 获取request范围属性值 --%> + <% + String userName = (String) request.getAttribute("name"); + String userBirth =(String) request.getAttribute("birthday"); + %> +

用户名:

<%=userName %> +

生 日:

<%=userBirth %> + 跳转 + + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jsp/InnerObjs/request2.jsp b/JavaWebCore/bin/WebContent/jsp/InnerObjs/request2.jsp new file mode 100644 index 0000000..8e02419 --- /dev/null +++ b/JavaWebCore/bin/WebContent/jsp/InnerObjs/request2.jsp @@ -0,0 +1,20 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Insert title here + + + + <%-- 获取request范围属性值 --%> + <% + String userName = (String) request.getAttribute("name"); + String userBirth =(String) request.getAttribute("birthday"); + %> +

用户名:

<%=userName %> +

生 日:

<%=userBirth %> + + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jsp/InnerObjs/session.jsp b/JavaWebCore/bin/WebContent/jsp/InnerObjs/session.jsp new file mode 100644 index 0000000..c658b80 --- /dev/null +++ b/JavaWebCore/bin/WebContent/jsp/InnerObjs/session.jsp @@ -0,0 +1,26 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Insert title here + + + <%-- 设定session范围属性 --%> + <% + session.setAttribute("name", "lisi"); + session.setAttribute("birthday", "1984-11-21"); + %> + + <%-- 获取session范围属性值 --%> + <% + String userName = (String) session.getAttribute("name"); + String userBirth =(String) session.getAttribute("birthday"); + %> +

用户名:

<%=userName %> +

生 日:

<%=userBirth %> + 跳转 + <%-- --%> + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jsp/InnerObjs/session2.jsp b/JavaWebCore/bin/WebContent/jsp/InnerObjs/session2.jsp new file mode 100644 index 0000000..834e01a --- /dev/null +++ b/JavaWebCore/bin/WebContent/jsp/InnerObjs/session2.jsp @@ -0,0 +1,20 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Insert title here + + + + <%-- 获取request范围属性值 --%> + <% + String userName = (String) session.getAttribute("name"); + String userBirth =(String) session.getAttribute("birthday"); + %> +

用户名:

<%=userName %> +

生 日:

<%=userBirth %> + + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jsp/errorPageDirec.jsp b/JavaWebCore/bin/WebContent/jsp/errorPageDirec.jsp new file mode 100644 index 0000000..322922c --- /dev/null +++ b/JavaWebCore/bin/WebContent/jsp/errorPageDirec.jsp @@ -0,0 +1,13 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8" isErrorPage="true"%> + + + + + +错误案例 + + +

哎呦 ,出错了!

+ + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jsp/includeDirec.jsp b/JavaWebCore/bin/WebContent/jsp/includeDirec.jsp new file mode 100644 index 0000000..2f15cee --- /dev/null +++ b/JavaWebCore/bin/WebContent/jsp/includeDirec.jsp @@ -0,0 +1,16 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + + +Insert title here + + +
+

当前的时间是:

+ <%@ include file="systemTime.html"%> +
+ + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jsp/newBook.jsp b/JavaWebCore/bin/WebContent/jsp/newBook.jsp new file mode 100644 index 0000000..2efc96f --- /dev/null +++ b/JavaWebCore/bin/WebContent/jsp/newBook.jsp @@ -0,0 +1,19 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Insert title here + + + + + + +<%-- + + + --%> + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jsp/pageDirec.jsp b/JavaWebCore/bin/WebContent/jsp/pageDirec.jsp new file mode 100644 index 0000000..3fd751b --- /dev/null +++ b/JavaWebCore/bin/WebContent/jsp/pageDirec.jsp @@ -0,0 +1,17 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8" errorPage="errorPageDirec.jsp"%> + + + + + +错误案例 + + + <% + int a = 5; + int b = a/0; + out.println(b); + %> + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jsp/systemTime.html b/JavaWebCore/bin/WebContent/jsp/systemTime.html new file mode 100644 index 0000000..f9914bb --- /dev/null +++ b/JavaWebCore/bin/WebContent/jsp/systemTime.html @@ -0,0 +1,2 @@ +<%@page import="java.util.*"%> +<%= (new Date()).toLocaleString() %> \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jstl/ConditionDemo.jsp b/JavaWebCore/bin/WebContent/jstl/ConditionDemo.jsp new file mode 100644 index 0000000..b963221 --- /dev/null +++ b/JavaWebCore/bin/WebContent/jstl/ConditionDemo.jsp @@ -0,0 +1,43 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +Insert title here + + +
+ 请输入百分制成绩:    +
+ + + + + + + + + 请输入正确的百分值! + + + 您的成绩优秀! + + + 您的成绩良好! + + + 您的成绩中等! + + + 您的成绩及格! + + + 您的成绩不及格! + + + + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jstl/commonDemo.jsp b/JavaWebCore/bin/WebContent/jstl/commonDemo.jsp new file mode 100644 index 0000000..0b6982d --- /dev/null +++ b/JavaWebCore/bin/WebContent/jstl/commonDemo.jsp @@ -0,0 +1,29 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ page import="com.ddb.javaweb.bean.*" %> + + + + +Insert title here + + + + + + 删除之前,变量count的值为: +
+ + 删除之后,变量count的值为: +
+
+ + bb.bookName: + +
+ + + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jstl/dateFormatDemo.jsp b/JavaWebCore/bin/WebContent/jstl/dateFormatDemo.jsp new file mode 100644 index 0000000..42ea358 --- /dev/null +++ b/JavaWebCore/bin/WebContent/jstl/dateFormatDemo.jsp @@ -0,0 +1,17 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> + + + + +urlImportDemo + + + + +
+ + + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jstl/elFNDemo.jsp b/JavaWebCore/bin/WebContent/jstl/elFNDemo.jsp new file mode 100644 index 0000000..490391e --- /dev/null +++ b/JavaWebCore/bin/WebContent/jstl/elFNDemo.jsp @@ -0,0 +1,23 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%> + + + + +urlImportDemo + + + <% + String[] video = { "电影", "电视剧", "动画片", "记录片" }; + request.setAttribute("video", video); + %> + 大写转小写:I LOVE CHINA!  ${fn:toLowerCase("I LOVE CHINA!")} +
取长度:I LOVE CHINA!的长度为${fn:length("I LOVE CHINA!")} +
video的长度为:${fn:length(video)} +
video的值连接成一个字符串为:${fn:join(video,"、")} +
video的值连接成一个字符串为:${fn:join(video,"+")} +
video的值连接成一个字符串为:${fn:join(video,"*")} +
video的值连接成一个字符串为:${fn:join(video," ")} + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jstl/forEachDemo.jsp b/JavaWebCore/bin/WebContent/jstl/forEachDemo.jsp new file mode 100644 index 0000000..5aa96dd --- /dev/null +++ b/JavaWebCore/bin/WebContent/jstl/forEachDemo.jsp @@ -0,0 +1,26 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +Insert title here + + + <% + String[] books = { "Java Web程序设计", "操作系统", "Java语言程序设计", "C语言程序设计" }; + request.setAttribute("book", books); + %> + 全部书目: +
+ + ${bookName}
+
+ 显示从1到15的整数值: +
+ + ${i}  + + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jstl/forTokensDemo.jsp b/JavaWebCore/bin/WebContent/jstl/forTokensDemo.jsp new file mode 100644 index 0000000..d70efe6 --- /dev/null +++ b/JavaWebCore/bin/WebContent/jstl/forTokensDemo.jsp @@ -0,0 +1,23 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> + + + + +Insert title here + + + <% + String address = "Beijing,Shanghai;Nanjin!Xian,Jinan"; + request.setAttribute("address", address); + %> + <%-- + + <%-- ${status.count}、${addr}
--%> + ${status.current}、${addr}
+
+ + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jstl/jstlDemo.jsp b/JavaWebCore/bin/WebContent/jstl/jstlDemo.jsp new file mode 100644 index 0000000..b4edbd5 --- /dev/null +++ b/JavaWebCore/bin/WebContent/jstl/jstlDemo.jsp @@ -0,0 +1,31 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ page import="com.ddb.javaweb.bean.BookBean" %> + + + + +Insert title here + + + <% + BookBean bb = new BookBean(); + pageContext.setAttribute("bb", bb); + %> + <%-- --%> +
+ Hello World!
+ + ${'${'}name}:${name}
+ <%-- 100 --%> + 100 + ${'${'}name2}:${name2}
+
+

使用JavaBean:

+ + ${'${'}bb.bookName}:${bb.bookName}
+ JavaCore + ${'${'}bb.bookName}:${bb.bookName}
+ + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jstl/jstlDemo2.jsp b/JavaWebCore/bin/WebContent/jstl/jstlDemo2.jsp new file mode 100644 index 0000000..ec52751 --- /dev/null +++ b/JavaWebCore/bin/WebContent/jstl/jstlDemo2.jsp @@ -0,0 +1,35 @@ +<%@page import="com.ddb.javaweb.bean.BookBean"%> +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ page import="com.ddb.*" %> + + + + +Insert title here + + + +

使用JavaBean:

+ + ${'${'}bb.bookName}:${bb.bookName}
+ JavaCore + ${'${'}bb.bookName}:${bb.bookName}
+
+

outDemo:

+
+
+
+
+
+
+
+ <%-- --%> +
+ 这是默认值,仅当value为null时显示!
+
+ + + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jstl/jstlDemo3.jsp b/JavaWebCore/bin/WebContent/jstl/jstlDemo3.jsp new file mode 100644 index 0000000..3f0299f --- /dev/null +++ b/JavaWebCore/bin/WebContent/jstl/jstlDemo3.jsp @@ -0,0 +1,29 @@ +<%@page import="com.ddb.javaweb.bean.BookBean"%> +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ page import="com.ddb.*" %> + + + + +Insert title here + + + +
+ 100 + ${'${'}name2}:${name2} +

现在移除变量

+ + ${'${'}name2}:${name2} +
+

异常:

+ + ${param.a+1} + + <%-- 错误信息:${errMsg} --%> + + + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jstl/redirect2.jsp b/JavaWebCore/bin/WebContent/jstl/redirect2.jsp new file mode 100644 index 0000000..4166704 --- /dev/null +++ b/JavaWebCore/bin/WebContent/jstl/redirect2.jsp @@ -0,0 +1,17 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ page import="com.ddb.javaweb.bean.*"%> + + + + +redirect2 + + + 传递的参数值为: +
userName:${param.userName} +
passWord:${param.passWord} + + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jstl/redirectDemo.jsp b/JavaWebCore/bin/WebContent/jstl/redirectDemo.jsp new file mode 100644 index 0000000..757fcb6 --- /dev/null +++ b/JavaWebCore/bin/WebContent/jstl/redirectDemo.jsp @@ -0,0 +1,18 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ page import="com.ddb.javaweb.bean.*"%> + + + + +redirectDemo + + + + + + + + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jstl/urlDemo.jsp b/JavaWebCore/bin/WebContent/jstl/urlDemo.jsp new file mode 100644 index 0000000..7e9500a --- /dev/null +++ b/JavaWebCore/bin/WebContent/jstl/urlDemo.jsp @@ -0,0 +1,18 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ page import="com.ddb.javaweb.bean.*"%> + + + + +urlImportDemo + + + + <%-- ${loginUrl}
+ --%> + + + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/jstl/urlImportDemo.jsp b/JavaWebCore/bin/WebContent/jstl/urlImportDemo.jsp new file mode 100644 index 0000000..84583a6 --- /dev/null +++ b/JavaWebCore/bin/WebContent/jstl/urlImportDemo.jsp @@ -0,0 +1,20 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> +<%@ page import="com.ddb.javaweb.bean.*"%> + + + + +urlImportDemo + + + <%-- --%> + + <%-- ${HelloWorld} --%> + <%-- + ${baidu} --%> + + + + \ No newline at end of file diff --git a/JavaWebCore/bin/WebContent/servlet/Footer.html b/JavaWebCore/bin/WebContent/servlet/Footer.html new file mode 100644 index 0000000..f23eb2e --- /dev/null +++ b/JavaWebCore/bin/WebContent/servlet/Footer.html @@ -0,0 +1,5 @@ +
+
+ Copyright © 2002 ABC services Private + Limited +
diff --git a/JavaWebCore/bin/WebContent/servlet/login.jsp b/JavaWebCore/bin/WebContent/servlet/login.jsp new file mode 100644 index 0000000..d4cde25 --- /dev/null +++ b/JavaWebCore/bin/WebContent/servlet/login.jsp @@ -0,0 +1,21 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +DoGET()和DoPOST()测试 + + +

请输入用户信息:

+
+ <%--
--%> + +
+ +

+ +
+

+ + diff --git a/JavaWebCore/bin/WebContent/servlet/threadSafe.jsp b/JavaWebCore/bin/WebContent/servlet/threadSafe.jsp new file mode 100644 index 0000000..38035b0 --- /dev/null +++ b/JavaWebCore/bin/WebContent/servlet/threadSafe.jsp @@ -0,0 +1,15 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Insert title here + + +
+ + +
+ + diff --git a/JavaWebCore/bin/WebContent/servlet/welcome.html b/JavaWebCore/bin/WebContent/servlet/welcome.html new file mode 100644 index 0000000..218593c --- /dev/null +++ b/JavaWebCore/bin/WebContent/servlet/welcome.html @@ -0,0 +1,10 @@ + + + + +Insert title here + + +

欢迎访问我们的网页!

+ + \ No newline at end of file diff --git a/JavaWebCore/bin/src/com/ddb/javaweb/bean/BookBean.class b/JavaWebCore/bin/src/com/ddb/javaweb/bean/BookBean.class new file mode 100644 index 0000000..ff2f2df Binary files /dev/null and b/JavaWebCore/bin/src/com/ddb/javaweb/bean/BookBean.class differ diff --git a/JavaWebCore/bin/src/com/ddb/javaweb/filter/EncodingFilter.class b/JavaWebCore/bin/src/com/ddb/javaweb/filter/EncodingFilter.class new file mode 100644 index 0000000..28b3456 Binary files /dev/null and b/JavaWebCore/bin/src/com/ddb/javaweb/filter/EncodingFilter.class differ diff --git a/JavaWebCore/bin/src/com/ddb/javaweb/filter/PasswordFilter.class b/JavaWebCore/bin/src/com/ddb/javaweb/filter/PasswordFilter.class new file mode 100644 index 0000000..3f5bb70 Binary files /dev/null and b/JavaWebCore/bin/src/com/ddb/javaweb/filter/PasswordFilter.class differ diff --git a/JavaWebCore/bin/src/com/ddb/javaweb/filter/UserNameFilter.class b/JavaWebCore/bin/src/com/ddb/javaweb/filter/UserNameFilter.class new file mode 100644 index 0000000..540b65e Binary files /dev/null and b/JavaWebCore/bin/src/com/ddb/javaweb/filter/UserNameFilter.class differ diff --git a/JavaWebCore/bin/src/com/ddb/javaweb/listener/ListenerRequestDemo.class b/JavaWebCore/bin/src/com/ddb/javaweb/listener/ListenerRequestDemo.class new file mode 100644 index 0000000..b9960c5 Binary files /dev/null and b/JavaWebCore/bin/src/com/ddb/javaweb/listener/ListenerRequestDemo.class differ diff --git a/JavaWebCore/bin/src/com/ddb/javaweb/servlet/ABCHomePage.class b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/ABCHomePage.class new file mode 100644 index 0000000..f2ef08a Binary files /dev/null and b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/ABCHomePage.class differ diff --git a/JavaWebCore/bin/src/com/ddb/javaweb/servlet/DisplayServlet.class b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/DisplayServlet.class new file mode 100644 index 0000000..ed99aa4 Binary files /dev/null and b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/DisplayServlet.class differ diff --git a/JavaWebCore/bin/src/com/ddb/javaweb/servlet/EnterDemo.class b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/EnterDemo.class new file mode 100644 index 0000000..2cb5cfa Binary files /dev/null and b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/EnterDemo.class differ diff --git a/JavaWebCore/bin/src/com/ddb/javaweb/servlet/FromServlet.class b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/FromServlet.class new file mode 100644 index 0000000..ae2e656 Binary files /dev/null and b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/FromServlet.class differ diff --git a/JavaWebCore/bin/src/com/ddb/javaweb/servlet/HeaderServlet.class b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/HeaderServlet.class new file mode 100644 index 0000000..936ac43 Binary files /dev/null and b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/HeaderServlet.class differ diff --git a/JavaWebCore/bin/src/com/ddb/javaweb/servlet/InitOrderDemo.class b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/InitOrderDemo.class new file mode 100644 index 0000000..7570399 Binary files /dev/null and b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/InitOrderDemo.class differ diff --git a/JavaWebCore/bin/src/com/ddb/javaweb/servlet/InitOrderDemo2.class b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/InitOrderDemo2.class new file mode 100644 index 0000000..674ae4f Binary files /dev/null and b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/InitOrderDemo2.class differ diff --git a/JavaWebCore/bin/src/com/ddb/javaweb/servlet/InitOrderDemo3.class b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/InitOrderDemo3.class new file mode 100644 index 0000000..17d1b4b Binary files /dev/null and b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/InitOrderDemo3.class differ diff --git a/JavaWebCore/bin/src/com/ddb/javaweb/servlet/InitParameter.class b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/InitParameter.class new file mode 100644 index 0000000..924609e Binary files /dev/null and b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/InitParameter.class differ diff --git a/JavaWebCore/bin/src/com/ddb/javaweb/servlet/InitServletDemo.class b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/InitServletDemo.class new file mode 100644 index 0000000..3b718b6 Binary files /dev/null and b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/InitServletDemo.class differ diff --git a/JavaWebCore/bin/src/com/ddb/javaweb/servlet/InitServletDemo2.class b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/InitServletDemo2.class new file mode 100644 index 0000000..bbdf79d Binary files /dev/null and b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/InitServletDemo2.class differ diff --git a/JavaWebCore/bin/src/com/ddb/javaweb/servlet/InitServletDemo3.class b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/InitServletDemo3.class new file mode 100644 index 0000000..69ac4cb Binary files /dev/null and b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/InitServletDemo3.class differ diff --git a/JavaWebCore/bin/src/com/ddb/javaweb/servlet/LoginDemo.class b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/LoginDemo.class new file mode 100644 index 0000000..582657b Binary files /dev/null and b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/LoginDemo.class differ diff --git a/JavaWebCore/bin/src/com/ddb/javaweb/servlet/MyLoginServletDemo.class b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/MyLoginServletDemo.class new file mode 100644 index 0000000..cbec10a Binary files /dev/null and b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/MyLoginServletDemo.class differ diff --git a/JavaWebCore/bin/src/com/ddb/javaweb/servlet/OutputInfo.class b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/OutputInfo.class new file mode 100644 index 0000000..ff90286 Binary files /dev/null and b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/OutputInfo.class differ diff --git a/JavaWebCore/bin/src/com/ddb/javaweb/servlet/Redirect.class b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/Redirect.class new file mode 100644 index 0000000..007b84c Binary files /dev/null and b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/Redirect.class differ diff --git a/JavaWebCore/bin/src/com/ddb/javaweb/servlet/SendError.class b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/SendError.class new file mode 100644 index 0000000..4850209 Binary files /dev/null and b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/SendError.class differ diff --git a/JavaWebCore/bin/src/com/ddb/javaweb/servlet/ServletDemo.class b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/ServletDemo.class new file mode 100644 index 0000000..eefb548 Binary files /dev/null and b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/ServletDemo.class differ diff --git a/JavaWebCore/bin/src/com/ddb/javaweb/servlet/ThreadSafe.class b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/ThreadSafe.class new file mode 100644 index 0000000..37ba01e Binary files /dev/null and b/JavaWebCore/bin/src/com/ddb/javaweb/servlet/ThreadSafe.class differ diff --git a/SpringMvc4.3-Start1/.classpath b/SpringMvc4.3-Start1/.classpath new file mode 100644 index 0000000..8387128 --- /dev/null +++ b/SpringMvc4.3-Start1/.classpath @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/SpringMvc4.3-Start1/.gitignore b/SpringMvc4.3-Start1/.gitignore new file mode 100644 index 0000000..84c048a --- /dev/null +++ b/SpringMvc4.3-Start1/.gitignore @@ -0,0 +1 @@ +/build/ diff --git a/SpringMvc4.3-Start1/.project b/SpringMvc4.3-Start1/.project new file mode 100644 index 0000000..87dc68b --- /dev/null +++ b/SpringMvc4.3-Start1/.project @@ -0,0 +1,43 @@ + + + SpringMvc4.3-Start1 + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.jboss.tools.jst.web.kb.kbbuilder + + + + + org.jboss.tools.cdi.core.cdibuilder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.jdt.core.javanature + org.jboss.tools.jst.web.kb.kbnature + org.jboss.tools.cdi.core.cdinature + org.eclipse.wst.jsdt.core.jsNature + + diff --git a/SpringMvc4.3-Start1/.settings/.jsdtscope b/SpringMvc4.3-Start1/.settings/.jsdtscope new file mode 100644 index 0000000..92e666d --- /dev/null +++ b/SpringMvc4.3-Start1/.settings/.jsdtscope @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/SpringMvc4.3-Start1/.settings/org.eclipse.jdt.core.prefs b/SpringMvc4.3-Start1/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..0c68a61 --- /dev/null +++ b/SpringMvc4.3-Start1/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/SpringMvc4.3-Start1/.settings/org.eclipse.wst.common.component b/SpringMvc4.3-Start1/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..ba550cb --- /dev/null +++ b/SpringMvc4.3-Start1/.settings/org.eclipse.wst.common.component @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/SpringMvc4.3-Start1/.settings/org.eclipse.wst.common.project.facet.core.xml b/SpringMvc4.3-Start1/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000..b47f48a --- /dev/null +++ b/SpringMvc4.3-Start1/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/SpringMvc4.3-Start1/.settings/org.eclipse.wst.jsdt.ui.superType.container b/SpringMvc4.3-Start1/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 0000000..3bd5d0a --- /dev/null +++ b/SpringMvc4.3-Start1/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/SpringMvc4.3-Start1/.settings/org.eclipse.wst.jsdt.ui.superType.name b/SpringMvc4.3-Start1/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 0000000..05bd71b --- /dev/null +++ b/SpringMvc4.3-Start1/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window \ No newline at end of file diff --git a/SpringMvc4.3-Start1/WebContent/META-INF/MANIFEST.MF b/SpringMvc4.3-Start1/WebContent/META-INF/MANIFEST.MF new file mode 100644 index 0000000..5e94951 --- /dev/null +++ b/SpringMvc4.3-Start1/WebContent/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/SpringMvc4.3-Start1/WebContent/WEB-INF/config/springmvc-config.xml b/SpringMvc4.3-Start1/WebContent/WEB-INF/config/springmvc-config.xml new file mode 100644 index 0000000..fccf335 --- /dev/null +++ b/SpringMvc4.3-Start1/WebContent/WEB-INF/config/springmvc-config.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SpringMvc4.3-Start1/WebContent/WEB-INF/jsp/ProductDel.jsp b/SpringMvc4.3-Start1/WebContent/WEB-INF/jsp/ProductDel.jsp new file mode 100644 index 0000000..772d446 --- /dev/null +++ b/SpringMvc4.3-Start1/WebContent/WEB-INF/jsp/ProductDel.jsp @@ -0,0 +1,12 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Insert title here + + + 显示所有产品 + + \ No newline at end of file diff --git a/SpringMvc4.3-Start1/WebContent/WEB-INF/jsp/ProductForm.jsp b/SpringMvc4.3-Start1/WebContent/WEB-INF/jsp/ProductForm.jsp new file mode 100644 index 0000000..27bf602 --- /dev/null +++ b/SpringMvc4.3-Start1/WebContent/WEB-INF/jsp/ProductForm.jsp @@ -0,0 +1,39 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Insert title here + + +
+
+
+ Add a product + + + + + + + + + + + + + + + +
+ + + +
+
+
+ +
+ + \ No newline at end of file diff --git a/SpringMvc4.3-Start1/WebContent/WEB-INF/jsp/ProductList.jsp b/SpringMvc4.3-Start1/WebContent/WEB-INF/jsp/ProductList.jsp new file mode 100644 index 0000000..14a1c6a --- /dev/null +++ b/SpringMvc4.3-Start1/WebContent/WEB-INF/jsp/ProductList.jsp @@ -0,0 +1,38 @@ + +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> + + + + +Insert title here + + +
+ + + + + + + + + + + + + + + + + + + + + + +
编号产品名称厂商生产地址简介价格操作
${vs.count}${product.name}${product.vender}${product.address}${product.description}${product.price}删除修改
+
+ + \ No newline at end of file diff --git a/SpringMvc4.3-Start1/WebContent/WEB-INF/jsp/ProductUp.jsp b/SpringMvc4.3-Start1/WebContent/WEB-INF/jsp/ProductUp.jsp new file mode 100644 index 0000000..a0b5f31 --- /dev/null +++ b/SpringMvc4.3-Start1/WebContent/WEB-INF/jsp/ProductUp.jsp @@ -0,0 +1,36 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Insert title here + + +
+
+ Update a product + + + + + + + + + + + + + + + + +
+ +
+
+ + \ No newline at end of file diff --git a/SpringMvc4.3-Start1/WebContent/WEB-INF/jsp/ProductUpdated.jsp b/SpringMvc4.3-Start1/WebContent/WEB-INF/jsp/ProductUpdated.jsp new file mode 100644 index 0000000..b28d754 --- /dev/null +++ b/SpringMvc4.3-Start1/WebContent/WEB-INF/jsp/ProductUpdated.jsp @@ -0,0 +1,13 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Insert title here + + + Tips:${message}
+ 显示所有产品 + + \ No newline at end of file diff --git a/SpringMvc4.3-Start1/WebContent/WEB-INF/jsp/ProductView.jsp b/SpringMvc4.3-Start1/WebContent/WEB-INF/jsp/ProductView.jsp new file mode 100644 index 0000000..ee6aced --- /dev/null +++ b/SpringMvc4.3-Start1/WebContent/WEB-INF/jsp/ProductView.jsp @@ -0,0 +1,23 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Insert title here + + +
+

The product has been saved!

+
Details:
+ Tips:${message}
+ Product ID:${product.id}
+ Product Name:${product.name}
+ Product Vender:${product.vender}
+ Address:${product.address}
+ Description:${product.description}
+ Price:¥${product.price}
+ 显示所有产品 +
+ + \ No newline at end of file diff --git a/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/commons-logging-1.2.jar b/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/commons-logging-1.2.jar new file mode 100644 index 0000000..93a3b9f Binary files /dev/null and b/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/commons-logging-1.2.jar differ diff --git a/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/jstl.jar b/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/jstl.jar new file mode 100644 index 0000000..a02abec Binary files /dev/null and b/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/jstl.jar differ diff --git a/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/log4j-1.2.17.jar b/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/log4j-1.2.17.jar new file mode 100644 index 0000000..068867e Binary files /dev/null and b/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/log4j-1.2.17.jar differ diff --git a/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/lombok-1.16.12.jar b/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/lombok-1.16.12.jar new file mode 100644 index 0000000..23cc160 Binary files /dev/null and b/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/lombok-1.16.12.jar differ diff --git a/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/spring-aop-4.3.3.RELEASE.jar b/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/spring-aop-4.3.3.RELEASE.jar new file mode 100644 index 0000000..7f78221 Binary files /dev/null and b/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/spring-aop-4.3.3.RELEASE.jar differ diff --git a/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/spring-beans-4.3.3.RELEASE.jar b/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/spring-beans-4.3.3.RELEASE.jar new file mode 100644 index 0000000..8d25ec2 Binary files /dev/null and b/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/spring-beans-4.3.3.RELEASE.jar differ diff --git a/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/spring-context-4.3.3.RELEASE.jar b/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/spring-context-4.3.3.RELEASE.jar new file mode 100644 index 0000000..fbf01c7 Binary files /dev/null and b/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/spring-context-4.3.3.RELEASE.jar differ diff --git a/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/spring-core-4.3.3.RELEASE.jar b/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/spring-core-4.3.3.RELEASE.jar new file mode 100644 index 0000000..ded56ad Binary files /dev/null and b/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/spring-core-4.3.3.RELEASE.jar differ diff --git a/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/spring-expression-4.3.3.RELEASE.jar b/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/spring-expression-4.3.3.RELEASE.jar new file mode 100644 index 0000000..c30b677 Binary files /dev/null and b/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/spring-expression-4.3.3.RELEASE.jar differ diff --git a/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/spring-web-4.3.3.RELEASE.jar b/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/spring-web-4.3.3.RELEASE.jar new file mode 100644 index 0000000..e178d80 Binary files /dev/null and b/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/spring-web-4.3.3.RELEASE.jar differ diff --git a/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/spring-webmvc-4.3.3.RELEASE.jar b/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/spring-webmvc-4.3.3.RELEASE.jar new file mode 100644 index 0000000..5686d2a Binary files /dev/null and b/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/spring-webmvc-4.3.3.RELEASE.jar differ diff --git a/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/standard-1.1.2.jar b/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/standard-1.1.2.jar new file mode 100644 index 0000000..bc528ac Binary files /dev/null and b/SpringMvc4.3-Start1/WebContent/WEB-INF/lib/standard-1.1.2.jar differ diff --git a/SpringMvc4.3-Start1/WebContent/WEB-INF/web.xml b/SpringMvc4.3-Start1/WebContent/WEB-INF/web.xml new file mode 100644 index 0000000..e5b0fda --- /dev/null +++ b/SpringMvc4.3-Start1/WebContent/WEB-INF/web.xml @@ -0,0 +1,43 @@ + + + SpringMvc4.3-Start1 + + index.html + + + + + springmvc + org.springframework.web.servlet.DispatcherServlet + + contextConfigLocation + /WEB-INF/config/springmvc-config.xml + + 1 + + + springmvc + + + *.action + + + + characterEncodingFilter + org.springframework.web.filter.CharacterEncodingFilter + + encoding + UTF-8 + + + forceEncoding + true + + + + characterEncodingFilter + /* + + + + \ No newline at end of file diff --git a/SpringMvc4.3-Start1/WebContent/index.html b/SpringMvc4.3-Start1/WebContent/index.html new file mode 100644 index 0000000..c155b0a --- /dev/null +++ b/SpringMvc4.3-Start1/WebContent/index.html @@ -0,0 +1,11 @@ + + + + +Insert title here + + +

Hello SpringMVC!

+ 添加产品 + + \ No newline at end of file diff --git a/SpringMvc4.3-Start1/src/com/gc/springmvc/controller/ProductController.java b/SpringMvc4.3-Start1/src/com/gc/springmvc/controller/ProductController.java new file mode 100644 index 0000000..9a50409 --- /dev/null +++ b/SpringMvc4.3-Start1/src/com/gc/springmvc/controller/ProductController.java @@ -0,0 +1,117 @@ +package com.gc.springmvc.controller; + +import java.util.ArrayList; +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.websocket.server.PathParam; + +import org.apache.log4j.Logger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpRequest; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; + +import com.gc.springmvc.domian.Product; +import com.gc.springmvc.form.ProductForm; +import com.gc.springmvc.service.ProductService; + +@Controller +public class ProductController { + private static final Logger logger = Logger.getLogger(ProductController.class); + + //Զעݿдݵ + @Autowired + private ProductService productService; + + @Autowired + private HttpServletRequest request; + + @RequestMapping(value="/product_input") + public String inputProduct() { + logger.info("inputProduct ã "); + return "ProductForm"; + } + @RequestMapping(value="/product_save",method=RequestMethod.POST) + public String saveProduct(ProductForm productForm ,RedirectAttributes redirectAttributes) { + logger.info("saveProductã"); + + Product product = new Product(); + product.setName(productForm.getName()); + product.setVender(productForm.getVender()); + product.setAddress(productForm.getAddress()); + product.setDescription(productForm.getDescription()); + + try { + product.setPrice(Double.parseDouble(productForm.getPrice())); + } catch (NumberFormatException e) { + e.printStackTrace(); + } + + //add product + Product saveProduct = productService.add(product); + //ʹĶ󡣿ضֵ + redirectAttributes.addFlashAttribute("message","the product was successful added!"); + return "redirect:/product_view/"+saveProduct.getId()+".action"; + } + @RequestMapping(value="product_view/{id}")//{}ڵidΪ· + public String viewProduct(@PathVariable Long id,Model model){ + Product product = productService.get(id); + model.addAttribute("product",product); + return "ProductView"; + } + @RequestMapping(value="product_retrieve")//{}ڵidΪ· + public String sendProduct(@RequestParam Long id,Model model){ + Product product = productService.get(id); + model.addAttribute("product",product); + return "ProductView"; + } + + + //½һʵactionչʾвƷϢ + @RequestMapping(value="/product_view/product_show") + public String showPro(Model model){ + List proList = productService.proShow(); + model.addAttribute("proList",proList); + return"ProductList"; + } + + //idɾƷ + @RequestMapping(value="/product_view/product_del") + public String del(@RequestParam long id ) { + productService.del(id); + return "ProductDel"; + } + + //޸ѡ + @RequestMapping(value="/product_view/product_uping") + public String updatePro(@RequestParam long id,Model model){ + Product product = productService.update(id); + model.addAttribute("product", product); + return "ProductUp"; + } + //ɹ޸ + @RequestMapping(value="/product_view/product_updated" ,method=RequestMethod.POST) + public String updated(ProductForm productForm ) { + long id =Long.parseLong(request.getParameter("id")); + Product product = productService.get(id); + product.setName(productForm.getName()); + product.setVender(productForm.getVender()); + product.setAddress(productForm.getAddress()); + product.setDescription(productForm.getDescription()); + + try { + product.setPrice(Double.parseDouble(productForm.getPrice())); + } catch (NumberFormatException e) { + e.printStackTrace(); + } + + return "ProductUpdated"; + } + +} diff --git a/SpringMvc4.3-Start1/src/com/gc/springmvc/domian/Product.java b/SpringMvc4.3-Start1/src/com/gc/springmvc/domian/Product.java new file mode 100644 index 0000000..01575e1 --- /dev/null +++ b/SpringMvc4.3-Start1/src/com/gc/springmvc/domian/Product.java @@ -0,0 +1,47 @@ +package com.gc.springmvc.domian; + +public class Product { + private Long id; + private String name; + private String description; + private Double price; + private String address; + private String vender; + public Long getId() { + return id; + } + public void setId(Long id) { + this.id = id; + } + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + public Double getPrice() { + return price; + } + public void setPrice(Double price) { + this.price = price; + } + public String getAddress() { + return address; + } + public void setAddress(String address) { + this.address = address; + } + public String getVender() { + return vender; + } + public void setVender(String vender) { + this.vender = vender; + } + +} diff --git a/SpringMvc4.3-Start1/src/com/gc/springmvc/form/ProductForm.java b/SpringMvc4.3-Start1/src/com/gc/springmvc/form/ProductForm.java new file mode 100644 index 0000000..3704f0c --- /dev/null +++ b/SpringMvc4.3-Start1/src/com/gc/springmvc/form/ProductForm.java @@ -0,0 +1,15 @@ +package com.gc.springmvc.form; + +import lombok.Getter; +import lombok.Setter; + +@Setter +@Getter +public class ProductForm { + + private String name; + private String address; + private String vender; + private String description; + private String price; +} diff --git a/SpringMvc4.3-Start1/src/com/gc/springmvc/service/ProductService.java b/SpringMvc4.3-Start1/src/com/gc/springmvc/service/ProductService.java new file mode 100644 index 0000000..d472165 --- /dev/null +++ b/SpringMvc4.3-Start1/src/com/gc/springmvc/service/ProductService.java @@ -0,0 +1,14 @@ +package com.gc.springmvc.service; + +import java.util.List; + +import com.gc.springmvc.domian.Product; + +public interface ProductService { + Product add(Product product); + Product get(long id); + List proShow(); + List del(long id); + Product update(long id); + List updated(Product product ,long id); +} diff --git a/SpringMvc4.3-Start1/src/com/gc/springmvc/service/impl/ProductServiceImpl.java b/SpringMvc4.3-Start1/src/com/gc/springmvc/service/impl/ProductServiceImpl.java new file mode 100644 index 0000000..0a70350 --- /dev/null +++ b/SpringMvc4.3-Start1/src/com/gc/springmvc/service/impl/ProductServiceImpl.java @@ -0,0 +1,75 @@ +package com.gc.springmvc.service.impl; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.concurrent.atomic.AtomicLong; + +import org.omg.PortableServer.POA; +import org.springframework.stereotype.Service; + +import com.gc.springmvc.domian.Product; +import com.gc.springmvc.service.ProductService; +@Service +public class ProductServiceImpl implements ProductService { + private Map products = new HashMap(); + private AtomicLong generator = new AtomicLong(); + + public ProductServiceImpl() { + Product product = new Product(); + product.setName("MiBook"); + product.setDescription("MiBook write code is very cool!"); + product.setPrice(4999.0d); + add(product); + // TODO Auto-generated constructor stub + } + @Override + public Product add(Product product) { + long newid = generator.incrementAndGet(); + product.setId(newid); + + //浽MAPУ˲ģݱ浽ݿ + products.put(newid, product); + return product; + } + + @Override + public Product get(long id) { + return products.get(id); + } + @Override + public List proShow() { + List listShow = new ArrayList(products.values()); + /*Set> inSet = new HashSet>(); + inSet = products.entrySet(); + Iterator> iterator = inSet.iterator(); + for(iterator.hasNext()){ + listShow.add(iterator.next());*/ + return listShow; + } + @Override + public List del(long id) { + products.remove(id); + List listShow = new ArrayList(products.values()); + return listShow; + } + @Override + public Product update(long id) { + Product product = products.get(id); + return product; + } + @Override + public List updated(Product product, long id) { + products.replace(id, product); + List listShow = new ArrayList(products.values()); + return listShow; + } + + } + + diff --git a/SpringMvc4.3-Start1/src/log4j.properties b/SpringMvc4.3-Start1/src/log4j.properties new file mode 100644 index 0000000..a3b4491 --- /dev/null +++ b/SpringMvc4.3-Start1/src/log4j.properties @@ -0,0 +1,9 @@ +# rootLogger\u662F\u6240\u6709\u65E5\u5FD7\u7684\u6839\u65E5\u5FD7,\u4FEE\u6539\u8BE5\u65E5\u5FD7\u5C5E\u6027\u5C06\u5BF9\u6240\u6709\u65E5\u5FD7\u8D77\u4F5C\u7528 +# \u4E0B\u9762\u7684\u5C5E\u6027\u914D\u7F6E\u4E2D,\u6240\u6709\u65E5\u5FD7\u7684\u8F93\u51FA\u7EA7\u522B\u662Finfo,\u8F93\u51FA\u6E90\u662Fconsole +log4j.rootLogger=info,console +# \u5B9A\u4E49\u8F93\u51FA\u6E90\u7684\u8F93\u5165\u4F4D\u7F6E\u662F\u63A7\u5236\u53F0 +log4j.appender.console=org.apache.log4j.ConsoleAppender +# \u5B9A\u4E49\u8F93\u51FA\u65E5\u5FD7\u7684\u5E03\u5C40\u91C7\u7528\u7684\u7C7B +log4j.appender.console.layout=org.apache.log4j.PatternLayout +# \u5B9A\u4E49\u65E5\u5FD7\u8F93\u51FA\u5E03\u5C40 +log4j.appender.console.layout.ConversionPattern=%d %p [%c] - %m%n diff --git a/Struts23-Start/.classpath b/Struts23-Start/.classpath new file mode 100644 index 0000000..05506d5 --- /dev/null +++ b/Struts23-Start/.classpath @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Struts23-Start/.project b/Struts23-Start/.project new file mode 100644 index 0000000..9f23c69 --- /dev/null +++ b/Struts23-Start/.project @@ -0,0 +1,31 @@ + + + Struts23-Start + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.wst.common.project.facet.core.builder + + + + + org.eclipse.wst.validation.validationbuilder + + + + + + org.eclipse.jem.workbench.JavaEMFNature + org.eclipse.wst.common.modulecore.ModuleCoreNature + org.eclipse.wst.common.project.facet.core.nature + org.eclipse.jdt.core.javanature + org.eclipse.wst.jsdt.core.jsNature + + diff --git a/Struts23-Start/.settings/.jsdtscope b/Struts23-Start/.settings/.jsdtscope new file mode 100644 index 0000000..92e666d --- /dev/null +++ b/Struts23-Start/.settings/.jsdtscope @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/Struts23-Start/.settings/org.eclipse.jdt.core.prefs b/Struts23-Start/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..0c68a61 --- /dev/null +++ b/Struts23-Start/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/Struts23-Start/.settings/org.eclipse.wst.common.component b/Struts23-Start/.settings/org.eclipse.wst.common.component new file mode 100644 index 0000000..6438c0d --- /dev/null +++ b/Struts23-Start/.settings/org.eclipse.wst.common.component @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/Struts23-Start/.settings/org.eclipse.wst.common.project.facet.core.xml b/Struts23-Start/.settings/org.eclipse.wst.common.project.facet.core.xml new file mode 100644 index 0000000..f8bc3b7 --- /dev/null +++ b/Struts23-Start/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/Struts23-Start/.settings/org.eclipse.wst.jsdt.ui.superType.container b/Struts23-Start/.settings/org.eclipse.wst.jsdt.ui.superType.container new file mode 100644 index 0000000..3bd5d0a --- /dev/null +++ b/Struts23-Start/.settings/org.eclipse.wst.jsdt.ui.superType.container @@ -0,0 +1 @@ +org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/Struts23-Start/.settings/org.eclipse.wst.jsdt.ui.superType.name b/Struts23-Start/.settings/org.eclipse.wst.jsdt.ui.superType.name new file mode 100644 index 0000000..05bd71b --- /dev/null +++ b/Struts23-Start/.settings/org.eclipse.wst.jsdt.ui.superType.name @@ -0,0 +1 @@ +Window \ No newline at end of file diff --git a/Struts23-Start/.tern-project b/Struts23-Start/.tern-project new file mode 100644 index 0000000..f030bd1 --- /dev/null +++ b/Struts23-Start/.tern-project @@ -0,0 +1,17 @@ +{ + "plugins": { + "guess-types": { + + }, + "outline": { + + }, + "angular": { + + } + }, + "libs": [ + "ecma5", + "browser" + ] +} \ No newline at end of file diff --git a/Struts23-Start/WebContent/META-INF/MANIFEST.MF b/Struts23-Start/WebContent/META-INF/MANIFEST.MF new file mode 100644 index 0000000..5e94951 --- /dev/null +++ b/Struts23-Start/WebContent/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/Struts23-Start/WebContent/WEB-INF/lib/asm-3.3.jar b/Struts23-Start/WebContent/WEB-INF/lib/asm-3.3.jar new file mode 100644 index 0000000..d44dfd8 Binary files /dev/null and b/Struts23-Start/WebContent/WEB-INF/lib/asm-3.3.jar differ diff --git a/Struts23-Start/WebContent/WEB-INF/lib/asm-commons-3.3.jar b/Struts23-Start/WebContent/WEB-INF/lib/asm-commons-3.3.jar new file mode 100644 index 0000000..e509842 Binary files /dev/null and b/Struts23-Start/WebContent/WEB-INF/lib/asm-commons-3.3.jar differ diff --git a/Struts23-Start/WebContent/WEB-INF/lib/asm-tree-3.3.jar b/Struts23-Start/WebContent/WEB-INF/lib/asm-tree-3.3.jar new file mode 100644 index 0000000..374bc2e Binary files /dev/null and b/Struts23-Start/WebContent/WEB-INF/lib/asm-tree-3.3.jar differ diff --git a/Struts23-Start/WebContent/WEB-INF/lib/commons-fileupload-1.3.2.jar b/Struts23-Start/WebContent/WEB-INF/lib/commons-fileupload-1.3.2.jar new file mode 100644 index 0000000..4975590 Binary files /dev/null and b/Struts23-Start/WebContent/WEB-INF/lib/commons-fileupload-1.3.2.jar differ diff --git a/Struts23-Start/WebContent/WEB-INF/lib/commons-io-2.2.jar b/Struts23-Start/WebContent/WEB-INF/lib/commons-io-2.2.jar new file mode 100644 index 0000000..84ca565 Binary files /dev/null and b/Struts23-Start/WebContent/WEB-INF/lib/commons-io-2.2.jar differ diff --git a/Struts23-Start/WebContent/WEB-INF/lib/commons-lang3-3.2.jar b/Struts23-Start/WebContent/WEB-INF/lib/commons-lang3-3.2.jar new file mode 100644 index 0000000..a30d272 Binary files /dev/null and b/Struts23-Start/WebContent/WEB-INF/lib/commons-lang3-3.2.jar differ diff --git a/Struts23-Start/WebContent/WEB-INF/lib/freemarker-2.3.22.jar b/Struts23-Start/WebContent/WEB-INF/lib/freemarker-2.3.22.jar new file mode 100644 index 0000000..a67a1c1 Binary files /dev/null and b/Struts23-Start/WebContent/WEB-INF/lib/freemarker-2.3.22.jar differ diff --git a/Struts23-Start/WebContent/WEB-INF/lib/javassist-3.11.0.GA.jar b/Struts23-Start/WebContent/WEB-INF/lib/javassist-3.11.0.GA.jar new file mode 100644 index 0000000..b3bfeeb Binary files /dev/null and b/Struts23-Start/WebContent/WEB-INF/lib/javassist-3.11.0.GA.jar differ diff --git a/Struts23-Start/WebContent/WEB-INF/lib/log4j-1.2.17.jar b/Struts23-Start/WebContent/WEB-INF/lib/log4j-1.2.17.jar new file mode 100644 index 0000000..068867e Binary files /dev/null and b/Struts23-Start/WebContent/WEB-INF/lib/log4j-1.2.17.jar differ diff --git a/Struts23-Start/WebContent/WEB-INF/lib/ognl-3.0.19.jar b/Struts23-Start/WebContent/WEB-INF/lib/ognl-3.0.19.jar new file mode 100644 index 0000000..8f31612 Binary files /dev/null and b/Struts23-Start/WebContent/WEB-INF/lib/ognl-3.0.19.jar differ diff --git a/Struts23-Start/WebContent/WEB-INF/lib/struts2-core-2.3.30.jar b/Struts23-Start/WebContent/WEB-INF/lib/struts2-core-2.3.30.jar new file mode 100644 index 0000000..00d8c96 Binary files /dev/null and b/Struts23-Start/WebContent/WEB-INF/lib/struts2-core-2.3.30.jar differ diff --git a/Struts23-Start/WebContent/WEB-INF/lib/xwork-core-2.3.30.jar b/Struts23-Start/WebContent/WEB-INF/lib/xwork-core-2.3.30.jar new file mode 100644 index 0000000..f908ceb Binary files /dev/null and b/Struts23-Start/WebContent/WEB-INF/lib/xwork-core-2.3.30.jar differ diff --git a/Struts23-Start/WebContent/WEB-INF/web.xml b/Struts23-Start/WebContent/WEB-INF/web.xml new file mode 100644 index 0000000..5c271ee --- /dev/null +++ b/Struts23-Start/WebContent/WEB-INF/web.xml @@ -0,0 +1,16 @@ + + + Struts23-Start + + + struts2 + org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter + + + struts2 + /* + + + login/login.jsp + + \ No newline at end of file diff --git a/Struts23-Start/WebContent/login/error.jsp b/Struts23-Start/WebContent/login/error.jsp new file mode 100644 index 0000000..a060152 --- /dev/null +++ b/Struts23-Start/WebContent/login/error.jsp @@ -0,0 +1,13 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +Insert title here + + + 用户名或密码输入错误。。。 + 返回 + + \ No newline at end of file diff --git a/Struts23-Start/WebContent/login/login.jsp b/Struts23-Start/WebContent/login/login.jsp new file mode 100644 index 0000000..7d5b664 --- /dev/null +++ b/Struts23-Start/WebContent/login/login.jsp @@ -0,0 +1,29 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + <%@taglib uri="/struts-tags" prefix="s"%> + + + + +Insert title here + + + + + + + + + + + + + + + +
用户:
密码:
+ +
+
+ + \ No newline at end of file diff --git a/Struts23-Start/WebContent/login/login2.jsp b/Struts23-Start/WebContent/login/login2.jsp new file mode 100644 index 0000000..bd12020 --- /dev/null +++ b/Struts23-Start/WebContent/login/login2.jsp @@ -0,0 +1,29 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + <%@taglib uri="/struts-tags" prefix="s"%> + + + + +Insert title here + + + + + + + + + + + + + + + +
用户:
密码:
+ +
+
+ + \ No newline at end of file diff --git a/Struts23-Start/WebContent/login/login3.jsp b/Struts23-Start/WebContent/login/login3.jsp new file mode 100644 index 0000000..d8af065 --- /dev/null +++ b/Struts23-Start/WebContent/login/login3.jsp @@ -0,0 +1,29 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + <%@taglib uri="/struts-tags" prefix="s"%> + + + + +Insert title here + + + + + + + + + + + + + + + +
用户:
密码:
+ +
+
+ + \ No newline at end of file diff --git a/Struts23-Start/WebContent/login/success.jsp b/Struts23-Start/WebContent/login/success.jsp new file mode 100644 index 0000000..a290a8e --- /dev/null +++ b/Struts23-Start/WebContent/login/success.jsp @@ -0,0 +1,22 @@ +<%@ page language="java" contentType="text/html; charset=UTF-8" + pageEncoding="UTF-8"%> + + + + +login success + + + + + + + + + + + +
用户:${username}
密码:${password}
+ 返回+ + + \ No newline at end of file diff --git a/Struts23-Start/build/classes/com/gc/train/struts2/login/LoginAction.class b/Struts23-Start/build/classes/com/gc/train/struts2/login/LoginAction.class new file mode 100644 index 0000000..ef29c67 Binary files /dev/null and b/Struts23-Start/build/classes/com/gc/train/struts2/login/LoginAction.class differ diff --git a/Struts23-Start/build/classes/com/gc/train/struts2/login/LoginAction2.class b/Struts23-Start/build/classes/com/gc/train/struts2/login/LoginAction2.class new file mode 100644 index 0000000..c0abf0e Binary files /dev/null and b/Struts23-Start/build/classes/com/gc/train/struts2/login/LoginAction2.class differ diff --git a/Struts23-Start/build/classes/com/gc/train/struts2/login/LoginAction3.class b/Struts23-Start/build/classes/com/gc/train/struts2/login/LoginAction3.class new file mode 100644 index 0000000..05a2137 Binary files /dev/null and b/Struts23-Start/build/classes/com/gc/train/struts2/login/LoginAction3.class differ diff --git a/Struts23-Start/build/classes/log4j.properties b/Struts23-Start/build/classes/log4j.properties new file mode 100644 index 0000000..0c14c1a --- /dev/null +++ b/Struts23-Start/build/classes/log4j.properties @@ -0,0 +1,27 @@ + ### \u8bbe\u7f6e### +log4j.rootLogger = debug,stdout,D,E + +### \u8f93\u51fa\u4fe1\u606f\u5230\u63a7\u5236\u62ac ### +log4j.appender.stdout = org.apache.log4j.ConsoleAppender +log4j.appender.stdout.Target = System.out +log4j.appender.CONSOLE.Threshold = INFO +log4j.appender.stdout.layout = org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern = [%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} method:%l%n%m%n + +### \u8f93\u51faDEBUG \u7ea7\u522b\u4ee5\u4e0a\u7684\u65e5\u5fd7\u5230=D://logs/log.log ### +log4j.appender.D = org.apache.log4j.DailyRollingFileAppender +log4j.appender.D.File = D://logs/log.log +log4j.appender.D.DatePattern = '.'yyyy-MM-dd'.log' +log4j.appender.D.Append = true +log4j.appender.D.Threshold = DEBUG +log4j.appender.D.layout = org.apache.log4j.PatternLayout +log4j.appender.D.layout.ConversionPattern = [%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} method:%l%n%m%n + +### \u8f93\u51faERROR \u7ea7\u522b\u4ee5\u4e0a\u7684\u65e5\u5fd7\u5230=D://logs/error.log ### +log4j.appender.E = org.apache.log4j.DailyRollingFileAppender +log4j.appender.E.File =D://logs/error.log +log4j.appender.E.DatePattern = '.'yyyy-MM-dd'.log' +log4j.appender.E.Append = true +log4j.appender.E.Threshold = ERROR +log4j.appender.E.layout = org.apache.log4j.PatternLayout +log4j.appender.E.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n \ No newline at end of file diff --git a/Struts23-Start/build/classes/struts.xml b/Struts23-Start/build/classes/struts.xml new file mode 100644 index 0000000..e8821fd --- /dev/null +++ b/Struts23-Start/build/classes/struts.xml @@ -0,0 +1,29 @@ + + + + + + + + + + /login/success.jsp + /login/error.jsp + + + /login/success.jsp + /login/error.jsp + + + /login/success.jsp + /login/error.jsp + + + + \ No newline at end of file diff --git a/Struts23-Start/src/com/gc/train/struts2/login/LoginAction.java b/Struts23-Start/src/com/gc/train/struts2/login/LoginAction.java new file mode 100644 index 0000000..dbf54c1 --- /dev/null +++ b/Struts23-Start/src/com/gc/train/struts2/login/LoginAction.java @@ -0,0 +1,31 @@ +package com.gc.train.struts2.login; + +public class LoginAction { + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + private String username; + private String password; + + public String execute()throws Exception{ + if (this.getUsername().equals("admin")&&this.getPassword().equals("password")) { + return "success"; + } + return "error"; + + } + +} diff --git a/Struts23-Start/src/com/gc/train/struts2/login/LoginAction2.java b/Struts23-Start/src/com/gc/train/struts2/login/LoginAction2.java new file mode 100644 index 0000000..7a17bae --- /dev/null +++ b/Struts23-Start/src/com/gc/train/struts2/login/LoginAction2.java @@ -0,0 +1,31 @@ +package com.gc.train.struts2.login; + +public class LoginAction2 { + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + private String username; + private String password; + + public String execute()throws Exception{ + if (this.getUsername().equals("admin")&&this.getPassword().equals("password")) { + return "success"; + } + return "error"; + + } + +} diff --git a/Struts23-Start/src/com/gc/train/struts2/login/LoginAction3.java b/Struts23-Start/src/com/gc/train/struts2/login/LoginAction3.java new file mode 100644 index 0000000..9aba9b8 --- /dev/null +++ b/Struts23-Start/src/com/gc/train/struts2/login/LoginAction3.java @@ -0,0 +1,31 @@ +package com.gc.train.struts2.login; + +public class LoginAction3 { + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + private String username; + private String password; + + public String execute()throws Exception{ + if (this.getUsername().equals("admin")&&this.getPassword().equals("password")) { + return "success"; + } + return "error"; + + } + +} diff --git a/Struts23-Start/src/log4j.properties b/Struts23-Start/src/log4j.properties new file mode 100644 index 0000000..0c14c1a --- /dev/null +++ b/Struts23-Start/src/log4j.properties @@ -0,0 +1,27 @@ + ### \u8bbe\u7f6e### +log4j.rootLogger = debug,stdout,D,E + +### \u8f93\u51fa\u4fe1\u606f\u5230\u63a7\u5236\u62ac ### +log4j.appender.stdout = org.apache.log4j.ConsoleAppender +log4j.appender.stdout.Target = System.out +log4j.appender.CONSOLE.Threshold = INFO +log4j.appender.stdout.layout = org.apache.log4j.PatternLayout +log4j.appender.stdout.layout.ConversionPattern = [%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} method:%l%n%m%n + +### \u8f93\u51faDEBUG \u7ea7\u522b\u4ee5\u4e0a\u7684\u65e5\u5fd7\u5230=D://logs/log.log ### +log4j.appender.D = org.apache.log4j.DailyRollingFileAppender +log4j.appender.D.File = D://logs/log.log +log4j.appender.D.DatePattern = '.'yyyy-MM-dd'.log' +log4j.appender.D.Append = true +log4j.appender.D.Threshold = DEBUG +log4j.appender.D.layout = org.apache.log4j.PatternLayout +log4j.appender.D.layout.ConversionPattern = [%-5p] %d{yyyy-MM-dd HH:mm:ss,SSS} method:%l%n%m%n + +### \u8f93\u51faERROR \u7ea7\u522b\u4ee5\u4e0a\u7684\u65e5\u5fd7\u5230=D://logs/error.log ### +log4j.appender.E = org.apache.log4j.DailyRollingFileAppender +log4j.appender.E.File =D://logs/error.log +log4j.appender.E.DatePattern = '.'yyyy-MM-dd'.log' +log4j.appender.E.Append = true +log4j.appender.E.Threshold = ERROR +log4j.appender.E.layout = org.apache.log4j.PatternLayout +log4j.appender.E.layout.ConversionPattern = %-d{yyyy-MM-dd HH:mm:ss} [ %t:%r ] - [ %p ] %m%n \ No newline at end of file diff --git a/Struts23-Start/src/struts.xml b/Struts23-Start/src/struts.xml new file mode 100644 index 0000000..e8821fd --- /dev/null +++ b/Struts23-Start/src/struts.xml @@ -0,0 +1,29 @@ + + + + + + + + + + /login/success.jsp + /login/error.jsp + + + /login/success.jsp + /login/error.jsp + + + /login/success.jsp + /login/error.jsp + + + + \ No newline at end of file