• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

date display except those are sunday

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<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
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
arjun rampal
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
solved boss thank you very much.
 
arjun rampal
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
solved boss thank you very much.
 
Without deviation from the norm, progress is not possible - Zappa. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic