Construindo tag librarys

1 resposta
Savio

Galera, o meu objeto pageContext está vindo nulo!

to usando o tomcat 6.

Código da classe handler:

public int doStartTag() throws JspException {
		
		try {
			JspWriter input = pageContext.getOut();
			input.println("<input type=\"hidden\" name=\"tsc\" id=\"tsc\" value=\""+getTiquete()+"\" />");
			return SKIP_BODY;
			
		} catch (Exception e) {
			throw new JspException(e);
		}
	}

E o meu tld:

<?xml version="1.0" encoding="ISO-8859-1" ?>

<taglib xmlns="http://java.sun.com/xml/ns/j2ee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
    version="2.0">
    
  <description>Tiquete library</description>
  <display-name>Tiquete</display-name>
  <tlib-version>1.1</tlib-version>
  <short-name>tiq</short-name>
  <uri>http://www.cabal.com.br/taglib/tiqt</uri>

	<tag>
		<name>tiquete</name>
		<tag-class>br.com.cabal.SingleSignOn.web.controle.Tiquete</tag-class>
    	<body-content>empty</body-content>
  	</tag>
</taglib>

1 Resposta

ASOBrasil

Sávio,

Dica: ao invés de usar o Classic Tag (estou vendo esse “doStartTag()” no seu código), utilize o Simple Tag que é melhor. (PS: A não ser que você tenha um bom motivo para usar o Classic Tag!)

Procure também por Simple Tag no google.

Criado 12 de fevereiro de 2008
Ultima resposta 13 de fev. de 2008
Respostas 1
Participantes 2