The moose likes Java in General and the fly likes date validations Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "date validations" Watch "date validations" New topic

date validations

Devapatla Ramagopal Reddy

Joined: Aug 14, 2001
Posts: 5
In my application the user selects the ToDate and FromDate fromcombobox.I can able to capture those values as inters in my java program,now i would like to do some validations:
1.ToDate should be less than or equal to CurrentDate.
2.ToDate should be greater than or equal to FromDate.
3.Date Range is limited to 45 days only(parameterized).
I need to develop business rule for the aboue validation.can u give some idea...Thanks.
Amit Agrawal
Ranch Hand

Joined: Aug 23, 2001
Posts: 282
can you please let me know what is your user interface ? is it html (may be genrated by jsp) or AWT/Swing ?
In case its HTML this would be better to do in javascript or if it is AWT there are methods like before() and after() in Date class..you may use them.
Devapatla Ramagopal Reddy

Joined: Aug 14, 2001
Posts: 5
Hi Amit,
thax a lot fo rur reply..
My user interface is HTML(generated by jsp), but the client wants to develop it as business object, anyway i just completed the application.
once again thanx a lot..
Roger Wang

Joined: Sep 13, 2001
Posts: 6
for html(jsp) or java UI I know the solution...
but sorry I don't know what is business object,
and how to finished your task as 'business object'?
anyone drop me a line?
Devapatla Ramagopal Reddy

Joined: Aug 14, 2001
Posts: 5
Hi wang,
thanx for ur reply..
Business object in the sense, we developed these as a EJB component.
Consider Paul's rocket mass heater.
subject: date validations
Similar Threads
date validation in java
How to get the Dates in-between two Dates
PartialTrigger with two inputDate does not work properly...
Compare two custom date input fields each having 3 inputText fields using validator
how to convert a string to date