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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T08:54:59+00:00 2026-05-30T08:54:59+00:00

Before I get started with my question, here are my unfortunate limitations: I’m using

  • 0

Before I get started with my question, here are my unfortunate limitations:

  1. I’m using JSF 1.2, not 2; so no composite component.
  2. I’m using JSP for rendering instead of facelets; so none of those composite components either.
  3. I’m not allowed to use any 3rd-party tag libraries (richFaces, iceFaces, etc.)

These limitations are set in stone.

Now moving onto my question. Currently, we have a JSP subview which handles creating an address. There is a lot of javascript that goes along with this, along with a backing bean. This page is never used directly. Instead, it’s included using a <jsp:include />.

However, there are several attributes that I want to be able to change. For instance, is county required, are we currently doing address scrubbing, etc. In order to do this, it would make sense to use a custom component (I think?). However, I’m not really sure the best way to do this.

If I could, I would simply turn this JSP into a composite component and be done with it. However, that’s not really an option based on my limitations.

What are my options? This wouldn’t be so difficult if it weren’t for the amount of javascript involved. I know my explanation was vague; however, I’m looking more for guidance than a direct answer. I’ve googled for things such as custom JSF 1.x components with javascript, etc. I haven’t found many good articles, however.

Thanks in advance.

  • 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-30T08:55:00+00:00Added an answer on May 30, 2026 at 8:55 am

    Create a JSP tag file.

    /WEB-INF/tags/foo.tag

    <%@ tag body-content="empty" %>
    <%@ attribute name="countryRequired" required="false" type="java.lang.Boolean" %>
    <%@ attribute name="showAddress" required="false" type="java.lang.Boolean" %>
    
    <%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
    <%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    
    <h:panelGrid columns="2">
        <h:outputLabel for="country" value="Country" />
        <h:inputText id="country" value="#{bean.country}" required="${countryRequired}" />
    
        <c:if test="${showAddress}">
            <h:outputLabel for="address" value="Address" />
            <h:inputText id="address" value="#{bean.address}" />
        </c:if>
    </h:panelGrid>
    

    Declare and use it as follows (no additional XML configuration necessary):

    <%@ taglib prefix="my" tagdir="/WEB-INF/tags" %>
    ...
    <my:foo showAddress="true" />
    

    Note that JSTL is also here a “view build time” tag like as in Facelets. Also note that you can’t use #{} to reference JSP tag attributes.

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

Sidebar

Related Questions

Before I get flamed and down-voted without mercy, my company will not allow the
We have just started our new assignment - web-based project. Before I get directly
I'm using the built in search functionality with jqGrid and started to get some
Before I ask my question: I just started ASP.NET MVC, so an advanced answer
Before I get started on a very large project for creating audiovisual presentations in
Before I get into the details of this problem, I'd like to make the
Ok, before I get a ton of responses. I know you cannot talk to
Right, before we get off about merged cells, I hate them too, but I've
Hi is there away to detect the length of a byte before I get
I'm writing a class to insert users into a database, and before I get

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.