Por favor, estou tendo um problema de passagerm de parametro para o meu TLD que comunica com o Bean.
estou tentando passar assim:
<%
String tem = (String) request.getParameter(“chave”);
String state = (String) request.getParameter(“uf”);
if (tem != null && !tem.equals(""))
{
%>
<br><br>
<table align=center width=“70%”>
<th bgcolor="#CCDDEE" colspan=3 align=center>
Resultado
</th>
<pesquisa:mostremidias chave=’<%= tem %>’ uf=’<%=state%>’>
<tr bgcolor="#E3E3E3">
<td align=center>
Nome: <%= nome %>
</td>
<td align=center>
Cnpj: <%= cnpj %>
</td>
</tr>
<tr bgcolor="#F7F7F7">
<td align=center>
<%= ddd %>
</td>
<td align=center>
<%= telefone %>
</td> </tr> <tr> <td colspan=“2” bgcolor="#FFFFFF"> </td>
</tr>
</pesquisa:mostremidias>
</table>
mas acredito que to passando errado
a minha tag do meu XMl ta assim
<tag>
<name>mostremidias</name>
<tagclass>tags.TagMidia</tagclass>
<teiclass>tags.TagTEIMidia</teiclass>
<bodycontent>JSP</bodycontent>
<info>Tag que mostra o conteudo do BD</info>
<attribute>
<name>chave</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute>
<name>uf</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
</tag>
e na classe java ta certo
o que ta faltando?
Rodrigo
Oi
joey, seja bem vindo ao PJ :):)
Olhe só, nem terminei de ver seu código, mas onde está
if (tem != null && !tem.equals(""))
deve ser assim
if ( (tem != null) && (!tem.equals("")) )
Ta dando alguem erro aí? POsta ele.
T+
Javeaux, ele nao da erro nenhum, simplesmente nao apaece o resultado da pesquisa na tela. (tenho certeza que existe na tabela o que estou procurando).
vou postar aki o codigo todo da page JSP
preciso de ajuda na passagem dos parametros para o TLD que comunica com a classe java.
obrigado
<%@ taglib uri="/WEB-INF/tld/TagLib.tld" prefix=“pesquisa” %>
<html>
<body>
<center>
<table align=center width=“50%”>
<form method=“post” action=“pesquisa.jsp”>
<th bgcolor="#CCDDEE" colspan=3>
Digite a(s) palavra(s) chave(s) para a pesquisa
</th>
<tr bgcolor="#f7f7f7">
<td align=center>
Nome: <input type=“text” name=“chave” size=30> <BR><BR>
Estado: <input type=“radio” name=“uf” value=“SC” checked> SC
<input type=“radio” name=“uf” value=“pr”> PR
<input type=“radio” name=“uf” value=“rs”> RS
<input type=submit value=“Pesquisar >>”>
<input type=reset value=“Limpar”>
</td>
</tr>
</form>
</table>
<%
String tem = (String) request.getParameter(“chave”);
String state = (String) request.getParameter(“uf”);
if (tem != null && !tem.equals(""))
{
%>
<br><br>
<table align=center width=“70%”>
<th bgcolor="#CCDDEE" colspan=3 align=center>
Resultado
</th>
<pesquisa:mostremidias chave=’<%= tem %>’ uf=’<%=state%>’>
<tr bgcolor="#E3E3E3">
<td align=center>
Nome: <%= nome %>
</td>
<td align=center>
Cnpj: <%= cnpj %>
</td>
</tr>
<tr bgcolor="#F7F7F7">
<td align=center>
<%= ddd %>
</td>
<td align=center>
<%= telefone %>
</td> </tr> <tr> <td colspan=“2” bgcolor="#FFFFFF"> </td>
</tr>
</pesquisa:mostremidias>
</table>
<% } %>
</center>
</body>
</html>