Yep, you are clear.
I believe (and other ranchers please correct me if I am wrong) that the reason the value does not change for you is because when the JSP is being compiled, it is simply inserting the actual value of this variable into the generated
servlet code itself. As an example, if Constants.XXX_ROLE_ADM_ID is set to "Hello" in the Constants class, the generated java file would look like this:
This is assuming that the value is a public static final variable. Take a look at the generated java file and see what is says.
However, there is a better way to use an application wide variable, and it is checked with every request, so you won't run into this problem. You can set Context init parameters in your web.xml file that can be accessed by any jsp or servlet in your web application. Here is an example:
Now you can access it in your JSP through both scripting and EL (although I prefer EL):
Scripting:
EL (and JSTL):
Hope that helps!
“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook