SSM-SpringMVC
codeDonald
这个作者很懒,什么都没留下…
展开
-
【SSM-SpringMVC】解决中文乱码
在web.xml下配置 <!-- 设置过滤器 --> <filter> <filter-name>encoding</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <i...原创 2019-04-23 16:40:09 · 96 阅读 · 0 评论 -
【SSM-SpringMVC】基本数据类型和对象类型为参数
1基本数据类型 在 *.jsp 表单提交数据,Contrller 接收输出 示例代码 put.jsp 提交数据 <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01...原创 2019-04-23 21:10:41 · 891 阅读 · 0 评论 -
【SSM-SpringMVC】springMVC
1.pom <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>5.1.7.RELEASE</version> &...原创 2019-06-04 20:00:45 · 72 阅读 · 0 评论 -
【SSM-SpringMVC】视图解析器
如果想访问一个在webapp下的还有包的目录 或者在 ModelAndView mv= new ModelAndView("/demo.jsp"); 直接变成“demo” 都需要视图解析器 在spring-servlert.xml中添加视图解析 <bean id="viewResolver" class="org.springframework.web.servlet.vie...原创 2019-06-04 20:08:48 · 2147 阅读 · 0 评论 -
【SSM-SpringMVC】注解
1.springmvc-servlet.xml 需要用到context自动扫描 只需要保留视图解析器就行了 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/200...原创 2019-06-04 20:25:57 · 130 阅读 · 0 评论 -
【SSM-SpringMVC】获取表单数据
1.pojo package pojo; public class Product { private int id; private String name; private float price; public int getId() { return id; } public void setId(int id) { ...原创 2019-06-04 20:45:19 · 653 阅读 · 0 评论