wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes .jspf file not behaving as .jsp file: example in HFSJ Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark ".jspf file not behaving as .jsp file: example in HFSJ" Watch ".jspf file not behaving as .jsp file: example in HFSJ" New topic
Author

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

srini E
Greenhorn

Joined: Feb 18, 2006
Posts: 10
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


learn-->practice-->Improvise-->repeat<br /> <br />Thanks,<br />Srini
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
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


Narendra Dhande
SCJP 1.4,SCWCD 1.4, SCBCD 5.0, SCDJWS 5.0, SCEA 5.0
srini E
Greenhorn

Joined: Feb 18, 2006
Posts: 10
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

Joined: Sep 28, 2003
Posts: 45
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>


Vidya <br />(SCJP 1.4)
Narendra Dhande
Ranch Hand

Joined: Dec 04, 2004
Posts: 950
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

Joined: Dec 04, 2004
Posts: 950
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: .jspf file not behaving as .jsp file: example in HFSJ
 
Similar Threads
JSP fragments and EL
using jsp:param
el-ignored doubt
HFSJ example page 408
Including JSP Fragments