JSP Tag Library

The tag library of Java Server Pages to execute Pnuts script is included in Pnuts (pnuts.jar).

<%@ taglib uri="/pnutstag.jar" prefix="pnuts" %>

<pnuts:eval>
  expression
</pnuts:eval>

The <pnuts:eval> tag evaluates the expression and is replaced the element by the output of the evaluation.

The uri attribute if taglib directive should indicate pnutstag.jar which has the following structure.

META-INF
taglib.tld

e.g. (${TOMCAT}/webapps/test/test.jsp)
<%@ taglib uri="/pnutstag.jar" prefix="pnuts" %>
<HTML>
<HEAD>
<TITLE></TITLE> 
</HEAD>
<BODY BGCOLOR="#FFFFFF"> 

<pnuts:eval>
  use("pnuts::util")
  foo = 100
</pnuts:eval>

<pnuts:eval>
  println(foo)
</pnuts:eval>
</BODY> 
</HTML>


Back