随笔分类 - Spring-MVC入门
学习笔记、基础入门
摘要:1、什么是MyBatis? 答:MyBatis是一个可以自定义SQL、存储过程和高级映射的持久层框架。 2、讲下MyBatis的缓存 答:MyBatis的缓存分为一级缓存和二级缓存,一级缓存放在session里面,默认就有,二级缓存放在它的命名空间里,默认是不打开的,使用二级缓存属性类需要实现Serializable序列化接口(可用来保存对象的状态),可在它的映射文件中配置...
阅读全文
摘要:Spring mvc 流程 为什么要用spring-mvc? 首先spring-mvc是基于Java设计的,实现了Web MVC设计模式,是基于请求驱动的轻量级web级框架。Spring-mvc就是要简化日常的web开发,让开发人员直接面向核心业务的开发。 参数的映射、文件的上传、支持各种视图解析器 servlet只有doGet和doPost,一个servl...
阅读全文
摘要://前端请求页面 //请求地址 //Controller配置 Spring-MVC里面 还包含 国际化操作(i18n),感兴趣可以去看看。 il8n国际化 支持多国语言的web应用,根据客户端系统的语言类型返回对应的界面 来自
阅读全文
摘要:拦截path 不拦截path --> //实现handlerInterceptor 接口 public c...
阅读全文
摘要://异常处理类 @Controller public class ServletInterceptor { @RequestMapping("testException") public String testException(){ System.ou...
阅读全文
摘要:<!--jsp页面--> <form action="testUpload" method="post" enctype="multipart/form-data"> <input type="file" name="file"><br> <input type="text" name="desc"
阅读全文
摘要:@Controller //转换器 例如 user{id,name,age},请求1-zs-23. public class ServletConvert { @RequestMapping("MyConvert") public String convert(@RequestParam...
阅读全文
摘要://服务器端 //浏览器端展示方式 1、el表达式 ${} ${user} ===>>> User(id=1, name=zs) 使用el表达式默认一如下次序进行查询值: ${pageScope} 当前页 ${requestScope} request域 ${sessionScope} session 域 ${applicationSc...
阅读全文
摘要:@Controller //@SessionAttributes(value="stu")//将数据存入session域中,可以多写(value={"stu1,stu2,stu3"}) @SessionAttributes(types=Student.class) //某一对象类型(types={Student.class...
阅读全文
摘要:<!-- Web.xml初始配置--> <servlet> <servlet-name>springmvc</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
阅读全文
摘要:Spring-mvc 开发初始环境 此截图适用于maven开发,非maven开发则不需要Servlet.jar除了spring-webmvc其他的Spring jar包都属于spring 框架。 Junit.jar和hamcrest.jar用于测试。 Commons-io.jar 和 Commons
阅读全文
摘要://mvc获取get参数@RequestMapping(value = "test7/{name}", method = RequestMethod.POST) public String test7(@PathVariable("name") String name) { return "MyJs
阅读全文

浙公网安备 33010602011771号