Call HashMap from jsp EL ?

Posted by Parhs on Stack Overflow See other posts from Stack Overflow or by Parhs
Published on 2010-06-13T15:57:37Z Indexed on 2010/06/13 16:02 UTC
Read the original article Hit count: 228

Filed under:
|

Here is my Entity Class

 public enum UnitType {

    HOSPITAL, HEALTHCENTER
}
public static LinkedHashMap<UnitType, String> unitType = new LinkedHashMap<UnitType, String>() {
    {
        put(UnitType.HEALTHCENTER, "???t?? ??e?a?");
        put(UnitType.HOSPITAL, "??s???µe??");
    }
};

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
    private String name;
    private String address;
    @Column(columnDefinition = "TEXT")
    private String info;
    @Enumerated(EnumType.STRING)
    private UnitType type;

At my jsp

                       <c:forEach var="unit" items="${requestScope.units}">
                        <tr>
                            <td>${unit.id}</td>
                            <td>${unit.name}</td>
                            <td>${unit.address}</td>
                            <td>??!?</td>
                            <td><a href="#">?e??ss?te?a</a></td>
                        </tr>
                    </c:forEach>

How can i place the text value of the enum at ??!? .. Any idea? Tried some ways but nothing worked..

© Stack Overflow or respective owner

Related posts about java

Related posts about jsp