• Post Reply Bookmark Topic Watch Topic
  • New Topic

compare names in JSP

 
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
Bartender
Posts: 6646
90
  • 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: 1827
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 ?

 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!