aspose file tools*
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
Author

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 ${initParam.app.version}, 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
drifter
Ranch Hand

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

${initParam["app.version"]}

instead of:

${initParam.app.version}

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)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: the . character in context-param names