This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Access to constants

 
Mallika Kumar
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
This is what I want to achieve. I have few constants declared in a jsp file, which I want to make use of in a servlet. There is a way of calling a jsp file in a servlet, but I would like to know if there are other solutions to this. What if I can define an interface and implement that interface in the servlet? What are the pros and cons of this ? And what if I have a class which declares these constant vlaues, and import in into the servlet ? What are the benefits or disadvantages of doing this ?
Classes and interfaces, when changed, will need to be recompiled, and so should other dependent files too. Is there a way where we can declare constants, and if the change, they and other dependencies are recompiled as necessary ?
Any feedback will be very helpful.
Thanks.
 
Shama Khan
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have few constants declared in a jsp file,

why not declare them in the servlet and access them from the jsp (if needed)

What if I can define an interface and implement that interface in the servlet? What are the pros and cons of this ? And what if I have a class which declares these constant vlaues, and import in into the servlet ? What are the benefits or disadvantages of doing this ?

I would say that's the best way to do it. And I would recompile only the files that get affected.
Shama

[This message has been edited by Shama Khan (edited March 21, 2001).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic