Question

I would like to do something like <test:di id="someService"/`>
<% someService.methodCall(); %>

where <test:di
gets and instantiates a service bean and creates a scripting variable for use. similar to how jsp:usebean works for example <jsp:useBean id="someDate" class="java.util.Date"/>
<%
someDate.getYear();

%>

how do i make my own objects available as a scritping variable?

Was it helpful?

Solution

The way this is done in a Tag Library is by using a Tag Extra Info (TEI) class.

You can find an example here.

OTHER TIPS

I think you're trying to write your own tag library.

Check out the tutorial at: http://www.ironflare.com/docs/tutorials/taglibs/

Edit: As Garth pointed out, you want to use the TagExtraInfo class after you've defined your tag lib. http://www.stardeveloper.com/articles/display.html?article=2001081601&page=2

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top