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

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

    Hi,
    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:
    Code:
    		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
    org.springframework.web.servlet.support.BindStatus .<init>(BindStatus.java:135)
    org.springframework.web.servlet.support.RequestCon text.getBindStatus(RequestContext.java:655)
    be.arafox.gedeon.web.mvc.archives.fileUpload.Uploa dFileController.onSubmit(UploadFileController.java :122)
    org.springframework.web.servlet.mvc.SimpleFormCont roller.processFormSubmission(SimpleFormController. java:248)
    org.springframework.web.servlet.mvc.AbstractFormCo ntroller.handleRequestInternal(AbstractFormControl ler.java:243)
    org.springframework.web.servlet.mvc.AbstractContro ller.handleRequest(AbstractController.java:128)
    org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda pter.java:44)
    org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:684)
    org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:625)
    org.springframework.web.servlet.FrameworkServlet.s erviceWrapper(FrameworkServlet.java:386)
    org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:355)
    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
    Code:
    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;;
    
    			&#125;
    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
Working...
X