• Post Reply Bookmark Topic Watch Topic
  • New Topic

compare names in JSP  RSS feed

 
Shivani Sinha
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to compare day name with table column name in jsp?
 
Stephan van Hulst
Saloon Keeper
Posts: 7190
118
  • Mark post as helpful
  • send pies
  • 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.
 
Nizamuddin Shaikh
Ranch Hand
Posts: 35
1
Java jQuery Oracle
  • Mark post as helpful
  • send pies
  • 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 :)
 
Stefan Evans
Bartender
Posts: 1834
10
  • Mark post as helpful
  • send pies
  • 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 ?

 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!