Announcement Announcement Module
No announcement yet.
Bugs of Spring-1.2 and 1.2.1, please check them together Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bugs of Spring-1.2 and 1.2.1, please check them together

    You can check if the followingproblems are true in Spring-1.2 . If the case, we need to report them to Spring. But how to do that?

    First problem:
    I want to upgrade the actual Spring-1.0.2 of my application to Spring-1.2 or 1.2.1, in order to use the Spring macro which does not exist in Spring-1.0.2.
    I use formBackingObject method to initialize the form for the Velocity page. When I change a value from the field name "version" of the form, 2 to 4 for example,
    my UploadFileController(extends SimpleFormController implements InitializingBean) return 2,4. If I change to 10, the controller renders 2,4,10 and so on. That means the SimpleFormController returns a kind of concatenation of String.
    To be sure, I went back to Spring1.0.2, my UploadFileController returns 4. If I change to 10, it returns 10. There is no problem here in this version.

    Second problem:
    		RequestContext rc = new 	RequestContext(request);
    		BindStatus bind = rc.getBindStatus(getCommandName());
    The error when the form is submitted
    java.lang.IllegalStateException: Neither Errors instance nor plain target object for bean name 'fileForm' available as request attribute .<init>( text.getBindStatus(
    be.arafox.gedeon.web.mvc.archives.fileUpload.Uploa dFileController.onSubmit( :122)
    org.springframework.web.servlet.mvc.SimpleFormCont roller.processFormSubmission(SimpleFormController. java:248)
    org.springframework.web.servlet.mvc.AbstractFormCo ntroller.handleRequestInternal(AbstractFormControl
    org.springframework.web.servlet.mvc.AbstractContro ller.handleRequest(
    org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda
    org.springframework.web.servlet.DispatcherServlet. doDispatch(
    org.springframework.web.servlet.DispatcherServlet. doService(
    org.springframework.web.servlet.FrameworkServlet.s erviceWrapper(
    org.springframework.web.servlet.FrameworkServlet.d oPost(
    javax.servlet.http.HttpServlet.service(HttpServlet .java:709)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
    I had then a look on the code of BindStatus class of Spring
    Object target = requestContext.getModelObject&#40;beanName&#41;;
    			if &#40;target == null&#41; &#123;
    				throw new IllegalStateException&#40;"Neither Errors instance nor plain target object for bean name '" +
    						beanName + "' available as request attribute"&#41;;
    The reason I saw is that the BindStatus() constructor can not find the modelObject, which should be bound automatically by Spring to the request.
    It could be that I did not call the RequestContext correctly. In my UploadFileController, I call it inside the onSubmit method. Is it not correct or just a bug of Spring?. Please keep us informed about that.
    Thank you in advance for your advices