springMVC框架

hello springmvc

什么是Spring MVC?
Spring MVC 为展现层提供的基于 MVC 设计理念的优秀的Web 框架,是目前最主流的 MVC 框架之一。
Spring3.0 后全面超越 Struts2,成为最优秀的 MVC 框架。

导入jar包

我们基于Spring mvc框架进行开发,需要依赖一下的spring jar包:

spring-aop-4.0.4.RELEASE.jar

spring-beans-4.0.4.RELEASE.jar

spring-context-4.0.4.RELEASE.jar

spring-core-4.0.4.RELEASE.jar

spring-expression-4.0.4.RELEASE.jar

spring-web-4.0.4.RELEASE.jar

spring-webmvc-4.0.4.RELEASE.jar

commons-logging-1.1.1.jar(用来打印log)

在WEB-INF目录下新建lib文件夹,并将上面的jar包放入其中。

配置文件web.xml(WEB-INF下)

<?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">

    <!-- 配置DispatchcerServlet -->
    <servlet>
        <servlet-name>springDispatcherServlet</servlet-name>
         <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
         <!-- 配置Spring mvc下的配置文件的位置和名称 -->
         <init-param>
             <param-name>contextConfigLocation</param-name>
             <param-value>classpath:springmvc.xml</param-value>
         </init-param>
         <load-on-startup>1</load-on-startup>
     </servlet>
     <servlet-mapping>
         <servlet-name>springDispatcherServlet</servlet-name>
         <url-pattern>*.do</url-pattern>
     </servlet-mapping>
</web-app>

注意: <param-value>classpath:springmvc.xml</param-value>用于配置spring mvc的配置文件的位置和名称,这里说明会新建一个springmvc.xml的配置文件。

这里的servlet-mapping表示拦截的模式,这里是“*.do”,表示对于.do结尾的请求进行拦截。

Springmvc.xml(scr下)
  在src目录下新建springmvc.xml

<?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns="http://www.springframework.org/schema/beans"
      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-4.0.xsd
         http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd">
         <!-- 配置自动扫描的包 -->
         <context:component-scan base-package="com.neusoft.controller"></context:component-scan>
         <!-- 配置视图解析器 如何把handler 方法返回值解析为实际的物理视图 -->
         <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
             <property name = "prefix" value="/WEB-INF/views/"></property>
             <property name = "suffix" value = ".jsp"></property>
         </bean>
 </beans>

<context:component-scan base-package="com.neusoft.controller"></context:component-scan>
表示spring监听的范围,这里是在com.neusoft.controller下

HelloWorldController.java(com.neusoft.controller下)

package com.neusoft.springmvc;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class HelloWorldController {
     /**
      * 1\. 使用RequestMapping注解来映射请求的URL
      * 2\. 返回值会通过视图解析器解析为实际的物理视图, 对于InternalResourceViewResolver视图解析器,会做如下解析
      * 通过prefix+returnVal+suffix 这样的方式得到实际的物理视图,然后会转发操作
      * "/WEB-INF/views/success.jsp"
      * @return
      */
     @RequestMapping("/helloworld.do")
     public String hello(){
         System.out.println("hello world");
         return "success";
     }
}

  1. 首先要在类的前面添加“Controller”注解,表示是spring的控制器,这里会写一个方法hello()

2. hello方法上方有一个@RequestMapping, 是用于匹配请求的路径,比如这里匹配的请求路径就是“http://localhost:8080/helloworld.do”,即当tomcat服务启动后,在浏览器输入这个url时,如果在这个方法打断点了,就会跳入该方法。

3. 这个return的结果不是乱写的,这个返回的字符串就是与上面springmvc.xml中进行配合的,springmvc.xml中声明了prefix和suffix,而夹在这两者之间的就是这里返回的字符串,所以执行完这个方法后,我们可以得到这样的请求资源路径“/WEB-INF/views/success.jsp”,这个success.jsp是需要我们新建的

index.jsp(WebContent下)

在新建success.jsp之前,我们需要有一个入口,也就是这里的index.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<a href="helloworld.do">hello world</a>
</body>
</html>

当访问index.jsp时,页面上会展示一个超链接,点击超链后,url中的地址就会发生跳转,由“http://localhost:8080/springTest/index.jsp”跳转到“http://localhost:8080/springTest/helloworld.do”,而这个url请求就会进入HelloWorld中的hello方法,因为其与该方法上的“/helloworld.do”匹配。

success.jsp(WEB-INF/views下)

该页面是作为请求成功后的相应页面

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<h4>Success Page</h4>
</body>
</html>

Controller方法的返回值

可以有以下几种:
1、返回ModelAndView

返回ModelAndView时最常见的一种返回结果。需要在方法结束的时候定义一个ModelAndView对象,并对Model和View分别进行设置。

@Controller
public class HelloWorldController {
    @RequestMapping("/helloworld.do")
    public String hello(){
        System.out.println("hello world");
        return "success";
    }

    @RequestMapping("/abc.do")
    public ModelAndView abc(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("username","zhangsan");
        modelAndView.setViewName("success");
        return modelAndView;

    }

}

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
      ${username}
</body>
</html>

2、返回String

1):字符串代表逻辑视图名

真实的访问路径=“前缀”+逻辑视图名+“后缀”

注意:如果返回的String代表逻辑视图名的话,那么Model的返回方式如下:

  @RequestMapping("/helloworld.do")
    public String hello(Model model){
        model.addAttribute("username","zhangsan");
        System.out.println("hello world");
        return "success";
    }

2):代表redirect重定向

redirect的特点和servlet一样,使用redirect进行重定向那么地址栏中的URL会发生变化,同时不会携带上一次的request

案例:

@Controller
public class HelloWorldController {
    @RequestMapping("/helloworld.do")
    public String hello(Model model){
        model.addAttribute("username","zhangsan");
        System.out.println("hello world");
        return "success";
    }

    @RequestMapping("/abc.do")
    public ModelAndView abc(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("username","zhangsan");
        modelAndView.setViewName("success");
        return modelAndView;

    }

    @RequestMapping("/redirect.do")
    public String redirect(){
          return "redirect:login.do";
    }

}

3):代表forward转发

通过forward进行转发,地址栏中的URL不会发生改变,同时会将上一次的request携带到写一次请求中去

案例:

@Controller
public class HelloWorldController {
    @RequestMapping("/helloworld.do")
    public String hello(Model model){
        model.addAttribute("username","zhangsan");
        System.out.println("hello world");
        return "success";
    }

    @RequestMapping("/abc.do")
    public ModelAndView abc(){
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.addObject("username","zhangsan");
        modelAndView.setViewName("success");
        return modelAndView;

    }

    @RequestMapping("/redirect.do")
    public String redirect(){
          return "forward:login.do";
    }

}

3、返回void

返回这种结果的时候可以在Controller方法的形参中定义HTTPServletRequest和HTTPServletResponse对象进行请求的接收和响应

1)使用request转发页面
request.getRequestDispatcher("转发路径").forward(request,response);

2)使用response进行页面重定向
response.sendRedirect("重定向路径");

3)也可以使用response指定响应结果
response.setCharacterEncoding("UTF-8");
response.setContentType("application/json;charset=utf-8");
response.getWriter().println("json串");

 @RequestMapping("/returnvoid.do")
    public void returnvoid(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
//        request.getRequestDispatcher("转发路径").forward(request,response);
//        response.sendRedirect("重定向路径");
        response.setCharacterEncoding("UTF-8");
        response.setContentType("application/json;charset=utf-8");
        response.getWriter().println("json串");
    }

以上三种返回值没有什么重要和不重要的分别,一般来说都会使用到, 只不过有的时候使用的方式会有一些细微的差别

SpringMVC的各种参数绑定方式

  1. 基本数据类型(以int为例,其他类似):
    Controller代码:
@RequestMapping("saysth.do")
public void test(int count) {

}

表单代码:

<form action="saysth.do" method="post">
<input name="count" value="10" type="text"/>
</form>

表单中input的name值和Controller的参数变量名保持一致,就能完成数据绑定,如果不一致可以使用@RequestParam注解。需要注意的是,如果Controller方法参数中定义的是基本数据类型,但是从页面提交过来的数据为null的话,会出现数据转换的异常。也就是必须保证表单传递过来的数据不能为null。所以,在开发过程中,对可能为空的数据,最好将参数数据类型定义成包装类型,具体参见下面的例子。

  1. 包装类型(以Integer为例,其他类似):
    Controller代码:
@RequestMapping("saysth.do")
public void test(Integer count) {

}

表单代码:

<form action="saysth.do" method="post">
      <input name="count" value="10" type="text"/>
</form>

和基本数据类型基本一样,不同之处在于,表单传递过来的数据可以为null,以上面代码为例,如果表单中count为null或者表单中无count这个input,那么,Controller方法参数中的count值则为null。

  1. 自定义对象类型:
    Model代码:
public class User {
    private String firstName;
    private String lastName;

    public String getFirstName() {
        return firstName;
    }

    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    public String getLastName() {
        return lastName;
    }

    public void setLastName(String lastName) {
        this.lastName = lastName;
    }
}

Controller代码:

@RequestMapping("saysth.do")
public void test(User user) {

}

表单代码:

<form action="saysth.do" method="post">
<input name="firstName" value="张" type="text"/>
<input name="lastName" value="三" type="text"/>
......
</form>

非常简单,只需将对象的属性名和input的name值一一匹配即可。

解决乱码问题

web.xml里加入过滤器

<filter>

        <filter-name>characterEncodingFilter</filter-name>

        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>

        <init-param>

            <param-name>encoding</param-name>

            <param-value>UTF-8</param-value>

        </init-param>

        <init-param>

            <param-name>forceEncoding</param-name>

            <param-value>true</param-value>

        </init-param>

    </filter>

    <filter-mapping>

        <filter-name>characterEncodingFilter</filter-name>

        <url-pattern>/*</url-pattern>

    </filter-mapping>

RESTful架构

RESTful架构,就是目前最流行的一种互联网软件架构。它结构清晰、符合标准、易于理解、扩展方便,所以正得到越来越多网站的采用。RESTful(即Representational State Transfer的缩写)其实是一个开发理念,是对http的很好的诠释。

对url进行规范,写RESTful格式的url

非REST的url:http://...../queryItems.action?id=001

REST的url风格:http://..../items/001

特点:url简洁,将参数通过url传到服务端

修改web.xml,添加DispatcherServlet的Restful配置

<servlet>

        <servlet-name>springmvc-servlet-rest</servlet-name>

               <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>

               <init-param>

                   <param-name>contextConfigLocation</param-name>

                   <param-value>classpath:spring/springmvc.xml</param-value>

               </init-param>

           </servlet>

           <servlet-mapping>

                <servlet-name>springmvc-servlet-rest</servlet-name>

                <url-pattern>/</url-pattern>

            </servlet-mapping>

<url-pattern>/</url-pattern>表明所有url模式为/

URL 模板模式映射

@RequestMapping(value="/ viewItems/{id}")
{×××}占位符,请求的URL可以是“/viewItems/1”或“/viewItems/2”,通过在方法中使用@PathVariable获取{×××}中的×××变量。@PathVariable用于将请求URL中的模板变量映射到功能处理方法的参数上。

 @RequestMapping("/viewItems/{id}") 
  public @ResponseBody viewItems(@PathVariable("id") String id) throws Exception{

 }

如果RequestMapping中表示为"/viewItems/{id}",id和形参名称一致,@PathVariable不用指定名称。

 @RequestMapping("/viewItems/{id}") 
  public @ResponseBody viewItems(@PathVariable String id) throws Exception{

 }

多个参数

@Controller  
@RequestMapping("/person") 
public class PersonAction{  

    @RequestMapping(value="/delete/{id}/{name}")
    public String delete(@PathVariable Integer id,@PathVariable String name){
        System.out.println(id + "   " + name) ;
        return "person";
    }
}  

静态资源访问<mvc:resources>

如果在DispatcherServlet中设置url-pattern为 /则必须对静态资源进行访问处理,否则对css,js等文件的请求会被DispatcherServlet拦截。

spring mvc 的<mvc:resources mapping="" location="">实现对静态资源进行映射访问。告诉springmvc框架,描述的静态资源,无须DispatcherServlet拦截,以及查询的目录。

如下是对css和js文件访问配置:

  <mvc:annotation-driven></mvc:annotation-driven>
 <mvc:resources location="/js/" mapping="/js/**"/>
 <mvc:resources location="/css/" mapping="/css/**"/>

上传图片

在页面form中提交enctype="multipart/form-data"的数据时,需要springmvc对multipart类型的数据进行解析。

在springmvc.xml中配置multipart类型解析器。

<!-- 文件上传 -->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
    <property name="maxUploadSize" value="80000"></property>
    <property name="defaultEncoding" value="UTF-8"></property>
</bean>

上传图片代码
页面

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<form action="upload.do" method="post" enctype="multipart/form-data">
    <h2>文件上传</h2>
    文件:<input type="file" name="file1"/><br/><br/>
    用户名:<input type="text" name="username">
    <br/><br/>
    图片:<img src="${imgpath}"/><br/><br/>
    <input type="submit" value="上传"/>
</form>
</body>
</html>

controller方法

@Controller
public class uploadController {

   @RequestMapping("/upload.do")
   public void doUpload(@RequestParam MultipartFile file1, HttpServletRequest request) throws IOException {

       String strName = request.getParameter("username");
       System.out.println(strName);
   if(file1.isEmpty())
   {
       System.out.println("文件未上传!");
   }
   else
   {
       //得到上传的文件名
       String fileName = file1.getOriginalFilename();
       //得到服务器项目发布运行所在地址
       String strFolder = request.getServletContext().getRealPath("/image")+ File.separator;
       File folder = new File(strFolder);
       if(!folder.exists())
       {
           folder.mkdir();
       }
       //  此处未使用UUID来生成唯一标识,用日期做为标识
       String strNewFilePath = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date())+ fileName;
       String strFinalPath = strFolder + strNewFilePath;
       //查看文件上传路径,方便查找
       System.out.println(strFinalPath);
       //把文件上传至path的路径
       File localFile = new File(strFinalPath);
       file1.transferTo(localFile);
       request.getSession().setAttribute("imgpath", "image"+ File.separator+strNewFilePath);
       }

   }

}

拦截器

拦截器是用来动态拦截 action 调用的对象。它提供了一种机制可以使开发者可以定义在一个 action 执行的前后执行的代码,也可以在一个 action 执行前阻止其执行,同时也提供了一种可以提取 action 中可重用部分的方式

HandlerInterceptor概述

在SpringMVC 中定义一个Interceptor是比较非常简单,实现HandlerInterceptor接口。
HandlerInterceptor接口主要定义了三个方法:

  1. boolean preHandle (HttpServletRequest request, HttpServletResponse response, Object handle)方法:该方法将在请求处理之前进行调用,只有该方法返回true,才会继续执行后续的Interceptor和Controller,当返回值为true 时就会继续调用下一个Interceptor的preHandle 方法,如果已经是最后一个Interceptor的时候就会是调用当前请求的Controller方法;
    2.void postHandle (HttpServletRequest request, HttpServletResponse response, Object handle, ModelAndView modelAndView)方法:该方法将在请求处理之后,DispatcherServlet进行视图返回渲染之前进行调用,可以在这个方法中对Controller 处理之后的ModelAndView 对象进行操作。
    3.void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handle, Exception ex)方法:该方法也是需要当前对应的Interceptor的preHandle方法的返回值为true时才会执行,该方法将在整个请求结束之后,也就是在DispatcherServlet 渲染了对应的视图之后执行。用于进行资源清理。

简单的一个例子:

xml需要配置:两种配置方式(对所有的请求记性拦截,对特定的请求进行拦截)

<mvc:interceptors>
        <!--对所有的请求记性拦截-->
        <!--<beans:bean class="com.sunp.common.interceptor.Myinterceptor"/>-->
        <!--对特定的请求进行拦截-->
        <mvc:interceptor>
            <mapping path="/kfc/brands/brand1/*"/>
            <bean class="com.sunp.common.interceptor.Myinterceptor"/>
        </mvc:interceptor>
</mvc:interceptors>

interceptors类

public class Myinterceptor implements HandlerInterceptor {

    public boolean preHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o) throws Exception {
        System.out.println("preHandle run!");
        return true;
    }

    public void postHandle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) throws Exception {

        System.out.println("postHandle run!");
    }
    public void afterCompletion(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Object o, Exception e) throws Exception {

        System.out.println("afterCompletion run!");
    }
}

需求

1、用户请求url

2、拦截器进行拦截校验

如果请求的url是公开地址(无需登陆即可访问的url),让放行

如果用户session 不存在跳转到登陆页面

如果用户session存在放行,继续操作。

<mvc:interceptors>  

<!--如果配置了多个拦截器,则按顺序执行 -->  

<!-- 登陆认证拦截器 -->  

<mvc:interceptor>  

               <!-- /**表示所有url包括子url路径 -->  

    <mvc:mapping path="/**"/>  

    <bean class="cn.itcast.ssm.interceptor.LoginInterceptor"></bean>  

</mvc:interceptor>  

</mvc:interceptors>  

定义拦截器,实现HandlerInterceptor接口,实现该接口提供了3个方法:


public class LoginInterceptor implements HandlerInterceptor{  

    //进入Handler方法之前执行  

    //用于身份认证,身份授权  

    //比如身份认证,如果认证通过表示当前用户没有登陆,需要此方法拦截不再往下执行  

    public boolean preHandle(HttpServletRequest request, HttpServletResponse response,  

            Object handler) throws Exception {  

        //获取请求的url  

        String url = request.getRequestURI();  

        //判断url是否是公开地址(实际使用时将公开地址配置配置文件中)  

        //这里公开地址是登陆提交的地址  

        if(url.indexOf("login.action")>0){  

            return true;  

        }  

        //判断session  

        HttpSession session = request.getSession();  

        //从session中取出用户身份信息  

        String username = (String) session.getAttribute("username");  

        if(username != null){  

            //身份存在,放行  

            return true;  

        }  

        //执行到这里时表示用户身份需要认证,跳转到登陆页面  

        request.getRequestDispatcher("/WEB-INF/jsp/login.jsp").forward(request, response);  

        return false;  

    }  

    //进入Handler方法之后,返回modelAndView之前执行  

    //应用场景从modelAndView出发:将公用的模型数据(比如菜单导航)在这里传到视图,也可以在这里统一指定视图  

    public void postHandle(HttpServletRequest request, HttpServletResponse response,  

            Object handler, ModelAndView modelAndView) throws Exception {  

        // TODO Auto-generated method stub  

        System.out.println(" LoginInterceptor..postHandle");  

    }  

    //执行Handler完成后执行此方法  

    //应用场景:统一异常处理,统一日志处理  

    public void afterCompletion(HttpServletRequest request,  

            HttpServletResponse response, Object handler, Exception ex)  

            throws Exception {  

        // TODO Auto-generated method stub  

        System.out.println("LoginInterceptor..afterCompletion");  

    }  

}  

登录的controller方法

@Controller  
public class LoginController {  

    // 登陆  

    @RequestMapping("/login")  

    public String login(HttpSession session, String username, String password)  

            throws Exception {  

        // 调用service进行用户身份验证  

        // 在session中保存用户身份信息  

        session.setAttribute("username", username);  

        // 重定向到商品列表页面  

        return "redirect:/items/queryItems.action";  

    }  

    // 退出  

    @RequestMapping("/logout")  

    public String logout(HttpSession session) throws Exception {  

        // 清除session  

        session.invalidate();  

        // 重定向到商品列表页面  

        return "redirect:/items/queryItems.action";  

    }  

}  

拦截器无法拦截jsp

©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 158,425评论 4 361
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 67,058评论 1 291
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 108,186评论 0 243
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 43,848评论 0 204
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 52,249评论 3 286
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 40,554评论 1 216
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 31,830评论 2 312
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 30,536评论 0 197
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 34,239评论 1 241
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 30,505评论 2 244
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 32,004评论 1 258
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 28,346评论 2 253
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 32,999评论 3 235
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 26,060评论 0 8
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 26,821评论 0 194
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 35,574评论 2 271
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 35,480评论 2 267

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 134,099评论 18 139
  • hello springmvc 什么是Spring MVC?Spring MVC 为展现层提供的基于 MVC 设计...
    蛋炒饭_By阅读 283评论 1 0
  • hello springmvc 什么是Spring MVC?Spring MVC 为展现层提供的基于 MVC 设计...
    __豆约翰__阅读 1,051评论 0 1
  • 今天是新的一年的第一天,要想把这一年过好,首先要从第一天开始,在新旧交替的这个夜晚,睡得很好,也有很多美好的...
    史真如阅读 130评论 0 0
  • 想去你住的城市 我想看看你住的城市 是不是有透明的天空和绚烂的霓虹灯 我住的城市从不下雪也没有海 你住的城市却常年...
    一颗777阅读 167评论 0 0