Fork me on GitHub
上一页 1 ··· 71 72 73 74 75 76 77 78 79 ··· 119 下一页
摘要: mvc:view-controller标签可以让我们不经过任何handler而直接访问到相关视图。 在springmvc.xml配置文件中配置: <!-- 配置直接转发的页面 --> <!-- 可以直接相应转发的页面, 而无需再经过 Handler 的方法. --> <mvc:view-contro 阅读全文
posted @ 2020-01-11 14:29 西西嘛呦 阅读(377) 评论(0) 推荐(0)
摘要: 1.导入包 jstl.jar standard.jar 2.在springmvc.xml中配置 <!-- 配置国际化资源文件 --> <bean id="messageSource" class="org.springframework.context.support.ResourceBundleM 阅读全文
posted @ 2020-01-11 14:12 西西嘛呦 阅读(504) 评论(0) 推荐(0)
摘要: 在springmvc.xml配置文件中配置了将逻辑视图转换成物理视图: <!-- 配置视图解析器:如何把handler返回值解析为实际的物理视图 --> <bean class="org.springframework.web.servlet.view.InternalResourceViewRes 阅读全文
posted @ 2020-01-11 13:51 西西嘛呦 阅读(258) 评论(0) 推荐(0)
摘要: 现有如下代码: SpringmvcTest.java @SessionAttributes(value={"person"},types= {String.class}) @RequestMapping("/springmvc") @Controller public class Springmvc 阅读全文
posted @ 2020-01-11 13:33 西西嘛呦 阅读(366) 评论(0) 推荐(0)
摘要: springmvc确定目标方法pojo类型入参的过程:(1)确定一个Key。 若目标方法的pojo参数没有使用@ModelAttribute作为修饰,则key为pojo类名第一个字母小写的字符串一致。若使用了@ModelAttribute来修饰,则key为@ModelAttribute注解的valu 阅读全文
posted @ 2020-01-11 12:55 西西嘛呦 阅读(357) 评论(0) 推荐(0)
摘要: 我们在更新数据时,有的数据是不能够被修改的。假设User有三个字段,username,age,password。我们在前端传过来的数据为username和age,不能修改password,一般情况下,在后端都会新建一个user对象,使用该user对象对数据库进行更新操作。r那么我们直接进行更新操作, 阅读全文
posted @ 2020-01-11 11:35 西西嘛呦 阅读(809) 评论(0) 推荐(0)
摘要: ModelAndView和Map都是将数据模型放到请求域request中。 (1)若希望在多个请求之间共用某个数据模型属性数据,可以在控制器类上加一个@SessionAttributes。springmvc会将在模型中对应的属性存到HttpSession中。 (2)@SessionAttribute 阅读全文
posted @ 2020-01-10 22:05 西西嘛呦 阅读(244) 评论(0) 推荐(0)
摘要: SpringmvcTest.java @RequestMapping("/springmvc") @Controller public class SpringmvcTest { private static final String SUCCESS = "success"; @RequestMap 阅读全文
posted @ 2020-01-10 21:29 西西嘛呦 阅读(228) 评论(0) 推荐(0)
摘要: springmvc提供了以下几种途径来输出模型数据: (1)ModelAndView:处理方法返回值类型为ModelAndView时,方法体即可通过该对象添加模型数据。 (2)Map及Model:入参为org.springframework.ui.Model、org.springframework. 阅读全文
posted @ 2020-01-10 21:21 西西嘛呦 阅读(281) 评论(0) 推荐(0)
摘要: springmvc可以接受传入的API: HttpServletRequest HttpServletResponse HttpSession java.security.Principal InputStream OutputStream Reader Writer @RequestMapping 阅读全文
posted @ 2020-01-10 20:53 西西嘛呦 阅读(165) 评论(1) 推荐(0)
上一页 1 ··· 71 72 73 74 75 76 77 78 79 ··· 119 下一页