在spring里,model和form的对应不需要写xml文件,只需要在页面里用form这个taglib就可以了:
email
这里的commandName就是和Controller里相互映射的model的名字(实例名)
path=email指定了对应对象的属性。
Controller里可以这样写:
protected ModelAndView sendInvite(@ModelAttribute(“invite”) Invite invite,
BindingResult result, SessionStatus status, ModelMap model) {}
其中,参数的第一个invite会自动从form里生成一个Invite的实例并设置值,Controller里直接使用这个对象就可以。
而加上@SessionAttributes的话,可以在form里一直...
578 days前 / 0 次浏览阅读全文
Eclipse里提交代码的时候,提示:
org.tigris.subversion.javahl.ClientException: APR does not understand this error code
svn: Commit failed (details follow):
svn: Cannot accept non-LF line endings in ‘svn:log’ property
comment写了2行而已,查了下,网上有人说每行最后以空格结尾就行了,我试了下还是不行。
不要comment,提交成功。。。奇怪。
585 days前 / 0 次浏览阅读全文
在java里可以用:request.setCharacterEncoding(“UTF-8″);
在Spring的Controller类里个别设置太麻烦,可以用filter
<filter-name>Spring character encoding filter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>utf-8</param...
585 days前 / 0 次浏览阅读全文
随便看看
热门标签
adb
Android
android sdk google
bing
components
control
deb
debian
eclipse
ed
gconf
gconfd
gconftool
gconftool-2
google
hibernate
hprof
java
launchpad
leak
linux
memory
microsoft
ms
NO_PKG_MANGLE
package
pkgstriptranslations
ppa
rc.local
roma
Ruby
section
shell
sns
tech
ubuntu
vi
vim
wave
zenity
自动启动



最新评论