Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 566727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T13:00:30+00:00 2026-05-13T13:00:30+00:00

I have specified <mvc:annotation-driven /> in dispatcher-servlet. I am not using @InitBinder. And I

  • 0

I have specified <mvc:annotation-driven /> in dispatcher-servlet.
I am not using @InitBinder.
And I am using @valid annotation for validation in controller’s method like

@RequestMapping(method = RequestMethod.POST, value = "new")
    public String save(@Valid Article article,ModelMap model) {
//code here
}

And validation works fine, but instead of showing error in ..
sample shown in html code

<tr>
         <td>Title</td>
         <td><form:input path="title"/></td>
         <td><form:errors path="title"/></td>
</tr>

It throws exception like..

org.springframework.web.util.NestedServletException:
Request processing failed; nested
exception is
org.springframework.validation.BindException:
org.springframework.validation.BeanPropertyBindingResult:
2 errors Field error in object
‘article’ on field ‘urlInfo.url’:
rejected value []; codes
[typeMismatch.article.urlInfo.url,typeMismatch.urlInfo.url,typeMismatch.url,typeMismatch.java.net.URL,typeMismatch];
arguments
[org.springframework.context.support.DefaultMessageSourceResolvable:
codes
[article.urlInfo.url,urlInfo.url];
arguments []; default message
[urlInfo.url]]; default message
[Failed to convert property value of
type ‘java.lang.String’ to required
type ‘java.net.URL’ for property
‘urlInfo.url’; nested exception is
org.springframework.core.convert.ConversionFailedException:
Unable to convert value from type
‘java.lang.String’ to type
‘java.net.URL’; nested exception is
org.springframework.core.convert.ConversionFailedException:
Unable to convert value from type
‘java.lang.String’ to type
‘java.net.URL’; nested exception is
java.lang.reflect.InvocationTargetException]
Field error in object ‘article’ on
field ‘title’: rejected value [];
codes
[Size.article.title,Size.title,Size.java.lang.String,Size];
arguments
[org.springframework.context.support.DefaultMessageSourceResolvable:
codes [article.title,title]; arguments
[]; default message
[title],{javax.validation.constraints.Size.message},6,[Ljava.lang.Class;@1db3aac,2147483647,[Ljava.lang.Class;@1e90abf];
default message [size must be between
6 and 2147483647]

 org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:659)
 org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:563)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
 javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
 org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)
 org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:213)
 org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:171)
 org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
 org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
 org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:381)
 org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:390)

How to configure it, to not throw an exception and instead return to page and show error messages…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T13:00:30+00:00Added an answer on May 13, 2026 at 1:00 pm

    You should explicitly decide what to do with validation errors:

    @RequestMapping(method = RequestMethod.POST, value = "new") 
    public String save(@Valid Article article, BindingResult result, ModelMap model) { 
        if (result.hasErrors())
            return "formView";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a method which should be delayed from running for a specified amount
Using Flex 3, I have a Button which is skinned using PNGs specified in
I have a basic model in which i have specified some of the fields
I use WiX3 to generate MSI installation package. I have specified comression flag on
I have a module that sends an email to a specified email address but
I have a (varchar) field Foo which can only be specified if (bit) Bar
We have a service that runs methods used for data import/export at specified intervals.
If you have a List how do you return the item if a specified
In tcsh , I have the following script working: #!/bin/tcsh setenv X_ROOT /some/specified/path setenv
My particular problem: I have a string which specifies an aribitrary type in a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.