Win a copy of Spark in Action this week in the Open Source Projects forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Possible to set an env-entry to null in my web.xml file?

 
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I'm using JBoss 5.1, Java 1.6 on Mac 10.5.6. I have a web application and I was wondering if it possible to set an env-entry to null? Currently I have this in my web.xml file ...



But with this set up, looking up "my.entry" in the context returns an empty string, and I would prefer it to return null. I also don't want to remove the env-entry because then I will get a NameNotFoundException if try and look up my.entry.

Thanks for any ideas you might have, - Dave
 
Marshal
Posts: 67414
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. Either deal with the empty string (how hard is it to test for the empty string and replace it with null if that's what you want?), or catch the exception and use it to set the value to null.
 
Dave Alvarado
Ranch Hand
Posts: 436
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would love to implement one of your suggestions but I'm dealing with code that is not my own and it requires that I get a null value in for the environment entry. I know this is a hard question, but is it possible to do what I'm asking? If not, just let me know.

Thanks, -
 
Bear Bibeault
Marshal
Posts: 67414
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See the first word of my reply.
 
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic