• 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
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
It's exactly the same and completely different as this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic