Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Including JSP Fragments

 
Reema Patel
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...
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • 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.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic