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 3432366
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:26:25+00:00 2026-05-18T07:26:25+00:00

I had the idea a while back to put all of my taglib declarations

  • 0

I had the idea a while back to put all of my taglib declarations (uri’s, etc) in a common header file so I don’t have to manually write them into all of my JSPs. Initially, things seemed fine, although I don’t use the actual taglibs as much as just the simple EL syntax. However, I’m having trouble in all jsp files except for the one that explicitly has the taglibs declared. All of the other jsp’s (that include the header file) treat the <c:something.../> tag as if it’s HTML and don’t evaluate it. I did some googling and found this post on O’Reilly suggesting that what I’m trying to do can be done, but I’m clearly doing something wrong. What’s more is that the other stuff in the header file (common page headers, page titles, etc.) all show up fine. The header file and a sample of the inclusion are below.

Header file:

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ page session="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>

Inclusion statement:

<jsp:include page="/WEB-INF/jsp/include/header.jsp">
    <jsp:param name="title" value="Home" />
</jsp:include>
  • 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-18T07:26:25+00:00Added an answer on May 18, 2026 at 7:26 am

    This is expected behaviour.

    When you use <jsp:include>, it executed the target in a separate request, and then includes the output in the including JSP. It doesn’t include the source of the included target, it includes the output. The means by which that target output is generated is lost.

    To do what you’re trying to do, you need to use <% include %> directives:

    <%@ include file="/WEB-INF/jsp/include/header.jsp" %>
    

    This will incline the literal text of header.jsp into your page. Of course, by doing that, you can no longer pass parameters to it, so you’d need to set that as a page context attribute (e.g. using <c:set>… but of course you can’t use <c:set> until you’ve done your include…).

    Essentially, it’s not really worth the hassle. Taglib declarations are annoying boilerplate, but hard to get rid of.

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

Sidebar

Related Questions

All, I've had an idea kicking around for a while now: Is there a
I had an idea, if I add a python .py file to my C#
I had the idea of a search engine that would index web items like
I had an idea for a client-side language other than JavaScript, and I'd like
I had an idea I was mulling over with some colleagues. None of us
I had this idea of creating a count down timer, like 01:02, on the
It seems like Microsoft had a great idea with the ObservableCollection. They are great
I was wondering if anyone had a better idea how to do this. atm
I'm trying to implement a data compression idea I've had, and since I'm imagining
A while back I overheard some very experienced web developer describe an ideal (in

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.