Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • 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
Pie
Posts: 6503
83
  • 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
Greenhorn
Posts: 28
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: 1807
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 ?

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic