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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T15:44:10+00:00 2026-06-06T15:44:10+00:00

When coding a tag file, how to instruct caller to skip rest of the

  • 0

When coding a tag file, how to instruct caller to skip rest of the page?

Let’s say I have a jsp file a.jsp. a.jsp will call a tag file b.tag.

a.jsp:

abc
<mytag:b/>
def

When is returned, I would like to skip rest of the page which is in my case “def” will not be displayed.

Thanks.

  • 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-06-06T15:44:11+00:00Added an answer on June 6, 2026 at 3:44 pm

    There is no way to do this using Tag Files.

    A SimpleTag can throw SkipPageException to skip the further execution of the caller page. The same cannot be done using Tag Files because the JSP Spec says it might lead to undefined behavior.

    In your case, if you need such functionality. You should send the conditional part to Tag File as fragment. And the Tag File based on the condition can decide whether to invoke the fragment or not.

    mytag.tag

    <%@ tag body-content="empty" %>     
    <%@ attribute name="pass" fragment="true" required="true" %> 
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
    <c:if test="${condition}">
        <jsp:invoke fragment="pass" /> 
    </c:if>
    

    You can use this tag like this:

    <tags:mytag>
        <jsp:attribute name="value" >
            <jsp:include ....../> 
            //write your jsp fragment code which you want to skip codtionally
      </jsp:attribute>
    </tag:mytag>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say we have an HTML page with a single stylesheet <link> . How
I have a problem here with the php function substr Let's say I have
Coding HTML5 page for use in iPad Mobile Safari that has tag for embedding
I am a ctags newbie, coding in PHP. I have found this ctags file
How can we write html tidy coding only for inserting closing tag in the
Coding footer naively, if there's not enough content, then there will be empty space
I'm coding a function in C++ to load a MAT-File (level 5) format based
I have the following xml file. <a> <b> <c>val1</c> <d>val2</d> </b> <b> <c>val3</c> <d>val4</d>
I have an XML file with format similar to: <root> <baby> <a>stuff</a> <b>stuff</b> <c>stuff</c>
I have a site that currently uses images on a file server. The images

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.