• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Avoiding hard-coded annotations such as below:

 
Ranch Hand
Posts: 384
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I would like to avoid the hard-coded annotation variable such as below:



Environment:
-J2ee 1.4 (web tier only, tomcat 5.5)
-J2se 5.0

I have a context param which is located in the web.xml and that I would like to use instead of the hard-coded name above.

Can anyone help?

Julien.
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It sounds like you would need to modify the code that currently processes the annotation. Read the annotation, then check for a property that might override it, and use one or the other to do... whatever you were going to do with the annotation in the first place. Does that help?

If you can't alter the code that processes the annotations, you might instead use some sort of bytecode engineering like BCEL or ASM to alter the .class file before it's loaded, changing the annotation. That's somewhat more complicated though, so I prefer the first option if possible.
[ June 17, 2007: Message edited by: Jim Yingst ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic