美文网首页
Spring排坑

Spring排坑

作者: DerrickWang | 来源:发表于2018-06-01 16:51 被阅读0次

总结一些前人踩过的雷
后续可以深入分析一下

  • spring mvc 对于返回 void的方法会调用默认的视图解析器

这个好像也不是坑,就是简单布尔类型的属性命名不能is打头,但是POJO的命名规范好像说了这个 后续跟一下具体规范 以及原因
还有属性名的第一个单词如果是一个字母也容易出问题,比如bPin cPin,猛爷说好像解析的时候会吧前两个都大写来着 后续跟一下

Javabean 规范(下载链接:http://download.oracle.com/otndocs/jcp/7224-javabeans-1.01-fr-spec-oth-JSpec/ ) 在8.3 章节"Design Patterns for Properties" 中的描述
8.3.2 Boolean properties
In addition, for boolean properties,we allow a getter method to match the pattern:
public boolean is<PropertyName>();
This “is<PropertyName>” method may be provided instead of a “get<PropertyName>” method,
or it may be provided in addition to a “get<PropertyName>” method.
In either case, if the “is<PropertyName>” method is present for a boolean property then we will use the “is<PropertyName>” method to read the property value.
An example boolean property might be:
public boolean isMarsupial();
public void setMarsupial(boolean m);

相关文章

网友评论

      本文标题:Spring排坑

      本文链接:https://www.haomeiwen.com/subject/qieksftx.html