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

Storing input labels in database

 
Ankit Mishra
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have one issue :

I have a form say for login and I have two fields login id and password. Now what I want is to save the labels attached to these fields in database. Can anyone help me regarding this how to fetch the associated lables from database.

I want some thing like below:

Example:

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankit,
Most people store these in a property file rather than a database.

If you do want to use a database, have you read anything about JDBC yet?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65337
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Jeanne mentioned, I'd use a properties file, and the <fmt:message> tag, like 99.999999% of everyone else out there.

If you insist on using a database (why?), I'd fetch the values in the page controller to pass to the JSP as a Map and use the EL from there. But I'd only do that if I had a really, really, really, really good reason to use a database over the more conventional properties files.
 
Ankit Mishra
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Thank you both of you for the resolution. I was thinking about the database, so that if I have to make any change I can directly change in the database. But there will be an additional overhead of data fetching.
Yes Jeanne I am aware of JDBC.

I was unaware of <fmt:message> tag. Thank you both of you for guidance
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic