# Conflicts:
#	src/com/ssm/controller/TingchexinxiController.java
#	src/com/ssm/entity/TingchexinxiModel.java
#	web/WEB-INF/view/showNewType.jsp
#	web/WEB-INF/view/showTingchexinxi.jsp
#	web/addNewType.jsp
#	web/addTingchexinxi.jsp
main
张梓瑞 5 months ago
commit 9fe3208671

@ -1,15 +1,16 @@
package com.ssm.controller;
import com.ssm.entity.NewTypeModel;
import com.ssm.entity.TingchexinxiModel;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("tingchexinxi")
public class TingchexinxiController {
@RequestMapping("addtingchexinxi")
public String test(TingchexinxiModel tingchexinxiModel) {
System.out.println("停车车位信息" + tingchexinxiModel.toString());
return "showTingchexinxi";
}
@RequestMapping("add")
public String test(TingchexinxiModel tingchexinxi) {
System.out.println("停车信息" + tingchexinxi.toString());
return "showTingchexinxi";
}
}

@ -0,0 +1,18 @@
package com.ssm.controller;
import com.ssm.entity.UserModel;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("user")
public class UserController {
@RequestMapping("add")
public String useradd(UserModel user) {
System.out.println("车主id" + user.getUserid());
System.out.println("车主名字:" + user.getUsername());
System.out.println("密码:" + user.getUserpw());
System.out.println("车主电话:" + user.getUserphone());
return "showUser";
}
}

@ -1,66 +1,58 @@
package com.ssm.entity;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.format.annotation.DateTimeFormat;
public class TingchexinxiModel {
// 车位编号
private String spaceNumber;
// 车位所在区域
private String area;
// 车位类型(普通车位、残疾人车位)
private String spaceType;
public String getSpaceNumber() {
return spaceNumber;
}
import java.util.Date;
public void setSpaceNumber(String spaceNumber) {
this.spaceNumber = spaceNumber;
}
public class TingchexinxiModel {
// 停车ID
private Integer parkingId;
// 车牌号
private String licensePlate;
// 进入时间
private String entryTime;
// 离开时间
private String exitTime;
public String getArea() {
return area;
public Integer getParkingId() {
return parkingId;
}
public void setArea(String area) {
this.area = area;
public void setParkingId(Integer parkingId) {
this.parkingId = parkingId;
}
public String getSpaceType() {
return spaceType;
public String getLicensePlate() {
return licensePlate;
}
public void setSpaceType(String spaceType) {
this.spaceType = spaceType;
public void setLicensePlate(String licensePlate) {
this.licensePlate = licensePlate;
}
public String getStatus() {
return status;
public String getEntryTime() {
return entryTime;
}
public void setStatus(String status) {
this.status = status;
public void setEntryTime(String entryTime) {
this.entryTime = entryTime;
}
public double getPrice() {
return price;
public String getExitTime() {
return exitTime;
}
public void setPrice(double price) {
this.price = price;
public void setExitTime(String exitTime) {
this.exitTime = exitTime;
}
// 车位状态(空闲、已占用)
private String status;
// 车位价格
private double price;
public void printInfo() {
System.out.println("ParkingLotSpace{" +
"车位编号=" + spaceNumber +
", 车位所在区域='" + area + '\'' +
", 车位类型='" + spaceType + '\'' +
", 车位状态='" + status + '\'' +
", 车位价格='" + price + '\'' +
'}');
@Override
public String toString() {
return "TingchexinxiModel{" +
"停车ID=" + parkingId +
", 车牌号='" + licensePlate + '\'' +
", 进入时间=" + entryTime +
", 离开时间=" + exitTime +
'}';
}
}

@ -0,0 +1,41 @@
package com.ssm.entity;
public class UserModel {
private int userid;//用户id
private String username;//用户名
private int userpw;//用户密码
private int userphone;//用户电话
public int getUserid() {
return userid;
}
public void setUserid(int userid) {
this.userid = userid;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public int getUserpw() {
return userpw;
}
public void setUserpw(int userpw) {
this.userpw = userpw;
}
public int getUserphone() {
return userphone;
}
public void setUserphone(int userphone) {
this.userphone = userphone;
}
}

@ -3,11 +3,14 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/tool http://www.springframework.org/schema/tool/spring-tool.xsd http://www.springframework.org/schema/mvc https://www.springframework.org/schema/mvc/spring-mvc.xsd">
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
https://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!-- 配置注解扫描器配置spring容器初始化对象时需要扫描的包 -->
<context:component-scan base-package="com.ssm.controller"></context:component-scan>
<context:component-scan base-package="com.ssm.controller"/>
<!-- 配置视图解析器,ctrl+shift+t搜索类将return的字符串逻辑视图+前缀+后缀,转换成真正的物理视图 -->
<!-- 逻辑视图success,真正的视图:/WEB-INF/view/success.jsp -->
<!-- -->
@ -15,9 +18,9 @@
<mvc:annotation-driven/>
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<!-- 前缀 -->
<property name="prefix" value="/WEB-INF/view/"></property>
<property name="prefix" value="/WEB-INF/view/"/>
<!-- 后缀 -->
<property name="suffix" value=".jsp"></property>
<property name="suffix" value=".jsp"/>
</bean>
<bean class="org.springframework.format.support.FormattingConversionServiceFactoryBean">

@ -11,5 +11,4 @@ success
<br>
新闻类型信息已在控制台输出!
</body>
</body>
</html>

@ -1,20 +1,18 @@
<%--
Created by IntelliJ IDEA.
User: user
Date: 2025/3/26
Time: 9:42
User:
Date: 2025/3/31
Time: 21:42
To change this template use File | Settings | File Templates.
--%>
<%@ 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">
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>Title</title>
</head>
<body>
Success!
success
<br>
停车车位信息已在控制台输出!
停车信息已在控制台输出!
</body>
</html>

@ -0,0 +1,11 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>展示userController接收及响应数据</title>
</head>
<body>
success
<br>
车主信息已在控制台输出!
</body>
</html>

@ -1,5 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="WebApp_ID" version="3.1">
<display-name>SpringMVCFirst</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
@ -8,7 +11,7 @@
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</welcome-file-list>
<servlet>
<servlet-name>springDispatcherServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
@ -25,7 +28,7 @@
<servlet-name>springDispatcherServlet</servlet-name>
<!-- 可以应答所有请求 -->
<url-pattern>/</url-pattern>
</servlet-mapping>
</servlet-mapping>
<!--编码过滤器,解决中文乱码问题-->
<filter>
<filter-name>characterEncodingFilter</filter-name>
@ -39,5 +42,5 @@
<filter-name>characterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>

@ -1,10 +1,3 @@
<%--
Created by IntelliJ IDEA.
User: 吴彦祖
Date: 2025/3/26
Time: 16:31
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>

@ -1,28 +1,46 @@
<%--
Created by IntelliJ IDEA.
User: user
Date: 2025/3/26
Time: 9:41
User:
Date: 2025/3/31
Time: 21:43
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>停车车位信息</title>
<title>Title</title>
</head>
<body>
<form action="tingchexinxi/addtingchexinxi" method="post">
车位编号:<input type="text" name="spaceNumber">
<br>
区域名称:<input type="text" name="area">
<br>
车位价格:<input type="text" name="price">
<br>
车位状态:<input type="text" name="status">
<br>
车位类型:<input type="text" name="spaceType">
<br>
<input type="submit" value="添加">
<form action="tingchexinxi/add" method="post">
<table>
<tr>
<td>停车ID</td>
<td width="20"></td>
<td><input type="text" name="parkingId" placeholder="请输入停车ID" /></td>
</tr>
<tr>
<td>车牌号:</td>
<td width="20"></td>
<td><input type="text" name="licensePlate" placeholder="请输入车牌号" /></td>
</tr>
<tr>
<td>进入时间:</td>
<td width="20"></td>
<td><input type="text" name="entryTime" placeholder="请输入进入时间" /></td>
</tr>
<tr>
<td>离开时间:</td>
<td width="20"></td>
<td><input type="text" name="exitTime" placeholder="请输入离开时间" /></td>
</tr>
<tr>
<td align="right"><input type="reset" value="重置"></td>
<td></td>
<td align="center">
<input type="submit" value="添加">
</td>
</tr>
</table>
</form>
</body>
</html>

@ -0,0 +1,36 @@
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
<title>添加用户类型</title>
</head>
<body>
<form action="user/add" method="post">
<table>
<tr>
<td>车主id</td>
<td width="20"></td>
<td><input type="text" name="userid" placeholder="请输入用户id" /></td>
</tr>
<tr>
<td>车主名:</td>
<td width="20"></td>
<td><input type="text" name="username" placeholder="请输入用户名" /></td>
</tr>
<tr>
<td>密码:</td>
<td width="20"></td>
<td><input type="password" name="user_password" placeholder="请输入密码" /></td>
</tr>
<tr>
<td>车主电话:</td>
<td width="20"></td>
<td><input type="text" name="user_phone" placeholder="请输入用户电话" /></td>
</tr>
<tr>
<td align="right"><input type="reset" value="重置"></td>
<td align="center"><input type="submit" value="添加"></td>
</tr>
</table>
</form>
</body>
</html>
Loading…
Cancel
Save