Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

.jspf file not behaving as .jsp file: example in HFSJ

 
srini E
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in HFSJ, page 408 example of having fragment of JSP as .jspf.

As per the example if i have
<jsp:include page="Header.jspf" >
<jsp aram name="subTitle" value="We take the sting out of SOAP." />
</jsp:include>
in the main JSP and in Header.jspf, if i try have
${param.subTitle } trying to get the param value it doesn't work.

I tried changing .jspf to .jsp and i could get the value.

Question in two folds:
1. why is .jspf not being treated as .jsp for EL alone...but for rest its fine ?
2. How to make .jspf behave like .jsp to make EL understandable and execute EL.?

I've read that .jspf is recommended.

I'm using
jakarta-tomcat-5.5.9
j2sdk1.4.2
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

.jspf is not standard JSP file extention. Try this in web.xml

<jsp-config>
<jsp-property-group>
<url-pattern>*.jspf</url-pattern>
</jsp-property-group>
</jsp-cofig>

By adding this, by default the .jspf extention will treated as JSP file.

Thanks
 
srini E
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you...that relaly helped.

I was curious how did you get to know about it? I mean what do i have to go through to know thing like this?....
May be i'd find as i go along the book, but i got curious.
 
Vidya Sethuraman
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

check the errata..

{407} whole page;
As the .jspf convention is not supported by default in Tomcat, the following mapping
needs to be added to the application's web.xml for the example to work correctly:

<servlet-mapping>
<servlet-name>jsp</servlet-name>
<url-pattern>*.jspf</url-pattern>
</servlet-mapping>
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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


It is only valid for Tomcat. Other Application servers may not have named "jsp" for the servlet which process JSP files.

So, I think if you define property group, if implicitly specify that the file is JSP file, for all containers.

Thanks
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi srinivas,

I was curious how did you get to know about it? I mean what do i have to go through to know thing like this?....
May be i'd find as i go along the book, but i got curious.


JSP SECIFICATIONS.

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic