• 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
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Including JSP Fragments

 
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks John!
It's working fine now.

reply
    Bookmark Topic Watch Topic
  • New Topic