• 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

compare names in JSP

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How to compare day name with table column name in jsp?
 
Saloon Keeper
Posts: 15510
363
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to CodeRanch, Shivani!

You shouldn't do any logic in JSPs. Perform your logic in a Servlet, and prepare all data for the JSP there, ready to display.
 
Ranch Hand
Posts: 35
1
jQuery Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can use if condition of jstl core taglib to compare your day name with that of your table column name. There's another way which will work pretty well. Take day name from the user and pass it on to Servlet, compare it with your table column name and then get the result to display using your JSP. That's it :)
 
Bartender
Posts: 1845
10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are we talking a database table column name, or an html table column name?


I can see a use case for a timetable/calendar which highlights the current day - which would be a view layer operation
Steps
- Work out what day it is (Calendar / Date classes maybe?)

How do you know what the column names are to compare to ?

 
reply
    Bookmark Topic Watch Topic
  • New Topic