Back Forum Reply New

BindException errors lost

Hi,

I have a Controller than extends the SimpleFormController.

I have then overridden the onSubmit method as shown below@Override  protected ModelAndView onSubmit ( fromServletRequest request, fromServletResponse response, Object command, BindException errors )

and within this method I am doing some validation..
When I detect a problem I am using the following code to add the error message to the BindException object and then attempt to display this error.
     errors.reject ( quot;group.assign.selection.invalidquot;);     //redisplay form with error message     return showForm ( request, response, errors );

group.assign.selection.invalid is defined in my messages.properties file, I have tried alternates but no noy.
In my jsp I am then binding on status.* and attempting to display the error messages that should be contained in status.errorMessages.

lt;c:if test=quot;${!empty filter}quot;gt; lt;spring:bind path=quot;filter.*quot;gt;   lt;c:forEach items=quot;${status.errorMessages}quot; var=quot;msgquot;gt;     lt;cut value=quot;${msg}quot; /gt;   lt;/c:forEachgt; lt;/spring:bindgt;
lt;/c:ifgt;

However, in my case the status.errorMessages is always empty ( I have added some debugging checks to the jsp). Now this *was* working for me a while back but has since stopped working.

Does anyone have any ideas why or any help in debugging this problem. Banging my head against a wall here..
Cheers
Mi3e.

It seems to be something to do with my build.

Another developer who is working on the project and has exactly the same environment builds a war in his system and he can see the error messages.

We're both using the same source control system, maven2 for builds and tomcat 5.5 .. I've tried using both firefox and IE and both exibit the same behaviour.

Its bizarre.

Problem fixed.

I got the .war for the same build from another developers machine and it worked fine so i examined the contents. In his WEB-INF\lib there was spring-2.0.jar along with a lot of the subjars such as spring-core-2.0.jar whereas within mine there was only the component jars. We were both using different maven2 repositories and when i switched to use his i also picked up the spring-2.0.jar and all worked fine.

So, i am reworking the .poms to find out what is pulling in the quot;top levelquot; spring-2.0.jar, try to rework is so we don't and also get all the required dependencies..

So it has turned out to be a maven2 and dependency problem rather than a spring problerm per se. Still don't really understand how i was able to build and deploy without all the required dependencies but that may come to light in the next day or so.

Regards,
Mi3e.
¥
Back Forum Reply New