• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

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

 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?




 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what is .jspf ? can you elaborate ?
 
Ranch Hand
Posts: 254
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Duc Vo
 
To get a wish, you need a genie. To get a genie, you need a lamp. To get a lamp, you need a tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic