guyanqing пре 1 година
родитељ
комит
789296ff15
33 измењених фајлова са 605 додато и 5 уклоњено
  1. 14 5
      04maven/spring/.idea/workspace.xml
  2. 13 0
      springmvc/.idea/compiler.xml
  3. 7 0
      springmvc/.idea/encodings.xml
  4. 20 0
      springmvc/.idea/jarRepositories.xml
  5. 17 0
      springmvc/.idea/misc.xml
  6. 6 0
      springmvc/.idea/vcs.xml
  7. 172 0
      springmvc/.idea/workspace.xml
  8. 93 0
      springmvc/pom.xml
  9. 19 0
      springmvc/src/main/java/com/sf/conroller/HelloController.java
  10. 17 0
      springmvc/src/main/resources/spring-mvc.xml
  11. 18 0
      springmvc/src/main/webapp/WEB-INF/dispatcherServlet-servlet.xml
  12. 16 0
      springmvc/src/main/webapp/WEB-INF/views/result.jsp
  13. 32 0
      springmvc/src/main/webapp/WEB-INF/web.xml
  14. 20 0
      springmvc/src/main/webapp/index.jsp
  15. BIN
      springmvc/target/classes/com/sf/conroller/HelloController.class
  16. 17 0
      springmvc/target/classes/spring-mvc.xml
  17. BIN
      springmvc/target/springmvc.war
  18. 5 0
      springmvc/target/springmvc/META-INF/MANIFEST.MF
  19. BIN
      springmvc/target/springmvc/WEB-INF/classes/com/sf/conroller/HelloController.class
  20. 17 0
      springmvc/target/springmvc/WEB-INF/classes/spring-mvc.xml
  21. 18 0
      springmvc/target/springmvc/WEB-INF/dispatcherServlet-servlet.xml
  22. BIN
      springmvc/target/springmvc/WEB-INF/lib/commons-logging-1.2.jar
  23. BIN
      springmvc/target/springmvc/WEB-INF/lib/spring-aop-4.3.27.RELEASE.jar
  24. BIN
      springmvc/target/springmvc/WEB-INF/lib/spring-beans-4.3.27.RELEASE.jar
  25. BIN
      springmvc/target/springmvc/WEB-INF/lib/spring-context-4.3.27.RELEASE.jar
  26. BIN
      springmvc/target/springmvc/WEB-INF/lib/spring-core-4.3.27.RELEASE.jar
  27. BIN
      springmvc/target/springmvc/WEB-INF/lib/spring-expression-4.3.27.RELEASE.jar
  28. BIN
      springmvc/target/springmvc/WEB-INF/lib/spring-web-4.3.27.RELEASE.jar
  29. BIN
      springmvc/target/springmvc/WEB-INF/lib/spring-webmvc-4.3.27.RELEASE.jar
  30. 16 0
      springmvc/target/springmvc/WEB-INF/result.jsp
  31. 16 0
      springmvc/target/springmvc/WEB-INF/views/result.jsp
  32. 32 0
      springmvc/target/springmvc/WEB-INF/web.xml
  33. 20 0
      springmvc/target/springmvc/index.jsp

+ 14 - 5
04maven/spring/.idea/workspace.xml

@@ -5,11 +5,20 @@
   </component>
   <component name="ChangeListManager">
     <list default="true" id="8c3e0ed0-6141-4ee9-a284-3fa2d43ee5eb" name="Changes" comment="">
-      <change afterPath="$PROJECT_DIR$/src/test/java/com/sf/tx/TxTest2.java" afterDir="false" />
-      <change afterPath="$PROJECT_DIR$/src/test/java/com/sf/tx/TxTest3.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/../../springmvc/.idea/compiler.xml" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/../../springmvc/.idea/encodings.xml" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/../../springmvc/.idea/jarRepositories.xml" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/../../springmvc/.idea/misc.xml" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/../../springmvc/.idea/vcs.xml" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/../../springmvc/.idea/workspace.xml" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/../../springmvc/pom.xml" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/../../springmvc/src/main/java/com/sf/conroller/HelloController.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/../../springmvc/src/main/resources/spring-mvc.xml" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/../../springmvc/src/main/webapp/WEB-INF/dispatcherServlet-servlet.xml" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/../../springmvc/src/main/webapp/WEB-INF/views/result.jsp" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/../../springmvc/src/main/webapp/WEB-INF/web.xml" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/../../springmvc/src/main/webapp/index.jsp" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/target/classes/com/sf/service/AccountServiceImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/target/classes/com/sf/service/AccountServiceImpl.class" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -155,7 +164,7 @@
       <option name="number" value="Default" />
       <option name="presentableId" value="Default" />
       <updated>1689993904831</updated>
-      <workItem from="1689993906819" duration="68491000" />
+      <workItem from="1689993906819" duration="76486000" />
     </task>
     <servers />
   </component>

+ 13 - 0
springmvc/.idea/compiler.xml

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CompilerConfiguration">
+    <annotationProcessing>
+      <profile name="Maven default annotation processors profile" enabled="true">
+        <sourceOutputDir name="target/generated-sources/annotations" />
+        <sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
+        <outputRelativeToContentRoot value="true" />
+        <module name="springmvc" />
+      </profile>
+    </annotationProcessing>
+  </component>
+</project>

+ 7 - 0
springmvc/.idea/encodings.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding">
+    <file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
+    <file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
+  </component>
+</project>

+ 20 - 0
springmvc/.idea/jarRepositories.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RemoteRepositoriesConfiguration">
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Central Repository" />
+      <option name="url" value="http://maven.aliyun.com/nexus/content/groups/public/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Maven Central repository" />
+      <option name="url" value="https://repo1.maven.org/maven2" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="jboss.community" />
+      <option name="name" value="JBoss Community repository" />
+      <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
+    </remote-repository>
+  </component>
+</project>

+ 17 - 0
springmvc/.idea/misc.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ExternalStorageConfigurationManager" enabled="true" />
+  <component name="FrameworkDetectionExcludesConfiguration">
+    <file type="web" url="file://$PROJECT_DIR$" />
+  </component>
+  <component name="MavenProjectsManager">
+    <option name="originalFiles">
+      <list>
+        <option value="$PROJECT_DIR$/pom.xml" />
+      </list>
+    </option>
+  </component>
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
+    <output url="file://$PROJECT_DIR$/out" />
+  </component>
+</project>

+ 6 - 0
springmvc/.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
+  </component>
+</project>

+ 172 - 0
springmvc/.idea/workspace.xml

@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ArtifactsWorkspaceSettings">
+    <artifacts-to-build>
+      <artifact name="springmvc:war" />
+    </artifacts-to-build>
+  </component>
+  <component name="AutoImportSettings">
+    <option name="autoReloadType" value="SELECTIVE" />
+  </component>
+  <component name="ChangeListManager">
+    <list default="true" id="32ba8696-e546-42f9-8a17-6935ed145529" name="Changes" comment="">
+      <change afterPath="$PROJECT_DIR$/.idea/compiler.xml" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/.idea/encodings.xml" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/.idea/jarRepositories.xml" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/.idea/vcs.xml" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/pom.xml" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/java/com/sf/conroller/HelloController.java" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/resources/spring-mvc.xml" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/webapp/WEB-INF/dispatcherServlet-servlet.xml" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/webapp/WEB-INF/views/result.jsp" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/webapp/WEB-INF/web.xml" afterDir="false" />
+      <change afterPath="$PROJECT_DIR$/src/main/webapp/index.jsp" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/../04maven/spring/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../04maven/spring/.idea/workspace.xml" afterDir="false" />
+    </list>
+    <option name="SHOW_DIALOG" value="false" />
+    <option name="HIGHLIGHT_CONFLICTS" value="true" />
+    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
+    <option name="LAST_RESOLUTION" value="IGNORE" />
+  </component>
+  <component name="FileTemplateManagerImpl">
+    <option name="RECENT_TEMPLATES">
+      <list>
+        <option value="Jsp File" />
+        <option value="Class" />
+        <option value="spring-beans.schema" />
+      </list>
+    </option>
+  </component>
+  <component name="Git.Settings">
+    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." />
+  </component>
+  <component name="LogFilters">
+    <option name="FILTER_ERRORS" value="false" />
+    <option name="FILTER_WARNINGS" value="false" />
+    <option name="FILTER_INFO" value="true" />
+    <option name="FILTER_DEBUG" value="true" />
+    <option name="CUSTOM_FILTER" />
+  </component>
+  <component name="MarkdownSettingsMigration">
+    <option name="stateVersion" value="1" />
+  </component>
+  <component name="ProjectId" id="2T8zT20KYgnalMl1nyZNg6QSN9v" />
+  <component name="ProjectLevelVcsManager" settingsEditedManually="true">
+    <ConfirmationsSetting value="2" id="Add" />
+  </component>
+  <component name="ProjectViewState">
+    <option name="showLibraryContents" value="true" />
+  </component>
+  <component name="PropertiesComponent"><![CDATA[{
+  "keyToString": {
+    "RunOnceActivity.OpenProjectViewOnStart": "true",
+    "RunOnceActivity.ShowReadmeOnStart": "true",
+    "SHARE_PROJECT_CONFIGURATION_FILES": "true",
+    "WebServerToolWindowFactoryState": "false",
+    "node.js.detected.package.eslint": "true",
+    "node.js.detected.package.tslint": "true",
+    "node.js.selected.package.eslint": "(autodetect)",
+    "node.js.selected.package.tslint": "(autodetect)",
+    "project.structure.last.edited": "Modules",
+    "project.structure.proportion": "0.15",
+    "project.structure.side.proportion": "0.13333334",
+    "vue.rearranger.settings.migration": "true"
+  }
+}]]></component>
+  <component name="RecentsManager">
+    <key name="MoveFile.RECENT_KEYS">
+      <recent name="D:\Program Files\IntelliJ IDEA 2019.3.3\VIP23\springmvc\src\main\webapp\WEB-INF\views" />
+    </key>
+  </component>
+  <component name="RunManager">
+    <configuration name="Tomcat-springmvc" type="#com.intellij.j2ee.web.tomcat.TomcatRunConfigurationFactory" factoryName="Local" APPLICATION_SERVER_NAME="Tomcat 9.0.70" ALTERNATIVE_JRE_ENABLED="false">
+      <option name="UPDATING_POLICY" value="restart-server" />
+      <deployment>
+        <artifact name="springmvc:war">
+          <settings>
+            <option name="CONTEXT_PATH" value="/" />
+          </settings>
+        </artifact>
+      </deployment>
+      <server-settings>
+        <option name="BASE_DIRECTORY_NAME" value="851e40cd-0da5-4d03-9e43-cd03673cb574" />
+      </server-settings>
+      <predefined_log_file enabled="true" id="Tomcat" />
+      <predefined_log_file enabled="true" id="Tomcat Catalina" />
+      <predefined_log_file id="Tomcat Manager" />
+      <predefined_log_file id="Tomcat Host Manager" />
+      <predefined_log_file id="Tomcat Localhost Access" />
+      <RunnerSettings RunnerId="Debug">
+        <option name="DEBUG_PORT" value="58986" />
+      </RunnerSettings>
+      <ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Cover">
+        <option name="USE_ENV_VARIABLES" value="true" />
+        <STARTUP>
+          <option name="USE_DEFAULT" value="true" />
+          <option name="SCRIPT" value="" />
+          <option name="VM_PARAMETERS" value="" />
+          <option name="PROGRAM_PARAMETERS" value="" />
+        </STARTUP>
+        <SHUTDOWN>
+          <option name="USE_DEFAULT" value="true" />
+          <option name="SCRIPT" value="" />
+          <option name="VM_PARAMETERS" value="" />
+          <option name="PROGRAM_PARAMETERS" value="" />
+        </SHUTDOWN>
+      </ConfigurationWrapper>
+      <ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Debug">
+        <option name="USE_ENV_VARIABLES" value="true" />
+        <STARTUP>
+          <option name="USE_DEFAULT" value="true" />
+          <option name="SCRIPT" value="" />
+          <option name="VM_PARAMETERS" value="" />
+          <option name="PROGRAM_PARAMETERS" value="" />
+        </STARTUP>
+        <SHUTDOWN>
+          <option name="USE_DEFAULT" value="true" />
+          <option name="SCRIPT" value="" />
+          <option name="VM_PARAMETERS" value="" />
+          <option name="PROGRAM_PARAMETERS" value="" />
+        </SHUTDOWN>
+      </ConfigurationWrapper>
+      <ConfigurationWrapper VM_VAR="JAVA_OPTS" RunnerId="Run">
+        <option name="USE_ENV_VARIABLES" value="true" />
+        <STARTUP>
+          <option name="USE_DEFAULT" value="true" />
+          <option name="SCRIPT" value="" />
+          <option name="VM_PARAMETERS" value="" />
+          <option name="PROGRAM_PARAMETERS" value="" />
+        </STARTUP>
+        <SHUTDOWN>
+          <option name="USE_DEFAULT" value="true" />
+          <option name="SCRIPT" value="" />
+          <option name="VM_PARAMETERS" value="" />
+          <option name="PROGRAM_PARAMETERS" value="" />
+        </SHUTDOWN>
+      </ConfigurationWrapper>
+      <method v="2">
+        <option name="Make" enabled="true" />
+        <option name="BuildArtifacts" enabled="true">
+          <artifact name="springmvc:war" />
+        </option>
+      </method>
+    </configuration>
+  </component>
+  <component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
+  <component name="TaskManager">
+    <task active="true" id="Default" summary="Default task">
+      <changelist id="32ba8696-e546-42f9-8a17-6935ed145529" name="Changes" comment="" />
+      <created>1690439501381</created>
+      <option name="number" value="Default" />
+      <option name="presentableId" value="Default" />
+      <updated>1690439501381</updated>
+      <workItem from="1690439502870" duration="6929000" />
+    </task>
+    <servers />
+  </component>
+  <component name="TypeScriptGeneratedFilesManager">
+    <option name="version" value="3" />
+  </component>
+</project>

+ 93 - 0
springmvc/pom.xml

@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>com.sf</groupId>
+  <artifactId>springmvc</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>war</packaging>
+
+  <name>springmvc Maven Webapp</name>
+  <!-- FIXME change it to the project's website -->
+  <url>http://www.example.com</url>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <maven.compiler.source>1.8</maven.compiler.source>
+    <maven.compiler.target>1.8</maven.compiler.target>
+  </properties>
+
+  <dependencies>
+    <dependency>
+      <groupId>junit</groupId>
+      <artifactId>junit</artifactId>
+      <version>4.12</version>
+      <scope>test</scope>
+    </dependency>
+<!--    springmvc 依赖-->
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-web</artifactId>
+      <version>4.3.27.RELEASE</version>
+    </dependency>
+    <dependency>
+      <groupId>org.springframework</groupId>
+      <artifactId>spring-webmvc</artifactId>
+      <version>4.3.27.RELEASE</version>
+    </dependency>
+  </dependencies>
+
+
+
+  <!--  spring-bom-->
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.springframework</groupId>
+        <artifactId>spring-framework-bom</artifactId>
+        <version>4.3.27.RELEASE</version>
+        <scope>import</scope>
+        <type>pom</type>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
+  <build>
+    <finalName>springmvc</finalName>
+    <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
+      <plugins>
+        <plugin>
+          <artifactId>maven-clean-plugin</artifactId>
+          <version>3.1.0</version>
+        </plugin>
+        <!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->
+        <plugin>
+          <artifactId>maven-resources-plugin</artifactId>
+          <version>3.0.2</version>
+        </plugin>
+        <plugin>
+          <artifactId>maven-compiler-plugin</artifactId>
+          <version>3.8.0</version>
+        </plugin>
+        <plugin>
+          <artifactId>maven-surefire-plugin</artifactId>
+          <version>2.22.1</version>
+        </plugin>
+        <plugin>
+          <artifactId>maven-war-plugin</artifactId>
+          <version>3.2.2</version>
+        </plugin>
+        <plugin>
+          <artifactId>maven-install-plugin</artifactId>
+          <version>2.5.2</version>
+        </plugin>
+        <plugin>
+          <artifactId>maven-deploy-plugin</artifactId>
+          <version>2.8.2</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+  </build>
+</project>

+ 19 - 0
springmvc/src/main/java/com/sf/conroller/HelloController.java

@@ -0,0 +1,19 @@
+package com.sf.conroller;
+
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+@Controller
+public class HelloController {
+
+
+    /**
+     * string : "result":视图的名称
+     * @return
+     */
+    @RequestMapping(value = "/hello")
+    public String hello(){
+        System.out.println("hello");
+        return "result";
+    }
+}

+ 17 - 0
springmvc/src/main/resources/spring-mvc.xml

@@ -0,0 +1,17 @@
+<?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"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
+
+<!--配置扫描的包-->
+    <context:component-scan base-package="com"></context:component-scan>
+
+<!--    配置强大的视图解析器-->
+    <bean id="internalResourceViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
+<!--        前缀-->
+        <property name="prefix" value="/WEB-INF/views/"></property>
+<!--        后缀-->
+        <property name="suffix" value=".jsp"></property>
+    </bean>
+</beans>

+ 18 - 0
springmvc/src/main/webapp/WEB-INF/dispatcherServlet-servlet.xml

@@ -0,0 +1,18 @@
+<?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"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
+
+
+    <!--配置扫描的包-->
+    <context:component-scan base-package="com"></context:component-scan>
+
+    <!--    配置强大的视图解析器-->
+    <bean id="internalResourceViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
+        <!--        前缀-->
+        <property name="prefix" value="/WEB-INF/views/"></property>
+        <!--        后缀-->
+        <property name="suffix" value=".jsp"></property>
+    </bean>
+</beans>

+ 16 - 0
springmvc/src/main/webapp/WEB-INF/views/result.jsp

@@ -0,0 +1,16 @@
+<%--
+  Created by IntelliJ IDEA.
+  User: Lenovo
+  Date: 2023/7/27
+  Time: 14:40
+  To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<html>
+<head>
+    <title>结果页</title>
+</head>
+<body>
+<h1>ok...</h1>
+</body>
+</html>

+ 32 - 0
springmvc/src/main/webapp/WEB-INF/web.xml

@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+         version="2.5">
+
+
+    <servlet>
+<!--        初始化这个dispatcherServlet的名称-->
+        <servlet-name>dispatcherServlet</servlet-name>
+<!--        初始化DispatcherServlet-->
+        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+<!--&lt;!&ndash;        加载本地配置文件&ndash;&gt;-->
+<!--        <init-param>-->
+<!--            <param-name>contextConfigLocation</param-name>-->
+<!--            <param-value>classpath:spring-mvc.xml</param-value>-->
+<!--        </init-param>-->
+<!--&lt;!&ndash;        加载顺序&ndash;&gt;-->
+<!--        <load-on-startup>1</load-on-startup>-->
+    </servlet>
+
+    <servlet-mapping>
+<!--        对应的是  <servlet> 标签中的  <servlet-name>-->
+        <servlet-name>dispatcherServlet</servlet-name>
+<!--        拦截规则   /拦截除index.jsp依赖的所有请求
+/*   拦截所有的请求
+-->
+        <url-pattern>/</url-pattern>
+    </servlet-mapping>
+
+
+</web-app>

+ 20 - 0
springmvc/src/main/webapp/index.jsp

@@ -0,0 +1,20 @@
+<%--
+  Created by IntelliJ IDEA.
+  User: Lenovo
+  Date: 2023/7/27
+  Time: 14:37
+  To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<html>
+<head>
+    <title>Title</title>
+</head>
+<body>
+<h1>hello world</h1>
+<br>
+
+<a href="${pageContext.request.contextPath}/hello">HelloController</a>
+
+</body>
+</html>

BIN
springmvc/target/classes/com/sf/conroller/HelloController.class


+ 17 - 0
springmvc/target/classes/spring-mvc.xml

@@ -0,0 +1,17 @@
+<?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"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
+
+<!--配置扫描的包-->
+    <context:component-scan base-package="com"></context:component-scan>
+
+<!--    配置强大的视图解析器-->
+    <bean id="internalResourceViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
+<!--        前缀-->
+        <property name="prefix" value="/WEB-INF/views/"></property>
+<!--        后缀-->
+        <property name="suffix" value=".jsp"></property>
+    </bean>
+</beans>

BIN
springmvc/target/springmvc.war


+ 5 - 0
springmvc/target/springmvc/META-INF/MANIFEST.MF

@@ -0,0 +1,5 @@
+Manifest-Version: 1.0
+Created-By: IntelliJ IDEA
+Built-By: Lenovo
+Build-Jdk: 1.8.0_171
+

BIN
springmvc/target/springmvc/WEB-INF/classes/com/sf/conroller/HelloController.class


+ 17 - 0
springmvc/target/springmvc/WEB-INF/classes/spring-mvc.xml

@@ -0,0 +1,17 @@
+<?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"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
+
+<!--配置扫描的包-->
+    <context:component-scan base-package="com"></context:component-scan>
+
+<!--    配置强大的视图解析器-->
+    <bean id="internalResourceViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
+<!--        前缀-->
+        <property name="prefix" value="/WEB-INF/views/"></property>
+<!--        后缀-->
+        <property name="suffix" value=".jsp"></property>
+    </bean>
+</beans>

+ 18 - 0
springmvc/target/springmvc/WEB-INF/dispatcherServlet-servlet.xml

@@ -0,0 +1,18 @@
+<?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"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
+
+
+    <!--配置扫描的包-->
+    <context:component-scan base-package="com"></context:component-scan>
+
+    <!--    配置强大的视图解析器-->
+    <bean id="internalResourceViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
+        <!--        前缀-->
+        <property name="prefix" value="/WEB-INF/views/"></property>
+        <!--        后缀-->
+        <property name="suffix" value=".jsp"></property>
+    </bean>
+</beans>

BIN
springmvc/target/springmvc/WEB-INF/lib/commons-logging-1.2.jar


BIN
springmvc/target/springmvc/WEB-INF/lib/spring-aop-4.3.27.RELEASE.jar


BIN
springmvc/target/springmvc/WEB-INF/lib/spring-beans-4.3.27.RELEASE.jar


BIN
springmvc/target/springmvc/WEB-INF/lib/spring-context-4.3.27.RELEASE.jar


BIN
springmvc/target/springmvc/WEB-INF/lib/spring-core-4.3.27.RELEASE.jar


BIN
springmvc/target/springmvc/WEB-INF/lib/spring-expression-4.3.27.RELEASE.jar


BIN
springmvc/target/springmvc/WEB-INF/lib/spring-web-4.3.27.RELEASE.jar


BIN
springmvc/target/springmvc/WEB-INF/lib/spring-webmvc-4.3.27.RELEASE.jar


+ 16 - 0
springmvc/target/springmvc/WEB-INF/result.jsp

@@ -0,0 +1,16 @@
+<%--
+  Created by IntelliJ IDEA.
+  User: Lenovo
+  Date: 2023/7/27
+  Time: 14:40
+  To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<html>
+<head>
+    <title>结果页</title>
+</head>
+<body>
+<h1>ok...</h1>
+</body>
+</html>

+ 16 - 0
springmvc/target/springmvc/WEB-INF/views/result.jsp

@@ -0,0 +1,16 @@
+<%--
+  Created by IntelliJ IDEA.
+  User: Lenovo
+  Date: 2023/7/27
+  Time: 14:40
+  To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<html>
+<head>
+    <title>结果页</title>
+</head>
+<body>
+<h1>ok...</h1>
+</body>
+</html>

+ 32 - 0
springmvc/target/springmvc/WEB-INF/web.xml

@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="http://java.sun.com/xml/ns/javaee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+         version="2.5">
+
+
+    <servlet>
+<!--        初始化这个dispatcherServlet的名称-->
+        <servlet-name>dispatcherServlet</servlet-name>
+<!--        初始化DispatcherServlet-->
+        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+<!--&lt;!&ndash;        加载本地配置文件&ndash;&gt;-->
+<!--        <init-param>-->
+<!--            <param-name>contextConfigLocation</param-name>-->
+<!--            <param-value>classpath:spring-mvc.xml</param-value>-->
+<!--        </init-param>-->
+<!--&lt;!&ndash;        加载顺序&ndash;&gt;-->
+<!--        <load-on-startup>1</load-on-startup>-->
+    </servlet>
+
+    <servlet-mapping>
+<!--        对应的是  <servlet> 标签中的  <servlet-name>-->
+        <servlet-name>dispatcherServlet</servlet-name>
+<!--        拦截规则   /拦截除index.jsp依赖的所有请求
+/*   拦截所有的请求
+-->
+        <url-pattern>/</url-pattern>
+    </servlet-mapping>
+
+
+</web-app>

+ 20 - 0
springmvc/target/springmvc/index.jsp

@@ -0,0 +1,20 @@
+<%--
+  Created by IntelliJ IDEA.
+  User: Lenovo
+  Date: 2023/7/27
+  Time: 14:37
+  To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<html>
+<head>
+    <title>Title</title>
+</head>
+<body>
+<h1>hello world</h1>
+<br>
+
+<a href="${pageContext.request.contextPath}/hello">HelloController</a>
+
+</body>
+</html>