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

  • Home
  • SEARCH
  • 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 3798480
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T13:34:45+00:00 2026-05-19T13:34:45+00:00

I have a header.jsp that I want to include in multiple pages. The header

  • 0

I have a header.jsp that I want to include in multiple pages. The header page has three links in it. I am using css to indicate to the user which page they are on at any given point. Here is the code for header.html:

<ul>
    <%-- Check for the activeState parameter to decide which css to use --%>
    <c:choose>
        <c:when test='${requestScope.activeState == "home"}'>
            <li><a href="index.jsp" class="active"><span>Home</span></a></li>
        </c:when>
        <c:otherwise>
            <li><a href="index.jsp"><span>Home</span></a></li>
        </c:otherwise>
    </c:choose>

    <c:choose>
        <c:when test='${requestScope.activeState == "about"}'>
            <li><a href="about.jsp" class="active"><span>About Us</span></a></li>
        </c:when>
        <c:otherwise>
            <li><a href="about.jsp"><span>About Us</span></a></li>
        </c:otherwise>
    </c:choose>

    <c:choose>
        <c:when test='${requestScope.activeState == "contact"}'>
            <li><a href="contact.jsp" class="active"><span>Contact Us</span></a></li>
        </c:when>
        <c:otherwise>
            <li><a href="contact.jsp"><span>Contact Us</span></a></li>
        </c:otherwise>
    </c:choose>
</ul>

This is what the index.jsp file calls:

<jsp:include page="header.jsp">
    <jsp:param value="home" name="activeState"/>
</jsp:include>

This does not work. Six links are showed in the index.html page. Three with css and three without css. Here is what the source looks like for the index.html page:

<c:choose>
    <c:when test='false'>
        <li><a href="index.jsp" class="active"><span>Home</span></a></li>
    </c:when>
    <c:otherwise>
        <li><a href="index.jsp"><span>Home</span></a></li>
    </c:otherwise>
</c:choose>

<c:choose>
    <c:when test='false'>
        <li><a href="about.jsp" class="active"><span>About Us</span></a></li>
    </c:when>
    <c:otherwise>
        <li><a href="about.jsp"><span>About Us</span></a></li>
    </c:otherwise>
</c:choose>

<c:choose>
    <c:when test='false'>
        <li><a href="contact.jsp" class="active"><span>Contact Us</span></a></li>
    </c:when>
    <c:otherwise>
        <li><a href="contact.jsp"><span>Contact Us</span></a></li>
    </c:otherwise>
</c:choose>

I also tried to get the activeState parameter using the param.activeState instead of requestScope.activeState. No change in behavior. Can somebody explain what is going on?

  • 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-19T13:34:46+00:00Added an answer on May 19, 2026 at 1:34 pm

    If you see the JSTL tags unparsed in the HTML source, then it means that either the JSTL taglib isn’t been declared in top of JSP as follows

    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    

    or that JSTL isn’t installed at all. Download and install it as per the instructions in our JSTL wiki page.

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

Sidebar

Related Questions

I have a JSP page that handles file downloads. I set the response header
Lets say that I have a header user control in a master page, and
So I have a main JSP index page, index.jsp, which has several includes. Something
I have a .jsp page that begins with <%@ taglib uri=http://java.sun.com/jstl/core prefix=c %> <%@
I have a JSP page that needs to accept some info into a form,
I have a jsp page which I'm using to display a datatable. If I
I have a large number of JSP pages that need a small bit of
I have a JSP that contains the content at the top of my page,
I have included JQuery1.5 in the header of a JSF page. In that page
I have a webpage in which I am using 2 jsp:include directives. Basically one

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.