jstl custom tag questions - ignore of c:out, tag parameters and reduce code
I am using jstl in order to create custom tag. Here is the content of location.tag:

    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
    <%@ attribute name="id" required="true" %>
    <%@ attribute name="locationType" required="false" %>
    <br/>
    <c:out value="${param.id}" /> <---THIS ALWAYS PRINTS NOTHING! WHY?
    <br/>
    <c:out value="${param.locationType}" /> <---THIS ALWAYS PRINTS NOTHING! WHY?
    <br/>
    <c:if test="${empty param.locationType}" >
        <select id="<c:out value="${param.id}" />_locationTypeSelect">
            <option value="ADDRESS">כתובת</option>
            <option value="INSTITUTE">מוסד</option>
        </select>
        <script type="text/javascript">
            $(document).ready(function() {
                $('<c:out value="${param.id}" />_locationTypeSelect').change(function() {
                    switch($(this).val()) {
                        case 'ADDRESS':
                            $('<c:out value="${param.id}" />_addressCitySelect').show();
                            $('<c:out value="${param.id}" />_addressStreetSelect').show();
                            $('<c:out value="${param.id}" />_addressHouseNumberInput').show();
    
                            $('<c:out value="${param.id}" />_instituteNameSelect').hide();
                            $('<c:out value="${param.id}" />_instituteBranchSelect').hide();
                            break;
                        case 'INSTITUTE':
                            $('<c:out value="${param.id}" />_addressCitySelect').hide();
                            $('<c:out value="${param.id}" />_addressStreetSelect').hide();
                            $('<c:out value="${param.id}" />_addressHouseNumberInput').hide();
    
                            $('<c:out value="${param.id}" />_instituteNameSelect').show();
                            $('<c:out value="${param.id}" />_instituteBranchSelect').show();
                            break;
                    }
                });
            });
        </script>
    </c:if>
    
    <c:if test="${empty param.locationType or param.locationType == 'ADDRESS'}" >
        <select id="<c:out value="${param.id}" />_addressCitySelect"></select>
    
        <select id="<c:out value="${param.id}" />_addressStreetSelect"></select>
    
        <input type="text" id="<c:out value="${param.id}" />_addressHouseNumberInput"/>
    </c:if>
    
    <c:if test="${empty param.locationType or param.locationType == 'INSTITUTE'}" >
        <select id="<c:out value="${param.id}" />_instituteNameSelect"></select>
    
        <select id="<c:out value="${param.id}" />_instituteBranchSelect"></select>
    </c:if>

Here I am using the location tag:

    <h:location id="a" locationType="ADDRESS"></h:location>
    <h:location id="b"></h:location>

1. For some reasons the generated ids of the elements doesn't has the prefix `<c:out value="${param.id}" />`. For example, in location.tag I wrote `<input type="text" id="<c:out value="${param.id}" />_addressHouseNumberInput"/>` but the result of both the usages is: `<input type="text" id="_addressHouseNumberInput"/>` (it ignores the `c:out`. What is wrong?
2. For the both usages the html result is the same, as if it doesn't recognize the parameter locationType. Why is that?
3. I have a lot of code duplication here. For example, all the id prefixes: `<c:out value="${param.id}" />`.  Is there any way to reduce the amount of code?

jstl custom tag questions - ignore of c:out, tag parameters and reduce code
===

I am using jstl in order to create custom tag. Here is the content of location.tag:

    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
    <%@ attribute name="id" required="true" %>
    <%@ attribute name="locationType" required="false" %>
    <br/>
    <c:out value="${param.id}" /> <---THIS ALWAYS PRINTS NOTHING! WHY?
    <br/>
    <c:out value="${param.locationType}" /> <---THIS ALWAYS PRINTS NOTHING! WHY?
    <br/>
    <c:if test="${empty param.locationType}" >
        <select id="<c:out value="${param.id}" />_locationTypeSelect">
            <option value="ADDRESS">כתובת</option>
            <option value="INSTITUTE">מוסד</option>
        </select>
        <script type="text/javascript">
            $(document).ready(function() {
                $('<c:out value="${param.id}" />_locationTypeSelect').change(function() {
                    switch($(this).val()) {
                        case 'ADDRESS':
                            $('<c:out value="${param.id}" />_addressCitySelect').show();
                            $('<c:out value="${param.id}" />_addressStreetSelect').show();
                            $('<c:out value="${param.id}" />_addressHouseNumberInput').show();
    
                            $('<c:out value="${param.id}" />_instituteNameSelect').hide();
                            $('<c:out value="${param.id}" />_instituteBranchSelect').hide();
                            break;
                        case 'INSTITUTE':
                            $('<c:out value="${param.id}" />_addressCitySelect').hide();
                            $('<c:out value="${param.id}" />_addressStreetSelect').hide();
                            $('<c:out value="${param.id}" />_addressHouseNumberInput').hide();
    
                            $('<c:out value="${param.id}" />_instituteNameSelect').show();
                            $('<c:out value="${param.id}" />_instituteBranchSelect').show();
                            break;
                    }
                });
            });
        </script>
    </c:if>
    
    <c:if test="${empty param.locationType or param.locationType == 'ADDRESS'}" >
        <select id="<c:out value="${param.id}" />_addressCitySelect"></select>
    
        <select id="<c:out value="${param.id}" />_addressStreetSelect"></select>
    
        <input type="text" id="<c:out value="${param.id}" />_addressHouseNumberInput"/>
    </c:if>
    
    <c:if test="${empty param.locationType or param.locationType == 'INSTITUTE'}" >
        <select id="<c:out value="${param.id}" />_instituteNameSelect"></select>
    
        <select id="<c:out value="${param.id}" />_instituteBranchSelect"></select>
    </c:if>

Here I am using the location tag:

    <h:location id="a" locationType="ADDRESS"></h:location>
    <h:location id="b"></h:location>

1. For some reasons the generated ids of the elements doesn't has the prefix `<c:out value="${param.id}" />`. For example, in location.tag I wrote `<input type="text" id="<c:out value="${param.id}" />_addressHouseNumberInput"/>` but the result of both the usages is: `<input type="text" id="_addressHouseNumberInput"/>` (it ignores the `c:out`. What is wrong?
2. For the both usages the html result is the same, as if it doesn't recognize the parameter locationType. Why is that?
3. I have a lot of code duplication here. For example, all the id prefixes: `<c:out value="${param.id}" />`.  Is there any way to reduce the amount of code?
