If you're subclassing SimpleFormController, you can also override the
initBinder method in your custom classes directly. e.g.:
@Override
protected void initBinder(HttpServletRequest request,
ServletRequestDataBinder binder) throws Exception {
binder.registerCustomEditor(String.class, new StringTrimmerEditor(false));
binder.registerCustomEditor(Boolean.class, new
CustomBooleanEditor(false));
binder.registerCustomEditor(Long.class, new CustomNumberEditor(Long.class,
true));
}
- Jason
On Thu, Sep 10, 2009 at 5:00 AM, xueqiang.mi <[email protected]> wrote:
>
> Thanks.
> The problem I encountered is caused by the Spring form tag, I have
> fixed it.
> If you want to use form tag, you must override the initBinder method
> of WebBindingInitializer, otherwise you will get a error:
> org.springframework.web.servlet.tags.RequestContextAwareTag
> doStartTag: access denied (java.lang.RuntimePermission getClassLoader)
> java.security.AccessControlException: access denied
> (java.lang.RuntimePermission getClassLoader)
> ......
> Nested in org.springframework.web.util.NestedServletException: Request
> processing failed; nested exception is java.lang.ClassCastException:
> java.security.AccessControlException cannot be cast to
> javax.servlet.ServletException:
> java.lang.ClassCastException: java.security.AccessControlException
> cannot be cast to javax.servlet.ServletException
>
> You should write your own WebBindingInitializer class
> {code}
> public class TheFocusBindingInitializer implements
> WebBindingInitializer {
>
> @Override
> public void initBinder(WebDataBinder binder, WebRequest request) {
> binder.registerCustomEditor(String.class,
> new StringTrimmerEditor(false));
> }
> }
> {code}
> and then inject it into the AnnotationMethodHandlerAdapter by the
> following configuration:
> {xml}
> <bean
>
>
> class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
> <property name="webBindingInitializer">
> <bean
> class="com.appspot.thefocus.web.TheFocusBindingInitializer" />
> </property>
> </bean>
> {xml}
> On 9月10日, 下午4时13分, Loïc Talbot <[email protected]> wrote:
> > Hi,
> > I've tried successfully spring mvc with this tutorial (Flex, graniteDS,
> > springMVC) :
> http://graniteds.blogspot.com/2009/04/graniteds-20-on-google-app-engi...
> >
> > Moreover Spring MVC is compatible with GAE according to this :
> http://groups.google.com/group/google-appengine-java/web/will-it-play...
> >
> > You should find a more verbose and meaningful error in the console log
> > underhttps://appengine.google.com/
> > The stack trace should be there.
> >
> > Loïc
> >
> > 2009/9/10 xueqiang.mi <[email protected]>
> >
> >
> >
> >
> >
> > > Have anyone used Spring MVC framework on GAE? My project runs well on
> > > my pc, but after uploading on the GAE server, it doesn't work. A error
> > > comes out:
> >
> > > Error: Server Error
> >
> > > The server encountered an error and could not complete your request.
> > > If the problem persists, please report your problem and mention this
> > > error message and the query that caused it.
> >
> > >http://alloyer.appspot.com
> >
> > > Can anyone help me here?
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en
-~----------~----~----~----~------~----~------~--~---