Hi Ranchers, I am not able to get the <c:if> .. </c:if> tag working. I have a Context Parameter called IsApplicationInProductionMode. The idea of having this is to display debugging info or not. If IsApplicationInProductionMode has the value of 'false', I want to display some debugging info.
In one of the error page that catches all Exceptions thrown, I have the following code
<c:if test="${initParam.IsApplicationInProductionMode eq 'false'}" > Exception on the Server - ${pageContext.exception} </c:if>
Now the problem is - irrespective of the value in IsApplicationInProductionMode, the debugging info is always displayed. Ranchers, please let me know if I am missing some thing here.
try this - <c:if test="${initParam.IsApplicationInProductionMode eq false}" >
since false is a reserved word for EL, it shouldnt be in duble quotes had your IsApplicationInProductionMode been a String then your code would have had worked,
correct me if i am worng
SCJP 1.4 - 95% [ My Story ] - SCWCD 1.4 - 91% [ My Story ] Performance is a compulsion, not a option, if my existence is to be justified.
Sandeep Prabhakar
Ranch Hand
Joined: Dec 22, 2005
Posts: 59
posted
0
Even this does not work
The web.xml entry for this context parameter is
<context-param> <param-name>IsApplicationInProductionMode</param-name> <param-value>true</param-value> </context-param> I guess it treats IsApplicationInProductionMode as String.
Jayant Raj
Ranch Hand
Joined: Mar 11, 2004
Posts: 42
posted
0
try this - <c:if test="${initParam.IsApplicationInProductionMode == 'false'}" >
Even <c:if test="${initParam.IsApplicationInProductionMode == 'false'}" >
does not work.
Jayant Raj
Ranch Hand
Joined: Mar 11, 2004
Posts: 42
posted
0
it works..... i made a couple of changes to an existing web application...
1] added this to the web.xml :
2] added this on a jsp :
when the value is true in web.xml, I get the javascript prompt... it should work in your case too...
try printing out the parameter in your jsp first...
Sandeep Prabhakar
Ranch Hand
Joined: Dec 22, 2005
Posts: 59
posted
0
Can you try setting IsApplicationInProductionMode=false. I am getting the alert message even when IsApplicationInProductionMode=false.
Also, When I just print the value in IsApplicationInProductionMode using the statement ${initParam.IsApplicationInProductionMode} , the correct value is getting displayed
Hey, I think that was the problem. I am using Net Beans and when I try to include core tag libs, I get an error saying "could not resolve the uri" Ranchers, please help me how to resolve this issue.
Cheers, Sandeep
Mark Beavis
Ranch Hand
Joined: Apr 07, 2005
Posts: 43
posted
0
check that jstl.jar and standard.jar are in the lib directory of your web-app.