Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 551033
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:21:04+00:00 2026-05-13T11:21:04+00:00

What are .jspf files in JSP? As I know the compiler will look for

  • 0

What are .jspf files in JSP? As I know the compiler will look for .jsp files to compile, then how are the .jspf files compiled?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T11:21:04+00:00Added an answer on May 13, 2026 at 11:21 am

    As others have noted, .jspf files are JSP fragments. They’re designed to be statically included in another JSP file, not compiled on their own:

    <%@include file="/WEB-INF/jspf/example.jspf" %>
    

    You’ll note that this example comes from the /WEB-INF/jspf directory. This means that it is not accessible outside of the web application; there’s no way to construct a URL that can retrieve it. If you put them in the same directory as “normal” JSP files, you can construct such a URL; Tomcat, for example will retrieve the page as a text document. A front-end web-server, however, can block these URLS.

    I like JSPF files as a first step in refactoring large JSP pages. Since they’re statically included, you can extract a small chunk of the file without making provision for scriptets or variables, leading to pages that are somewhat more maintainable (and I want to stress, it’s a first step; dynamic includes and taglibs are usually a better long-term solution). When refactoring, I believe in keeping the fragments close to their parent files; this is when having a web-server to block URLs becomes useful.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some .jspf files that are fragments which I include in a new
I want to image to be included in usermenu.jspf file which is then included
I get this exception: org.apache.jasper.JasperException: Unable to compile class for JSP I am using
I'm using jsp of out-of-box portlet like feed.jspf in Liferay 6: String articleId =null;
How can I add jspf file to jsp page via custom tag? In the
I am trying to use : http://code.google.com/p/jspf/ within a GWT framework. I know that
I want to make include jspf into index jsp page , these statements <%--
How do I get Aptana to recognize .jspf files? I'd like to have syntax
Ok, so basically I have a jspf template file with a backing FragmentBean that
I am passing param value in include tag in jsp page like below <s:include

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.