- 将Student类从com.ssm.di包移动到com.ssm.aop.xml包 - 添加SpringMVC控制器FirstController和相关JSP页面 - 配置springmvc.xml中的组件扫描和视图解析器 - 更新项目模块配置添加Web facet和依赖库 - 创建grademanagement-SpringMVCProject war工件配置 - 修改Student类移除注解配置改用XML配置方式 - 在测试类中调整Bean获取和使用方式main
parent
ffedbbfa25
commit
aa0000d19b
@ -0,0 +1,14 @@
|
||||
<component name="ArtifactManager">
|
||||
<artifact type="exploded-war" name="grademanagement-SpringMVCProject:war exploded">
|
||||
<output-path>$PROJECT_DIR$/out/artifacts/grademanagement_SpringMVCProject_war_exploded</output-path>
|
||||
<root id="root">
|
||||
<element id="directory" name="WEB-INF">
|
||||
<element id="directory" name="classes">
|
||||
<element id="module-output" name="grademanagement-SpringMVCProject" />
|
||||
</element>
|
||||
<element id="directory" name="lib" />
|
||||
</element>
|
||||
<element id="javaee-facet-resources" facet="grademanagement-SpringMVCProject/web/Web" />
|
||||
</root>
|
||||
</artifact>
|
||||
</component>
|
||||
@ -1,5 +1,13 @@
|
||||
package com.ssm.controller;
|
||||
|
||||
public class FirstController {
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
@Controller
|
||||
public class FirstController {
|
||||
@RequestMapping("/hello")
|
||||
//编写控制器方法
|
||||
public String hello(){
|
||||
return "showFirst";
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,16 @@
|
||||
<%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: cesar
|
||||
Date: 2026/4/22
|
||||
Time: 17:10
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -1,12 +0,0 @@
|
||||
<?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">
|
||||
<display-name>grademanagement-SpringMVCProject</display-name>
|
||||
<welcome-file-list>
|
||||
<welcome-file>index.html</welcome-file>
|
||||
<welcome-file>index.htm</welcome-file>
|
||||
<welcome-file>index.jsp</welcome-file>
|
||||
<welcome-file>default.html</welcome-file>
|
||||
<welcome-file>default.htm</welcome-file>
|
||||
<welcome-file>default.jsp</welcome-file>
|
||||
</welcome-file-list>
|
||||
</web-app>
|
||||
@ -0,0 +1,16 @@
|
||||
<%--
|
||||
Created by IntelliJ IDEA.
|
||||
User: cesar
|
||||
Date: 2026/4/22
|
||||
Time: 16:23
|
||||
To change this template use File | Settings | File Templates.
|
||||
--%>
|
||||
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
|
||||
<html>
|
||||
<head>
|
||||
<title></title>
|
||||
</head>
|
||||
<body>
|
||||
<a href="hello"></a>
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue