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

Mapping .jspf to jsp

 
Alec Lee
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In tomcat 5, I used <jsp:include page="header.jspf" /> to include a fragment (according to HFS p407). However, it seems that .jspf is not interpreted by tomcat and the jsp syntax (e.g. ${..} ) got displayed as normal template text. When I changed the .jspf to .jsp everything worked correctly.

I have questions related to above observation:

1) Is .jsp a standard extension according to the spec for specifying a JSP page? Or is it just tomcat's convention? (I dont have the time to go thru the whole spec and appreciate if anyone could point me to the exact locations of the related topics for this)

2) I checked www.oreilly.com's errata page for HFS p407, and in there it is suggested that we add this to the web.xml for tomcat to recognize .jspf

<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.jspf</url-pattern>
</servlet-mapping>

I tested this and it works!! But, I dont understand why this works. My knowledge of web.xml (mainly from HFS) is that <servlet-mapping> refers to some previously defined servlet in <servlet> tag. But, there is no such a tag here not to mention the <servlet-name>jsp</servlet-name> is never defined by me.

Could anyone explain how the above works. It all comes from HFS's site in www.oreilly.com (click errata and scroll to the description for p407).
 
Mat Williams
Ranch Hand
Posts: 215
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Have at look at this forum thread. It explains things somewhat.

Intersetingly the term jsp "Fragments" now refers to something else according to the spec. the new term is jsp "Segments" not "Fragments" anyone know why they changed this or am I just getting confused (entirely possible )

Mat
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic