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
Oct 18, 2016
1 parent
5218a93
commit c6c5db5
Showing
2 changed files
with
88 additions
and
0 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,56 @@ | ||
<%@page contentType="text/html" pageEncoding="UTF-8" %> | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>javaweb 实验二</title> | ||
|
||
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap.min.css"> | ||
<link rel="stylesheet" href="http://cdn.bootcss.com/bootstrap/3.3.0/css/bootstrap-theme.min.css"> | ||
<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> | ||
<script type="text/javascript" src="index.js"></script> | ||
|
||
</head> | ||
<body> | ||
<%=new java.util.Date().toLocaleString() %> | ||
<p style=""><b>发布二手货物</b></p> | ||
<form id="fm" action="rece.jsp" method="post"> | ||
<div class="form-group"> | ||
<p><label for="GoodsName">Goods Name</label><span style="color:red" id="p1"></span></p> | ||
<input type="text" id="GoodsName" name="GoodsName" placeholder="Goods Name" style="width:320px"/> | ||
</div> | ||
<div class="form-group"> | ||
<p><label for="Detail">Detail</label><span style="color:red" id="p2"></span></p> | ||
<textarea name="Detail" id="Detail" cols="50" rows="10" placeholder="Detail"></textarea> | ||
</div> | ||
<div class="form-group"> | ||
<p><label for="imgfile">Pictures input</label><span style="color:red" id="p3"></span></p> | ||
<input name="imgfile" type="file" id="imgfile" accept="image/*"> | ||
</div> | ||
</form> | ||
|
||
<button type="submit" onclick="fun()">submit</button> | ||
</body> | ||
|
||
|
||
<script type="text/javascript" > | ||
function fun(){ | ||
if(document.getElementById("GoodsName").value=='') | ||
document.getElementById("p1").innerHTML="* not null"; | ||
if( document.getElementById("Detail").value=='') | ||
document.getElementById("p2").innerHTML="* not null"; | ||
if( document.getElementById("imgfile").value=='') | ||
document.getElementById("p3").innerHTML="* not null"; | ||
else | ||
document.getElementById("fm").submit(); | ||
} | ||
</script> | ||
|
||
|
||
|
||
|
||
</html> |
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,32 @@ | ||
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> | ||
<% | ||
String path = request.getContextPath(); | ||
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; | ||
%> | ||
|
||
<!DOCTYPE HTML > | ||
<html> | ||
<head> | ||
<base href="<%=basePath%>"> | ||
|
||
<title>receive</title> | ||
|
||
</head> | ||
|
||
<body> | ||
<%=new java.util.Date().toLocaleString() %> | ||
|
||
<% String s1=request.getParameter("GoodsName"); | ||
String s2=request.getParameter("Detail"); | ||
String s3=request.getParameter("imgfile"); %> | ||
<p>Goods Name: | ||
<%=s1 %> | ||
</p> | ||
<p>Detail: | ||
<%=s2 %> | ||
</p> | ||
<p>Pictures: | ||
<%=s3 %> | ||
</p> | ||
</body> | ||
</html> |