zudduz
zudduz

Reputation: 2537

How do I access a custom tag's attributes in a scriptlet?

I am making a custom jsp tag and need to access one of the attributes inside a scriptlet in the tag file. What do I call to access it.

<%@ tag import="com.package.model.Pojo"%>
<%@ attribute name="pojo" type="com.package.model.Pojo"%>

<%
    Pojo pojo = ????
%>

Upvotes: 2

Views: 670

Answers (1)

zudduz
zudduz

Reputation: 2537

Just took a wild guess and figured it out. Don't declare it but simply start accessing it. IE:

<%@ tag import="com.package.model.Pojo"%>
<%@ attribute name="pojo" type="com.package.model.Pojo"%>

<%
   pojo.getFoo();
%>

Upvotes: 2

Related Questions