File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jspf not working with <jsp:include> and <jsp:param>

 
Raef Kandeel
Ranch Hand
Posts: 87
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:-


${param.subTitle}
We can help.

Contact us at: likewecare@wickedlysmart.com


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?




 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is .jspf ? can you elaborate ?
 
Duc Vo
Ranch Hand
Posts: 254
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Raef Kandeel
Ranch Hand
Posts: 87
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 254
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 87
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Duc Vo
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic