Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

using if statements in jsp:include

843840May 11 2009 — edited May 14 2009
Hi,

I'm new to jsp and I've a (hopefully) simple problem.
I would like to include a jsp file and pass a parameter to the included file if a condition is true.
Unfortunatelly the paramater is always passed even if the condition is false :(

base jsp:
[...]
<jsp:include page="test.jspx">
	<jsp:scriptlet>if (false) {</jsp:scriptlet> 
		<jsp:param name="testparam" value="hello world" />
	<jsp:scriptlet>}</jsp:scriptlet> 
</jsp:include>	
[...]
included jsp:
[...]
<c:out value="${param.testparam}"></c:out>
[...]
The "c:out" statement in the included file always prints out "hello world" :(... It seems, that my if condition is not evaluated. But why?!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 11 2009
Added on May 11 2009
10 comments
2,228 views