forked from hzuapps/java-web
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
pigosy
committed
Nov 6, 2016
1 parent
93e8ec2
commit 81b07d0
Showing
3 changed files
with
175 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package edu.hzu.javaweb.labs.se1414080902231; | ||
|
||
public class Goods { | ||
|
||
private String gN,dT,img; | ||
Goods(String gN,String dT,String img) | ||
{ | ||
this.gN=gN; | ||
this.dT=dT; | ||
this.img=img; | ||
} | ||
|
||
public String getgN() | ||
{ | ||
return gN; | ||
} | ||
|
||
public String getdT() | ||
{ | ||
return dT; | ||
} | ||
|
||
public String getimg() | ||
{ | ||
return img; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,108 @@ | ||
<%@ page language="java" contentType="text/html; charset=UTF-8" | ||
pageEncoding="UTF-8"%> | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | ||
pageEncoding="UTF-8"%> | ||
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> | ||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> | ||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> | ||
<%@ page import="edu.hzu.javaweb.labs.se1414080902231.Goods,java.util.ArrayList,java.util.List" %> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> | ||
<title>Insert title here</title> | ||
<script src="http://cdn.bootcss.com/jquery/1.11.1/jquery.min.js"></script> | ||
<script src="http://cdn.bootcss.com/bootstrap/3.3.0/js/bootstrap.min.js"></script> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<title>勿闲闲物 Unused</title> | ||
</head> | ||
<body> | ||
<button onclick="gotofabu()">发布二手货物</button><br/> | ||
<br/> | ||
<button onclick="">搜索二手货物</button> | ||
<p></p> | ||
<div align="right"> | ||
<input type="button" onclick="gotoLogin()" value="登陆" /> | ||
<input type="button" value="注册" /> | ||
</div> | ||
<div align="center"> | ||
<p> | ||
<font size="6">Welcome to Unused!</font> | ||
</p> | ||
</div> | ||
<div align="center"> | ||
<form id="searchform"> | ||
<input type="text" name="search"/> | ||
<input type="submit" value="搜索二手货物" /> | ||
<input type="button" onclick="gotofabu()" value="发布二手货物" /> | ||
</form> | ||
|
||
</div> | ||
<br/> | ||
<div id="infomation" align="center"> | ||
|
||
<c:if test="${!empty sessionScope.list}"> | ||
<c:forEach var="l" items="${sessionScope.list}"> | ||
<c:out value="${l.gN}"/> | ||
<c:out value="${l.dT}"/> | ||
<c:out value="${l.img}"/> | ||
<br/> | ||
</c:forEach> | ||
|
||
</c:if> | ||
|
||
|
||
</div> | ||
|
||
<%-- <% | ||
List<Goods> list=(ArrayList<Goods>)session.getAttribute("list"); | ||
/* for (int i = 0; i < list.size(); i++) | ||
{ | ||
out.print(list.get(i).getgN()); | ||
} */ | ||
// out.print(list.get(1).getgN()); | ||
out.print(session.getAttribute("list")); | ||
%> --%> | ||
|
||
</body> | ||
<script> | ||
function gotofabu() | ||
{ | ||
window.location.href="issue.jsp"; | ||
} | ||
<script type="text/javascript"> | ||
$("#searchform").submit(function(){ | ||
$.ajax({ | ||
type:"post", | ||
data:$("#searchform").serialize(), | ||
datatype:"text", | ||
url:"1414080902231", | ||
success:function(data){ | ||
} | ||
}); | ||
}); | ||
</script> | ||
|
||
<script type="text/javascript" > | ||
function gotofabu() { | ||
//window.location.href = "issue.jsp"; | ||
alert(2); | ||
$.a(); | ||
} | ||
$.a=function(){ | ||
$.ajax({ | ||
type:"post", | ||
datatype:"text", | ||
url:"issue.jsp", | ||
success:function(data){ | ||
alert(data); | ||
}, | ||
error:function(){ | ||
alert("请先登录!"); | ||
} | ||
}); | ||
}; | ||
function gotoLogin() { | ||
window.location.href = "login.jsp"; | ||
} | ||
</script> | ||
|
||
</html> |