aspose file tools*
The moose likes Struts and the fly likes date display except those are sunday Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "date display except those are sunday" Watch "date display except those are sunday" New topic
Author

date display except those are sunday

arjun rampal
Ranch Hand

Joined: Jul 08, 2005
Posts: 125
<bean:write name="peter" property="tDate" >
Hi I am displaying the dates from database using above tag.
Now the problem is I dont need to display the dates which are sundays
so let me know how to do this
thanxs in advance
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Just add a method to your ActionForm like this:


Then in your jsp:

<logic:equal name="peter" property="dateSunday" value="false" >
<bean:write name="peter" property="tDate" >
</logic:equal>
[ August 09, 2006: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
arjun rampal
Ranch Hand

Joined: Jul 08, 2005
Posts: 125
thanxs but problem is .There is no form involved here.Here date is coming from database only through some query.
now let me know how to do this
arjun rampal
Ranch Hand

Joined: Jul 08, 2005
Posts: 125
Actually I am getting dates from database directly .No actionform is involded.
I have access to only jsp page and in that follwoing code

<bean:write name="peter" property="tDate" >

even i tried to put the java code in jsp file but getting error on this line

property="dateSunday" as there is no getter method for this in bean.even though there is getter method for tdate
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
A Struts application, written the way the authors of the framework recommend always uses an ActionForm.

If you're going to use Struts as your framework, I'd recommend that you modify your application so that it does use an ActionForm bean. Otherwise, most of the framework is going to be useless to you.

If you're new to Struts and don't understand the relationship of ActionForms, Action classes and Struts tags in your JSP, I'd recommend you do one or two of the tutorials in this link

If you simply can't or won't make this modification to your application, at least use some sort of JavaBean. It looks like you already have a JavaBean named "peter". Just add the isDateSunday method to that JavaBean.
[ August 09, 2006: Message edited by: Merrill Higginson ]
arjun rampal
Ranch Hand

Joined: Jul 08, 2005
Posts: 125
added but getting this

[Servlet Error]-[End of content reached while more parsing required: tag nesting error?]: org.apache.jasper.compiler.ParseException: End of content reached while more parsing required: tag nesting error?
arjun rampal
Ranch Hand

Joined: Jul 08, 2005
Posts: 125
solved boss thank you very much.
arjun rampal
Ranch Hand

Joined: Jul 08, 2005
Posts: 125
solved boss thank you very much.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: date display except those are sunday