| Author |
jspf not working with <jsp:include> and <jsp:param>
|
Raef Kandeel
Ranch Hand
Joined: Aug 05, 2007
Posts: 87
|
|
Hi there Ranchers,
Hi again . I was following an example from Head First on page 408 on my edition of the book. I am using Tomcat 5.0.
Header1.jspf:-
No what the browser show was something like:-
In other words, the expression language did not get evaluated. why is that?
Please note that if i change header1.jspf to header1.jsp, it works perfectly normally.
Am I confused?
|
SCJP, SCWCD
|
 |
Seetharaman Venkatasamy
Ranch Hand
Joined: Jan 28, 2008
Posts: 5575
|
|
|
what is .jspf ? can you elaborate ?
|
 |
Duc Vo
Ranch Hand
Joined: Nov 20, 2008
Posts: 254
|
|
It's because by default Tomcat server does not set to map *.jspf to JSP servlet.
Check sevlet-mapping section of the file web.xml in folder $TOMCAT_HOME/conf
Add the these lines in if you want to use *.jspf as JSP files.
|
“Everything should be as simple as it is, but not simpler.” Albert Einstein
|
 |
Raef Kandeel
Ranch Hand
Joined: Aug 05, 2007
Posts: 87
|
|
jspf stands for jsp fragment. It is not meant to be a complete jsp file, and this is why it is not supposed to have <html> and <body> tags like a normal jsp. Jspf is meant to be included in another file. It offers an extension that lets you know that it is only meant to be included and it is not meant to be a stand-alone jsp.
if you have a normal jsp, with a normal <html> and <body> tags and you have it included in your original jsp file, wouldn't you get something like:-
the way I understand it, jspf is supposed to be like a normal jsp file, only it is an indication that this is not just a normal jsp file, it only contains a fragment and it is only meant to be included inside other files. Do you get it?
|
 |
Duc Vo
Ranch Hand
Joined: Nov 20, 2008
Posts: 254
|
|
Raef Kandeel wrote:
the way I understand it, jspf is supposed to be like a normal jsp file, only it is an indication that this is not just a normal jsp file, it only contains a fragment and it is only meant to be included inside other files. Do you get it?
Not quite right though, jspf is a convention not a standard, hence your problem.
Anyway, happen to find another solution for you here.
|
 |
Raef Kandeel
Ranch Hand
Joined: Aug 05, 2007
Posts: 87
|
|
Thanks Duc Vo
|
 |
 |
I agree. Here's the link: jrebel
|
|
subject: jspf not working with <jsp:include> and <jsp:param>
|
|
|