0

Spring MVC を Spring Roo と一緒に使用し、エンティティの 1 つに JPA ファインダーを追加しました。次のように @RooWebScaffold と @RooWebFinder アノテーションもあります。

@RooWebScaffold(path = "plis", formBackingObject = Pli.class)
@RooWebFinder

JPA ファインダーの 1 つは java.util.Date を使用し、@RooWebFinder を実行すると、コンソールで次の例外が体系的に発生し、404 にリダイレクトされます。

2012-07-13 14:13:31,515 ["http-bio-8131"-exec-16] DEBUG org.springframework.web.servlet.mvc.support.DefaultHandlerExceptionResolver - Resolving exception from handler [public java.lang.String trc.suivi.controller.PliController.findPlisByIdentifiantLikeAndDateReceptionBetweenAndPaiementAndARAndNumeroARLikeAndFDVAndConteneurNumAndStatut(java.lang.String,java.util.Date,java.util.Date,java.lang.Boolean,java.lang.Boolean,java.lang.String,java.lang.Boolean,trc.suivi.domain.ConteneurNum,trc.suivi.domain.StatutPli,org.springframework.ui.Model)]: org.springframework.beans.TypeMismatchException: Failed to convert value of type 'java.lang.String' to required type 'java.util.Date'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type java.lang.String to type @org.springframework.web.bind.annotation.RequestParam @org.springframework.format.annotation.DateTimeFormat java.util.Date for value '2012-07-04'; nested exception is java.lang.IllegalArgumentException: Invalid format: "2012-07-04" is malformed at "12-07-04"

私は何を見逃していますか?

4

1 に答える 1

1

指定した日付の形式が間違っていたようです: 無効な形式: "2012-07-04" is malformed at "12-07-04"

エンティティ オブジェクトのフィールドの日付形式は何ですか?

2 年の日付を試すことができます。

于 2012-09-04T20:36:52.840 に答える