Kathir jeyap wrote:
I used the same code...However 500 error is returned and the page got redirected to the error page
I want the same page or window or dialog should be retained..
Dave Tolls wrote:
vipul John wrote:
What do you mean? My question is why parse() accepting extra input in the pattern? Is this functionality expected? I have set lenient to false. so that's strictly HH:mm should be accepted right.
Quoting from the documentation linked to by Campbell earlier, for the parse() method:
Parses text from the beginning of the given string to produce a date. The method may not use the entire text of the given string.
Campbell Ritchie wrote:I mean that it is unfortunate that you are constrained to use poor quality legacy code when much better code is available.
vipul John wrote:. . . What do you mean?Did you actually look at the documentation? As Dave Tolls points out, it is all in there.
My question is why parse() accepting extra input in the pattern? Is this functionality expected? . . .
Campbell Ritchie wrote:What a pity. The details of the parse() method appear not to have changed between Java7 and Java8.
vipul John wrote:. . . . I can not use Java 8 API time package, as one of the other projects has a dependency of Java 7. . . .
Campbell Ritchie wrote:What does the documentation for that method say? You are actually passing a valid time at the beginning of that text.
I think the wrong thing is using Date and DateFormat in the first place. Date is a dreadful class and it has been superseded by much better things which you can read about in the Java™ Tutorials.