• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Including JSP Fragments

 
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
What I have understood by reading online is that JSP fragments are incomplete JSP pages saved with .jspf extn.

I tried to include one just .jspf file using:
<jsp:include page="/jspf/header.jspf" />
and, inside this JSP fragment I'm trying to read from the implicit request attr.

<html><head><title>Thanks for visiting <%= request.getParameter("fName") %> <%= request.getParameter("lName") %> </title></head><body>

But, this doesn't work, however if I change the extension from.jspf to .jsp it works...pls help...
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The jspf files will not compile when they have the .jspf extension. If you are using tomcat add this so that tomcat's jsp "servlet" is invoked when the .jspf extension is used.



[EDIT]

By the way... if you want scriplets to be evaluated use the include directive instead. But that means that you cant pass params to the included file like before. Either name your file .jsp to compile it, or associate the jspf extension in web.xml so that they are treated like JSPs, or use the include directive to compile scriplets et all.

Arrrghhhh so many choices !
[ September 30, 2006: Message edited by: John Meyers ]
 
Reema Patel
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks John!
It's working fine now.

 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!