1. 在使用jstl时不需要导入jstl,jsp 和servlet的包,而且需要在jsp的头部加上isElIgnored这个参数[quote]<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>[/quote]。
2.使用spring的form tag时会报“org.springframework.web.servlet.tags.RequestContextAwareTag doStartTag: access denied (java.lang.RuntimePermission getClassLoader)”的错误。解决的办法是加入以下代码到你的controller中
你也可以使用全局性的注册:加入下面代码到spring xml中
[quote] <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="webBindingInitializer">
<bean class="com.xtremeprog.iphone.web.AppBindingInitializer"/>
</property>
</bean>[/quote]
AppBindingInitializer.java
Reference:[url]http://www.cancunmods.com/principal/content/how-use-spring-tags-google-app-engine[/url]
2.使用spring的form tag时会报“org.springframework.web.servlet.tags.RequestContextAwareTag doStartTag: access denied (java.lang.RuntimePermission getClassLoader)”的错误。解决的办法是加入以下代码到你的controller中
@Override
protected void initBinder(HttpServletRequest request,
ServletRequestDataBinder binder) throws Exception {
binder.registerCustomEditor(String.class,
new StringTrimmerEditor(false));
}
你也可以使用全局性的注册:加入下面代码到spring xml中
[quote] <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<property name="webBindingInitializer">
<bean class="com.xtremeprog.iphone.web.AppBindingInitializer"/>
</property>
</bean>[/quote]
AppBindingInitializer.java
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:[url]http://www.cancunmods.com/principal/content/how-use-spring-tags-google-app-engine[/url]