Skip to content

Commit

Permalink
对静态资源访问位置的修改
Browse files Browse the repository at this point in the history
  • Loading branch information
lhsjohn committed Jul 4, 2018
1 parent f23b896 commit 2aeb49c
Show file tree
Hide file tree
Showing 41 changed files with 379 additions and 274 deletions.
50 changes: 34 additions & 16 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
<activemq.version>5.11.2</activemq.version>
<freemarker.version>2.3.23</freemarker.version>
<quartz.version>2.2.2</quartz.version>
<spring.security.version>4.2.2.RELEASE</spring.security.version>

</properties>
<dependencies>
<!-- 时间操作组件 -->
Expand All @@ -53,7 +55,7 @@
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-io</artifactId>
Expand Down Expand Up @@ -284,21 +286,37 @@
<version>3.0.3.RELEASE</version>
</dependency>
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.7</version>
</dependency>
<!-- 实现分页操作 -->
<dependency>
<groupId>com.github.jsqlparser</groupId>
<artifactId>jsqlparser</artifactId>
<version>0.9</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>4.1.6</version>
</dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.7</version>
</dependency>


<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>${spring.security.version}</version>
</dependency>

<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${spring.security.version}</version>
</dependency>



<!-- 实现分页操作 -->
<dependency>
<groupId>com.github.jsqlparser</groupId>
<artifactId>jsqlparser</artifactId>
<version>0.9</version>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>4.1.6</version>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public String showlandlordAppointmentInfoList(Model model,HttpSession session) {
List<Appointment> list=new ArrayList<Appointment>();
Landlord landlord=new Landlord();
landlord=(Landlord) session.getAttribute("landlordInfo");
list=appointmentService.getLandlordAppointment(landlord.getLandlordName());
list=appointmentService.getLandlordAppointment(landlord.getLandlordId());
session.setAttribute("landlordInfo", landlord);
model.addAttribute("appointmentList",list);
return "landlord_appointment_info";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,13 @@ public class MeetingController {
private HouseService houseService;


@RequestMapping(value="meeting/{appId}")
@RequestMapping(value="/meeting/{appId}")
public String showMeetingInfo(@PathVariable String appId,Model model,HttpSession session) {
Appointment appointment=appointService.getAppointByAppId(appId);
Student student=studentService.getStudentByPrimaryKey(appointment.getAppStuId());
System.out.println("aaaaaaaaaaa"+student.toString());
Landlord landlord=landlordService.getLandlordById(appointment.getAppLandlordId());
System.out.println("+++++++++++++"+appointment.getAppHouseId());
House house=houseService.getHouseById(appointment.getAppHouseId());
meetingService.insertMeetingInfo(student, landlord, house);
model.addAttribute("landlordInfo",landlord);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.validation.BindingResult;
import org.springframework.validation.Errors;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;
Expand All @@ -27,18 +29,17 @@ public class RegisterController {
@Autowired
private LandlordService landlordService;



@RequestMapping(value="register-student",method=RequestMethod.GET)

@RequestMapping(value="/register-student",method=RequestMethod.GET)
public String showStudentRegisterForm(Model model) {
model.addAttribute(new Student());
return "register-student";
}


@RequestMapping(value="register-student",method=RequestMethod.POST)
public String processRegister(@Valid Student student,Errors errors,RedirectAttributes model) {
if(errors.hasErrors()) {
@RequestMapping(value="/register-student",method=RequestMethod.POST)
public String processRegister(@Valid Student student,BindingResult result,RedirectAttributes model) {
if(result.hasErrors()) {
//System.out.println(123);
//return "register-student";
return "register-student";
Expand All @@ -63,11 +64,12 @@ public String showLandlordRegisterForm(Model model) {
}

@RequestMapping(value="register-landlord",method=RequestMethod.POST)
public String processLandlordRegsiter(Landlord landlord,Errors errors,RedirectAttributes model) {
public String processLandlordRegsiter(@Validated Landlord landlord,Errors errors,RedirectAttributes model) {
if(errors.hasErrors()) {
System.out.println("出现了错误"+landlord.toString());
System.out.println("出现了错误"+landlord.toString());
return "register-landlord";
}else if(!landlordService.registerLandlord(landlord)) {
model.addAttribute("message","用户名已存在");
System.out.println(landlord.toString());
return "register-landlord";
}else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class RentHouseController {
private HouseService houseService;


@RequestMapping(value="landlord_rent_form",method=RequestMethod.GET)
@RequestMapping(value="/landlord_rent_form",method=RequestMethod.GET)
public String showRentHouseForm(Model model,HttpSession session) {
model.addAttribute(new House());
Landlord landlord=(Landlord) session.getAttribute("landlordInfo");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
public interface AppointmentService {
void insertStudentAppointment(Student student,House house);
List<Appointment> getStuAppointmentList(String stuName);
List<Appointment> getLandlordAppointment(String LandlordName);
List<Appointment> getLandlordAppointment(String LandlordId);
void deleteStudentAppointment(String HouseId);
Appointment getAppointByAppId(String appId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ public List<Appointment> getStuAppointmentList(String stuName) {
}

@Override
public List<Appointment> getLandlordAppointment(String LandlordName) {
public List<Appointment> getLandlordAppointment(String Landlordid) {
AppointmentExample example=new AppointmentExample();
Criteria criteria=example.createCriteria();
criteria.andAppLandlordNameEqualTo(LandlordName);
criteria.andAppLandlordIdEqualTo(Landlordid);
List<Appointment>list=new ArrayList<Appointment>();
list=appointmentMapper.selectByExample(example);
return list;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,17 @@ public List<House> getHouseList() {

@Override
public House getHouseById(String houseId) {
return houseMapper.selectByPrimaryKey(houseId);

HouseExample example=new HouseExample();
Criteria criteria=example.createCriteria();
criteria.andHouseIdEqualTo(houseId);
List<House>list=new ArrayList<House>();
list=houseMapper.selectByExample(example);
return list.get(0);
}




@Override
public List<House> getHouseByLandlordUsername(String landlordUsername) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class LandlordImpl implements LandlordService {
public boolean registerLandlord(Landlord landlord) {
LandlordExample example=new LandlordExample();
Criteria criteria=example.createCriteria();
criteria.andLandlordUsernameEqualTo(landlord.getLandlordName());
criteria.andLandlordUsernameEqualTo(landlord.getLandlordUsername());
List<Landlord> list=new ArrayList<Landlord>();
list=landlordMapper.selectByExample(example);
if(list.isEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class MeetingServiceImpl implements MeetingService {
public int insertMeetingInfo(Student student, Landlord landlord, House house) {
Meeting meeting=new Meeting();
meeting.setMeetHouseHostname(landlord.getLandlordName());
meeting.setMeetHousePrice(house.getHouseCost());
//meeting.setMeetHousePrice(house.getHouseCost());
meeting.setMeetHouseType(house.getHouseType());
meeting.setMeetStuName(student.getStuUsername());
meeting.setMeetPlace("会面点1");
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/applicationContext.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,4 @@ http://www.springframework.org/schema/tx http://www.springframework.org/schema/t
<context:component-scan base-package="cn.edu.hqu.stu_accommodation_sys.controller"/>
<context:component-scan base-package="cn.edu.hqu.stu_accommodation_sys.service"/>
<context:annotation-config></context:annotation-config>

</beans>
17 changes: 8 additions & 9 deletions src/main/resources/springmvc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,19 @@
<!--解决中文乱码-->
<property name="characterEncoding" value="UTF-8"/>
</bean>
<mvc:default-servlet-handler/>
<!-- 配置资源映射 -->
<mvc:default-servlet-handler/>
<!-- 配置资源映射 -->
<mvc:resources location="/css/" mapping="/css/**"/>
<mvc:resources location="/js/" mapping="/js/**"/>
<mvc:resources location="/img/" mapping="/img/**"/>
<mvc:resources location="/fonts/" mapping="/fonts/**"/>
<mvc:resources location="**/css/" mapping="/css/**"/>
<mvc:resources location="**/js/" mapping="/js/**"/>
<mvc:resources location="**/img/" mapping="/img/**"/>
<mvc:resources location="/fonts/" mapping="/fonts/**"/>
<mvc:resources location="/css/" mapping="**/css/**"/>
<mvc:resources location="/fonts/" mapping="/fonts/**"/>


<mvc:resources location="/css/" mapping="**/css/**"/>
<mvc:resources location="/js/" mapping="**/js/**"/>
<mvc:resources location="/img/" mapping="**/img/**"/>
<mvc:resources location="/fonts/" mapping="**/fonts/**"/>
<mvc:resources location="/fonts/" mapping="**/fonts/**"/>

<!-- 配置多媒体解析器 -->
<!-- 定义文件上传解析器 -->
<bean id="multipartResolver"
Expand Down
26 changes: 14 additions & 12 deletions src/main/webapp/WEB-INF/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
<meta name="description" content="123" />
<meta name="author" content="123" />
<title>学生住宿管理系统</title>

<!-- BOOTSTRAP CORE STYLE CSS -->
<link href="../../css/bootstrap.css" rel="stylesheet" />
<link href="/stu_accommodation_sys/css/bootstrap.css" rel="stylesheet" />
<!-- FONT AWESOME CSS -->
<link href="../../css/font-awesome.min.css" rel="stylesheet" />
<link href="/stu_accommodation_sys/css/font-awesome.min.css" rel="stylesheet" />
<!-- CUSTOM STYLE CSS -->
<link href="../../css/style.css" rel="stylesheet" />
<link href="/stu_accommodation_sys/css/style.css" rel="stylesheet" />
<!-- Google Fonts -->
<link href='http://fonts.googleapis.com/css?family=Nova+Flat' rel='stylesheet' type='text/css' />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,300' rel='stylesheet' type='text/css' />
Expand All @@ -23,12 +24,13 @@

<div class="col-lg-4 col-md-4 col-sm-4">
<a href="index.html">
<img src="../../img/logo.png" />
<img src="/stu_accommodation_sys/img/logo.png" />
</a>
</div>
<div class="col-lg-4 col-md-4 col-sm-4 text-center" >
<img src="../../img/top-mouse.png " class="header-mid" />
</div>
<img src="/stu_accommodation_sys/img/top-mouse.png " class="header-mid" />

</div>
<div class="col-lg-4 col-md-4 col-sm-4">
<h4><span>姓名:</span>李华硕</h4>
<h4><span>学号:</span>1625131015</h4>
Expand All @@ -45,29 +47,29 @@ <h4><span>学号:</span>1625131015</h4>
<div class="alert alert-info">
<div class="media">
<div class="pull-left">
<img src="../../img/student.png" class="img-responsive" />
<img src="/stu_accommodation_sys/img/student.png" class="img-responsive" />
</div>
<div class="media-body">
<h3 class="media-heading">我是学生</h3>
<p>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;我是学生,现在想要租房
</p>
<a href="/login-student" class="btn btn-primary" target="_blank" >前去登录</a>
<a href="/stu_accommodation_sys/login-student" class="btn btn-primary" target="_blank" >前去登录</a>
</div>
</div>

</div>
<div class="alert alert-danger">
<div class="media">
<div class="pull-left">
<img src="../../img/admin.png" class="img-responsive" />
<img src="/stu_accommodation_sys/img/admin.png" class="img-responsive" />
</div>
<div class="media-body">
<h3 class="media-heading">我是房主</h3>
<p>
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 我是房主,现在有房子要出租
</p>
<a href="/login-landlord" class="btn btn-danger " target="_blank">前去登录</a>
<a href="/stu_accommodation_sys/login-landlord" class="btn btn-danger " target="_blank">前去登录</a>
</div>
</div>

Expand All @@ -85,9 +87,9 @@ <h3 class="media-heading">我是房主</h3>
</div>
</div>
<!-- Jquery Core Script -->
<script src="../../assets/js/jquery-1.10.2.js"></script>
<script src="/stu_accommodation_sys/assets/js/jquery-1.10.2.js"></script>
<!-- Core Bootstrap Script -->
<script src="../../assets/js/bootstrap.js"></script>
<script src="/stu_accommodation_sys/assets/js/bootstrap.js"></script>

</body>
</html>
Loading

0 comments on commit 2aeb49c

Please sign in to comment.