发表于: 2017-11-30 21:49:59

2 724


今天学习的内容

上次按照网上示例写的代码跑了一下没有跑通还是没有,因为示例是用的eclipse工具,我还没有使用过这个工具,所以在使用的时候可能有些细节例如路径,配置信息等等可能会有差别,导致运行时出现了多个错误,查看了一遍,有很多理解不了的,我感觉这些问题不适合现阶段的我,所以干脆重写了一个,先看下运行结果

这是查询的结果,还没梳理完,师兄让先下载个postman检测下接口,看了下师兄的小课堂,然后下载了一个

看下目录

写完发现和spring mybatis差不多,就是多了几个配置文件,多个了控制器,还多了几个jar包,我的view还没写,东西也不是特别多,觉得难应该是我还没有把之前学的概念和实例结合起来,需要多做联系,现在把配置文件贴一下

还有最后的web.xml

<?xml version="1.0" encoding="UTF-8"?>

<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"

         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"

         version="3.1">

  <display-name>ChatRobot</display-name>

  <description>ChatRobot_Alpha_0.0.1</description>

  <!-- 编码过滤器 -->

  <filter>

    <filter-name>encodingFilter</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>

  </filter>

  <filter-mapping>

    <filter-name>encodingFilter</filter-name>

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

  </filter-mapping>

  <!-- 配置DispatcherServlet -->

  <servlet>

    <servlet-name>SpringMVC</servlet-name>

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

    <!-- 配置springMVC需要加载的配置文件-->

    <init-param>

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

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

    </init-param>

    <load-on-startup>1</load-on-startup>

    <async-supported>true</async-supported>

  </servlet>

  <servlet-mapping>

    <servlet-name>SpringMVC</servlet-name>

    <!-- 匹配所有请求,此处也可以配置成 *.do 形式 -->

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

  </servlet-mapping>

  <welcome-file-list>

    <welcome-file>index.html</welcome-file>

  </welcome-file-list>

</web-app>


遇到的问题

跑了一遍以后,我关掉网页,然后再次运行的时候遇到了Error running Tomcat8: Address localhost:1099 is already in use错误,网上查了一下,是因为运行的时候会产生两个java.exe的进程,关闭网页后该进程还在,手动结束后可以再次运行.


今天的收获

跑通了spring MVC,但是没有经过controller,学习并下载了postman


明天的计划

明天先测一下postman,然后再把剩下的写了.


任务进度:任务2步骤4

任务开始时间:11月22日

任务结束时间:11月30日

预计延期至12月3日

禅道:http://task.ptteng.com/zentao/project-task-399.html



返回列表 返回列表
评论

    分享到