File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Applying logic tags for DATE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Applying logic tags for DATE" Watch "Applying logic tags for DATE" New topic

Applying logic tags for DATE

Shah Anwar

Joined: Jan 25, 2011
Posts: 2
Dear all,
Well it has been days looking around the net for the answer for this. I'm still new to struts and i hope someone can assist me.

Here is my target:
1) To apply logic for date that is retrieved from the bean.
2) Print conditional output based on the cut-over date, 01/01/2011 (DD/MM/YYYY)
3) The logic :- If detDate >= 01/01/2011, the line will print out: "Old rates". Else, the line will print out: "New rates".

Here is what i have tried:

Unfortunately the output does not print any text instead only blanks.

Would appreciates some advice. Thank you in advance.
srikanth arroju
Ranch Hand

Joined: Aug 02, 2006
Posts: 66
Dear Anwar ,

I have tried to compare directly from logic tag but not able to format the date .
so i have done the comparision in Action and displayed the rate in view.

Shah Anwar

Joined: Jan 25, 2011
Posts: 2
Thank you srikanth,

Unfortunately i don't have access to the java back-end side, were only given privilege to edit the .jsp files.

Therefore i've ended up with this javascript:

It seems to do the "make-up" work.
subject: Applying logic tags for DATE
Similar Threads
Solved: logic tag inside a logic tag : S1
Use logic:notEqual with form bean
Regarding Logic iterate
Struts tag to obtain size of a Collection
Accessing formbean