写ModelAttribute注解时为什么会出现modelattribute 参数cannot be resolved to a typ

从来都不坦荡,情绪都写在脸上;不开心的时候,不爱说话,笑也勉强。
课堂笔记,如果这么写,不仅仅是手速,还要有语速,
这样不太适合!
关于数据传递:
客户端传递数据到服务端:
1.使用普通的形式
A.传递简单的数据
如果是说你传递的数据的名称跟控制层中的形参的名称不一致的情况下需要使用
注解: @RequestParam()如果存在在注解的话,那么一定要传递对应的名称,除非设置required="false"
个人建议是保存名称一致
B.传递的数据为表单的数据
(1)使用普通的表单进行提交,那么你需要注意的是 name="类中的数据",如果是说我的类中有关联的类型那么name="role.role_id",表单中含有name属性才是传递数据
(2)使用Jquery中的表单序列化操作,该操作比较方便,但是如果是日后工作当中,会只用客户端传递JSON的数据形式的字符串
2.使用的是占位符
A.使用占位符操作,那么你一般情况下需要传递简单的数据,形式如下/sys/100/tomcat
控制层当中,一定为如下的格式 /sys/{id}/{name},并且对应的形参中一定要含有@PathVariable注解
B.其实占位符可以传递复杂的数据,但是一般情况下需要你知道如何这是正则表达式
服务端传递数据到客户端:
1.一共介绍了5种形式
(1)使用原生的二阶段用request进行传递数据,需要你再方法(HttpServletRequest)形式
(2)ModelAndView
(3)方法名(Map&String,Object& map)注意这些形参对进行实例化操作
(4)方法名(ModelMap modelMap)注意你可以使用 Ctrl+T的快捷键进行查看继承的关系
(5)方法名(Model model)
(6)返回客户端的数据为JSON的格式
JavaScript Object Navtion 轻量级的传输数据格式
2.关于在客户端显示数据的形式
A.使用EL表达式和JSTL标签
B.使用SpringMVC提供的标签[需要你们提醒我讲]
------------------------------------------------------------------------------
学习内容:1.数据的格式化和@InitBinder的注解使用2.@ModelAttribute的简单使用3.封装【未完成】
单独传递数据为日期
&h2&日期传递&/h2&
action="client01"
method="get"&
type="text"
name="mydate"
placeholder="输入日期格式"&
type="submit"
value="提交日期数据"&
一般情况下的,日期格式我们习惯于使用YYYY-MM-DD的形式的这种形式,HTTP Status 400[数据转换失败]@DateTimeFormat(pattern="yyyy-MM-dd")这种形式的话,那么你的客户端只能传递该种形式疑问,我想让两种形式格式?
@RequestMapping("/client01")
ModelAndView test01(@RequestParam(name="mydate") @DateTimeFormat(pattern="yyyy-MM-dd")Date date){
System.out.println(date);
单独传递数据为金钱
&h2&金钱传递&/h2&
action="client02"
method="get"&
type="text"
name="money"
placeholder="输入金钱格式"&
type="submit"
value="提交金钱数据"&
关于金钱,我们一般习惯于使用表示方法为:
1,123,000.00的形式,如果工作当中涉及到金钱操作的时候,一会使用的是为BigDecimal处理金钱,还有不能使用你了解的四舍五入,需要使用银行家的四舍五入方式
@RequestMapping("/client02")
public ModelAndView test02(@NumberFormat(pattern="#,###.##")Double money){
System.out.println(money);
疑问,我想让两种形式||||格式?
我们需要使用对数据的处理注解,@InitBinder?
我们介绍的实现方式,现在我们只是了解其使用方式:
当你有客户数据传递的时候,那么我会进入含有标注@InitBinder的方法中
package com.shxt.
java.awt.Graphics;
java.awt.Rectangle;
java.beans.PropertyChangeListener;
java.beans.PropertyEditor;
import java.beans.PropertyEditorS
import java.io.UnsupportedEncodingE
import java.util.D
import java.util.M
import javax.servlet.http.HttpServletR
import org.springframework.format.annotation.DateTimeF
import org.springframework.format.annotation.NumberF
import org.springframework.stereotype.C
import org.springframework.web.bind.WebDataB
import org.springframework.web.bind.annotation.InitB
import org.springframework.web.bind.annotation.RequestM
import org.springframework.web.bind.annotation.RequestP
import org.springframework.web.servlet.ModelAndV
import com.shxt.model.U
@Controller//如果是你没有命名,那么id=类名的首字母小写
class ClienDataController {
@RequestMapping("/client01")
public ModelAndView test01(@RequestParam(name="mydate") @DateTimeFormat(pattern="yyyy-MM-dd")Date date){//有接收客户端数据,进入@InitBinder注解的方法内部
System.out.println(date);
@RequestMapping("/client02")
public ModelAndView test02(@NumberFormat(pattern="#,###.##")Double money){//有接收客户端数据,进入@InitBinder注解的方法内部
System.out.println(money);
@RequestMapping("/client03")
public ModelAndView test03(){//没有接收客户端数据,不进入@InitBinder注解的方法内部
System.out.println("test03");
@RequestMapping("/client04")
public ModelAndView test04(User user){//有接收客户端数据,进入@InitBinder注解的方法内部
System.out.println("test04");
@RequestMapping("/client05")
public ModelAndView test05(HttpServletRequest request){//没有接收客户端数据,不进入@InitBinder注解的方法内部
System.out.println("test05");
@RequestMapping("/client06")
public ModelAndView test06(Map&String,Object& map){//没有接收客户端数据,不进入@InitBinder注解的方法内部
System.out.println("test06");
@RequestMapping("/client07")
public ModelAndView test07(String shxt) throws UnsupportedEncodingException{
//如果是GET请求解决中文乱码问题,有两种方式:请自己总结一下
/*System.out.println("test07----&&"+
new String(shxt.getBytes("ISO8859-1"),"UTF-8"));*/
System.out.println("test07----&&"+shxt);
@InitBinder
//当客户端传递数据的时候,并且我的控制器中的方法要接收之前,会进入该标注的方法内部进行处理
publicvoid shxt(WebDataBinder binder){
System.out.println("请注意观察该输入语句,在上面情况下输出?");
//String.class为客户端传递的数据要转换成形参所对应的那个类
binder.registerCustomEditor(String.class, new PropertyEditorSupport(){
//内部类--&&什么是Java内部类,如何使用?
void setAsText(String text) throws IllegalArgumentException {
System.out.println("客户端传递的数据为:"+text);
setValue(text+":齐天大圣");//重新赋值
配置工具类,进行对日期的解决方案
@InitBinder//当客户端传递数据的时候,并且我的控制器中的方法要接收之前,会进入该标注的方法内部进行处理
void shxt(WebDataBinder binder){
binder.registerCustomEditor(Date.class, new PropertyEditorSupport(){
void setAsText(String text) throws IllegalArgumentException {
setValue(DateUtils.parseDate(text));
针对于DateUtils的工具类,默认需要使用commons-lang-2.6.jar包的支持
//注意使用这种方式去实现,自己的工具类的方式?//可以回去自己去实现继承Map接口,实现一个HashMap,很好玩public
class DateUtils extends mons.lang.time.DateUtils {
static String[] parsePatterns = {
"yyyy-MM-dd", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM",
"yyyy/MM/dd", "yyyy/MM/dd HH:mm:ss", "yyyy/MM/dd HH:mm", "yyyy/MM",
"yyyy.MM.dd", "yyyy.MM.dd HH:mm:ss", "yyyy.MM.dd HH:mm", "yyyy.MM"};
自定义数据的转换器,如何建立,请三阶段学习完之后,再做扩展!
_______________________________________________________________________________________
介绍@ModelAttribute注解方式介绍[ 星期五 21:36]
1.模拟情景,更新操作,如下图:
这情景模式,就产生如下的模拟代码:
JSP页面代码:&h2&用户更新&/h2&
action="user/update"
method="post"&
type="hidden"
name="_method"
value="put"&
type="text"
name="account"
value="wukong"&
type="text"
name="user_id"
value="1000"&
type="submit"
value="用户更新"&
持久化类代码,省略getter和setter
class User {
private Integer user_id;
private String user_name;
private String account;
private String password;
package com.shxt.
import org.springframework.stereotype.C
import org.springframework.web.bind.WebDataB
import org.springframework.web.bind.annotation.InitB
org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestM
import org.springframework.web.bind.annotation.RequestM
import org.springframework.web.servlet.ModelAndV
import com.shxt.model.U
@Controller
class UserController {
@RequestMapping(value="/user/update",method=RequestMethod.PUT)
public ModelAndView update(User user){
System.out.println(user);
@RequestMapping("/shxt")
public ModelAndView test01(){
System.out.println("哈哈哈");
@ModelAttribute
void init2(){
System.out.println("******");
@ModelAttribute
void init1(Integer user_id){
System.out.println("======"+user_id);
@InitBinder//想想这个使用规则?
void数据(WebDataBinder binder){
System.out.println("四海兴唐");
问题:在控制台输出的结果是什么?&
那么我们已经搞定了上面的代码,下面我们来进行改造,代码如下:
package com.shxt.
import java.util.M
import org.springframework.stereotype.C
import org.springframework.web.bind.annotation.ModelA
import org.springframework.web.bind.annotation.RequestM
import org.springframework.web.bind.annotation.RequestM
import org.springframework.web.servlet.ModelAndV
import com.shxt.model.U
@Controller
class UserController {
@RequestMapping(value="/user/update",method=RequestMethod.PUT)
public ModelAndView update(@ModelAttribute(value="user_data")User user){
System.out.println(user);
@RequestMapping("/shxt")
public ModelAndView test01(){
System.out.println("哈哈哈");
@ModelAttribute
void init2(){
System.out.println("******");
@ModelAttribute
void init1(Integer user_id,Map&String,Object& map){
//System.out.println("======"+user_id);
if(user_id!=null){
//查询数据库,模拟通过主键查询数据库操作
System.out.println("我进来了");
User user = new User();
user.setUser_id(1000);
user.setAccount("wukong");
user.setPassword("123456");
user.setUser_name("悟空");
map.put("user_data",user);
看看跟之前的测试结果又什么不同!
&文档下载地址: &/cq2cam4zVjZaw &访问密码 fb28
胖先生的微信
感觉该文章对你有所帮助,请点击下方推荐&&&&&&&&&&您的支持是我最大的动力,该资料推荐给四海兴唐的各位同学,希望你们工作顺利,不管何时何地,能帮助你们是胖先生的荣幸!&
阅读(...) 评论()<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
您的访问请求被拒绝 403 Forbidden - ITeye技术社区
您的访问请求被拒绝
亲爱的会员,您的IP地址所在网段被ITeye拒绝服务,这可能是以下两种情况导致:
一、您所在的网段内有网络爬虫大量抓取ITeye网页,为保证其他人流畅的访问ITeye,该网段被ITeye拒绝
二、您通过某个代理服务器访问ITeye网站,该代理服务器被网络爬虫利用,大量抓取ITeye网页
请您点击按钮解除封锁&Spring框架(3)
标注在方法上
@ModelAttribute标注在方法上时表明这个方法是用于给Model模型添加一个或多个属性。
标注了@ModelAttribute的方法会在访问@RequestMapping方法前先执行(同一个类中),这个方法通常用于参加通用的属性。
一个类中可以有任意个@ModelAttribute标注的方法,它们都会在这个类的@RequestMapping方法前执行
@ModelAttribute
public Version getVersion(){
return new Version();
@RequestMapping("/one")
public String show(){
return "testmodelattr";
testmodelattr.jsp:
&%@ page language="java" contentType="text/ charset=UTF-8"
pageEncoding="UTF-8"%&
&!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&
http-equiv="Content-Type" content="text/ charset=UTF-8"&
&Insert title here&
& ${version } &
这样,当我们访问/one时,标注了@ModelAttribute的getVersion方法会被执行,上面这种写法会以(“返回类型(首字母小写)”,“返回值”)的形式添加一个属性在Model中,效果等同于在@RequestMapping为Model装配了一个属性,在这里向Model中添加了(“version”, new Version()).于是我们在testmodelattr.jsp可以得到version属性的值。
我们也可以显示的设定属性的名称,在@ModelAttribute添加value属性:@ModelAttribute(“myversion”).这样,在jsp中就可以通过$(myversion)访问。
也可以直接在标注了@ModelAttribute的方法上添加一个Model参数,直接为这个参数添加属性和值。也可以达到同样的效果,并且可以配置多个属性。
@ModelAttribute
public void populateModel(@RequestParam String number, Model model) {
model.addAttribute(accountManager.findAccount(number));//没有指定名称默认为类型名,首字母小写
model.addAttribute("modelname", value);
// add more ...
标注了@ModelAttribute的方法同时也可以标注@RequestMapping方法,只此时方法的返回值将不是解析成视图,而是Model的属性值。视图名将会通过RequestToViewNameTranslator解析。
标注在方法参数上
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:611次
排名:千里之外
原创:16篇spring mcv(11)
先看一下,spring官方给的解释:
@ModelAttribute has two usage scenarios in controllers. When you place it on a method parameter, @ModelAttribute maps a model
attribute to the specific, annotated method parameter (see the processSubmit() method below). This is how the controller gets a reference to the object holding the data entered in the form.&
You can also use @ModelAttribute at the method level to provide reference data for the model (see the populatePetTypes() method
in the following example). For this usage the method signature can contain the same types as documented previously for the @RequestMapping annotation.&
@ModelAttribute annotated methods are executed before the chosen @RequestMapping annotated handler method. They effectively pre-populate
the implicit model with specific attributes, often loaded from a database. Such an attribute can then already be accessed through @ModelAttribute annotated handler method parameters in the chosen handler method, potentially with binding and validation applied
模式一(作用于方法上)
@ModelAttribute(value=&user&)
public Employee initUser(HttpServletRequest request){
return getSesionUser(request);
}这种情况下,你调用任何一个它所在的类中的链接,即@requestMapping方法的时候都会首先执行这个方法,并且返回对象,对象的标签就是该注解的value,这边就是&user&.这样你在jsp页面中就可以使用这个user对象。使用方法就是${user.usercode}
遇到的问题,一些其他的类继承这个类,所以在调用它们里面的链接的时候都会调用一次这个链接,可是有个类的调用是不需要登录的,所以获取不到session,这个时候就会报错,可是这个类的业务本身是不需要session的,所以在用这个属性的时候主要使用场景。
模式二(作用在方法属性上)
@RequestMapping(value=&/{userCode}/newRegular&)
public String newRegular(@ModelAttribute(value=&user&)Model model,
@PathVariable(value=&userCode&)int userCode)
ep = getSesionUser(request);
if(!employeeService.checkEmployee(userCode,ep.getCompanyObject())){
return error_new(model,&对不起,无此员工信息,请联系管理员&);
if (ep.checkPrivilege(Constants.CHANGES_ADD)) {
processRequest(userCode, model, EmployeeChangeRecords.CHANGE_TYPE_REGULAR);
return &/changes/newRegular&;
return errorNoPrivilege(model);
}在方法上面使用,则对应的jsp页面操作完后返回的参数自动匹配到命名user对象上面。参考的例子如下:
Java代码&&
package&org.liukai.tutorial.&&
import&java.util.ArrayL&&
import&java.util.L&&
import&javax.annotation.R&&
import&org.apache.log4j.L&&
import&org.liukai.tutorial.domain.P&&
import&org.liukai.tutorial.service.PersonS&&
import&org.springframework.stereotype.C&&
import&org.springframework.ui.M&&
import&org.springframework.web.bind.annotation.ModelA&&
import&org.springframework.web.bind.annotation.PathV&&
import&org.springframework.web.bind.annotation.RequestM&&
import&org.springframework.web.bind.annotation.RequestM&&
@Controller&&
@RequestMapping(&/main&)&&
public&class&MainController&{&&
&&&&protected&static&Logger&logger&=&Logger.getLogger(&controller&);&&
&&&&@Resource(name&=&&personService&)&&
&&&&private&PersonService&personS&&
&&&&@ModelAttribute(&persons&)&&
&&&&public&List&Person&&getAllPersons()&{&&
&&&&&&&&logger.debug(&Retrieving&all&persons&and&adding&it&to&ModelAttribute&);&&
&&&&&&&&&&
&&&&&&&&return&personService.getAll();&&
&&&&@ModelAttribute(&currencies&)&&
&&&&public&List&String&&getAllCurrencies()&{&&
&&&&&&&&logger.debug(&Retrieving&all&currencies&and&adding&it&to&ModelAttribute&);&&
&&&&&&&&&&
&&&&&&&&List&String&&currencies&=&new&ArrayList&String&();&&
&&&&&&&&currencies.add(&Dollar&);&&
&&&&&&&&currencies.add(&Yen&);&&
&&&&&&&&currencies.add(&Pound&);&&
&&&&&&&&currencies.add(&Euro&);&&
&&&&&&&&currencies.add(&Dinar&);&&
&&&&&&&&return&&&
&&&&@RequestMapping(method&=&RequestMethod.GET)&&
&&&&public&String&getAllPage(Model&model)&{&&
&&&&&&&&logger.debug(&Received&request&to&show&all&persons&page&);&&
&&&&&&&&&&
&&&&&&&&&&
&&&&&&&&&&
&&&&&&&&&&
&&&&&&&&return&&personspage&;&&
&&&&@RequestMapping(value&=&&/edit/{id}&,&method&=&RequestMethod.GET)&&
&&&&public&String&getEdit(@PathVariable&Integer&id,&Model&model)&{&&
&&&&&&&&logger.debug(&Received&request&to&show&edit&page&);&&
&&&&&&&&model.addAttribute(&personAttribute&,&personService.get(id));&&
&&&&&&&&&&
&&&&&&&&return&&editpage&;&&
&&&&@RequestMapping(value&=&&/edit/{id}&,&method&=&RequestMethod.POST)&&
&&&&public&String&saveEdit(@ModelAttribute(&personAttribute&)&Person&person,&&
&&&&&&&&&&&&@PathVariable&Integer&id,&Model&model)&{&&
&&&&&&&&logger.debug(&Received&request&to&update&person&);&&
&&&&&&&&&&
&&&&&&&&&&
&&&&&&&&person.setId(id);&&
&&&&&&&&&&
&&&&&&&&personService.edit(person);&&
&&&&&&&&&&
&&&&&&&&model.addAttribute(&persons&,&personService.getAll());&&
&&&&&&&&&&
&&&&&&&&return&&personspage&;&&
这个controller里定义了两个method级别的@ModelAttribute方法:getAllPersons和getAllCurrencies&
我们已经了解了他们的用法和意义.&
然后在saveEdit方法中,有个一个参数是用@ModelAttribute注解的.&
Java代码&&
@RequestMapping(value&=&&/edit/{id}&,&method&=&RequestMethod.POST)&&
&&&&public&String&saveEdit(@ModelAttribute(&personAttribute&)&Person&person,&&&
&&&&&&@PathVariable&Integer&id,&Model&model)&{&&
表示从JSP 页面返回的一个叫&personAttribute&的&#20540;.并自动的转化为Person对象.&
这样和以前我们用的request.getParameters(&personAttribute&)效果一样.&
但是一个是操作参数对象.一个是处理请求.两者的实现思想不同.&
在此controller中我们有3个映射:&
/main& - 检索所有的Person&
/main/edit/{id} - (GET)根据ID进行检索和edit&
/main/edit/{id} - (POST) 根据ID进行更新&
注:后两者的URL虽然一样,&
但一个是GET方法,一般用于检索.&
一个是POST方法,一般用于提交表单.&
如果大家有注意@RequestMapping中的method方法其实有四种.&
每个方法对应一个逻辑操作.对于REST风&#26684;的编程是一个相当好的补充.&
关于这点感兴趣的同学可以看看springsource一篇官方BLOG:&
让我们继续完成其他的JSP&
personspage.jsp&
&%@&taglib&uri=&/jsp/jstl/core&&prefix=&c&&%&&&
&%@&page&language=&java&&contentType=&text/&charset=UTF-8&&&
&&&&pageEncoding=&UTF-8&%&&&
&!DOCTYPE&html&PUBLIC&&-//W3C//DTD&HTML&4.01&Transitional//EN&&&http://www.w3.org/TR/html4/loose.dtd&&&&
&meta&http-equiv=&Content-Type&&content=&text/&charset=UTF-8&&&&
&title&Insert&title&here&/title&&&
&h1&Persons&/h1&&&
&&&&&tr&&&
&&&&&&&&&td&width=&50&&Id&/td&&&
&&&&&&&&&td&width=&150&&First&Name&/td&&&
&&&&&&&&&td&width=&150&&Last&Name&/td&&&
&&&&&&&&&td&width=&100&&Money&/td&&&
&&&&&&&&&td&width=&50&&Currency&/td&&&
&&&&&/tr&&&
&&&&&c:forEach&items=&${persons}&&var=&person&&&&
&&&&&&&&&tr&&&
&&&&&&&&&&&&&td&&c:out&value=&${person.id}&&/&&/td&&&
&&&&&&&&&&&&&td&&c:out&value=&${person.firstName}&&/&&/td&&&
&&&&&&&&&&&&&td&&c:out&value=&${person.lastName}&&/&&/td&&&
&&&&&&&&&&&&&td&&c:out&value=&${person.money}&&/&&/td&&&
&&&&&&&&&&&&&td&&c:out&value=&${person.currency}&&/&&/td&&&
&&&&&&&&&/tr&&&
&&&&&/c:forEach&&&
&/table&&&
这个主要是映射 /main.&
editpage.jsp&
&%@&taglib&uri=&/jsp/jstl/core&&prefix=&c&&%&&&
&%@&taglib&uri=&http://www.springframework.org/tags/form&&prefix=&form&&%&&&
&%@&page&language=&java&&contentType=&text/&charset=UTF-8&&&
&&&&pageEncoding=&UTF-8&%&&&
&!DOCTYPE&html&PUBLIC&&-//W3C//DTD&HTML&4.01&Transitional//EN&&&http://www.w3.org/TR/html4/loose.dtd&&&&
&meta&http-equiv=&Content-Type&&content=&text/&charset=UTF-8&&&&
&title&Insert&title&here&/title&&&
&h1&Edit&Person&/h1&&&
&c:url&var=&saveUrl&&value=&/main/edit/${personAttribute.id}&&/&&&
&form:form&modelAttribute=&personAttribute&&method=&POST&&action=&${saveUrl}&&&&
&&&&&table&&&
&&&&&&&&&tr&&&
&&&&&&&&&&&&&td&&form:label&path=&id&&Id:&/form:label&&/td&&&
&&&&&&&&&&&&&td&&form:input&path=&id&&disabled=&true&/&&/td&&&
&&&&&&&&&/tr&&&
&&&&&&&&&tr&&&
&&&&&&&&&&&&&td&&form:label&path=&firstName&&First&Name:&/form:label&&/td&&&
&&&&&&&&&&&&&td&&form:input&path=&firstName&/&&/td&&&
&&&&&&&&&/tr&&&
&&&&&&&&&tr&&&
&&&&&&&&&&&&&td&&form:label&path=&lastName&&Last&Name&/form:label&&/td&&&
&&&&&&&&&&&&&td&&form:input&path=&lastName&/&&/td&&&
&&&&&&&&&/tr&&&
&&&&&&&&&&
&&&&&&&&&tr&&&
&&&&&&&&&&&&&td&&form:label&path=&money&&Money&/form:label&&/td&&&
&&&&&&&&&&&&&td&&form:input&path=&money&/&&/td&&&
&&&&&&&&&/tr&&&
&&&&&&&&&&
&&&&&&&&&tr&&&
&&&&&&&&&&&&&td&&form:label&path=&currency&&Currency:&/form:label&&/td&&&
&&&&&&&&&&&&&td&&form:select&path=&currency&&&items=&${currencies}&/&&/td&&&
&&&&&&&&&/tr&&&
&&&&&/table&&&
&&&&&input&type=&submit&&value=&Save&&/&&&
&/form:form&&&
此页面返回以下controller中的方法:&
Java代码&&
@RequestMapping(value&=&&/edit/{id}&,&method&=&RequestMethod.GET)&&
&&&&public&String&getEdit(@PathVariable&Integer&id,&Model&model)&{&&
我们可以通过类&#20284;&
的链接进行编辑.&
下面是编辑页面&
当我们编辑完提交表&#26684;,执行了下面的方法&
Java代码&&
&&@RequestMapping(value&=&&/edit/{id}&,&method&=&RequestMethod.POST)&&
&&&&public&String&saveEdit(@ModelAttribute(&personAttribute&)&Person&person,&&&
&&&&&&@PathVariable&Integer&id,&Model&model)&{&&
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:39088次
积分:1658
积分:1658
排名:第16940名
原创:122篇
转载:74篇
(1)(2)(5)(23)(33)(7)(6)(3)(14)(38)(14)(11)(11)(13)(14)(1)}

我要回帖

更多关于 modelattribute 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信