File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes the . character in context-param names Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply locked New topic

the . character in context-param names

Jacob Fenwick
Ranch Hand

Joined: Apr 28, 2006
Posts: 55
Someone created a context-param in the web.xml file with a param-name with a name of app.version. When I try to use ${}, it won't let me access it, but if I go in and change the . to and _, it works. Is there a way around needing to change the variable name?

Is there a specific for web.xml somewhere that specifies that you can't use . in param-name's that I could point to so I can enforce this standard?
Carol Enderlin
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
Have you tried


instead of:


It works for me with parameter name = x.check
doesn't work: ${param.x.check}
works: ${param["x.check"]}
Deepan Devadasan
Ranch Hand

Joined: Jan 25, 2007
Posts: 226
Carol, you are correct..

This is a simple trick in using, EL
[ February 03, 2007: Message edited by: Bear Bibeault ]

Theepan Thevathasan
SCJP 1.4, SCWCD 1.4, SCMAD 1.0 SCBCD 1.3, MCP(.Net Frm 2.0 App Dev Fdn)
I agree. Here's the link:
subject: the . character in context-param names
It's not a secret anymore!