首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

在google appengine中使用Spring mvc 3.0中遇到的有关问题

2012-10-28 
在google appengine中使用Spring mvc 3.0中遇到的问题1. 在使用jstl时不需要导入jstl,jsp 和servlet的包,

在google appengine中使用Spring mvc 3.0中遇到的问题
1. 在使用jstl时不需要导入jstl,jsp 和servlet的包,而且需要在jsp的头部加上isElIgnored这个参数。

2.使用spring的form tag时会报“org.springframework.web.servlet.tags.RequestContextAwareTag doStartTag: access denied (java.lang.RuntimePermission getClassLoader)”的错误。解决的办法是加入以下代码到你的controller中

@Overrideprotected void initBinder(HttpServletRequest request,ServletRequestDataBinder binder) throws Exception {binder.registerCustomEditor(String.class,new StringTrimmerEditor(false));}


你也可以使用全局性的注册:加入下面代码到spring xml中

package com.xtremeprog.iphone.web;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.beans.propertyeditors.CustomDateEditor;import org.springframework.beans.propertyeditors.StringTrimmerEditor;import org.springframework.web.bind.WebDataBinder;import org.springframework.web.bind.support.WebBindingInitializer;import org.springframework.web.context.request.WebRequest;import java.text.SimpleDateFormat;import java.util.Date;public class AppBindingInitializer implements WebBindingInitializer {public void initBinder(WebDataBinder binder, WebRequest request) {binder.registerCustomEditor(String.class, new StringTrimmerEditor(false));}}


Reference:http://www.cancunmods.com/principal/content/how-use-spring-tags-google-app-engine 1 楼 kingdu_12 2009-12-02   呵呵,我也遇到过相同的问题。
特别是第二个,一度准备放弃使用Spring的标签。后来发现使用common-Validator验证框架的时候,取错误信息相当麻烦,不得不使用标签。 2 楼 elvea 2009-12-02   第二个问题最好就是把Long,Date.....这些类型都注册一遍,不然有的忙。

热点排行