smorigo 5 de abr. de 2005
Olha só o erro que está acontecendo:
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request .
exception
javax . servlet . ServletException : Unable to find a value for "codigo" in object of class "java.lang.String" using operator "."
org . apache . jasper . runtime . PageContextImpl . doHandlePageException ( PageContextImpl . java : 825 )
org . apache . jasper . runtime . PageContextImpl . handlePageException ( PageContextImpl . java : 758 )
org . apache . jsp . paginas . PesquisaEmpresa_jsp . _jspService ( PesquisaEmpresa_jsp . java : 105 )
org . apache . jasper . runtime . HttpJspBase . service ( HttpJspBase . java : 94 )
javax . servlet . http . HttpServlet . service ( HttpServlet . java : 802 )
org . apache . jasper . servlet . JspServletWrapper . service ( JspServletWrapper . java : 324 )
org . apache . jasper . servlet . JspServlet . serviceJspFile ( JspServlet . java : 292 )
org . apache . jasper . servlet . JspServlet . service ( JspServlet . java : 236 )
javax . servlet . http . HttpServlet . service ( HttpServlet . java : 802 )
org . apache . struts . action . RequestProcessor . doForward ( RequestProcessor . java : 1056 )
org . apache . struts . tiles . TilesRequestProcessor . doForward ( TilesRequestProcessor . java : 261 )
org . apache . struts . action . RequestProcessor . processForwardConfig ( RequestProcessor . java : 388 )
org . apache . struts . tiles . TilesRequestProcessor . processForwardConfig ( TilesRequestProcessor . java : 316 )
org . apache . struts . action . RequestProcessor . process ( RequestProcessor . java : 231 )
org . apache . struts . action . ActionServlet . process ( ActionServlet . java : 1164 )
org . apache . struts . action . ActionServlet . doGet ( ActionServlet . java : 397 )
javax . servlet . http . HttpServlet . service ( HttpServlet . java : 689 )
javax . servlet . http . HttpServlet . service ( HttpServlet . java : 802 )
root cause
javax . servlet . jsp . el . ELException : Unable to find a value for "codigo" in object of class "java.lang.String" using operator "."
org . apache . commons . el . Logger . logError ( Logger . java : 481 )
org . apache . commons . el . Logger . logError ( Logger . java : 498 )
org . apache . commons . el . Logger . logError ( Logger . java : 611 )
org . apache . commons . el . ArraySuffix . evaluate ( ArraySuffix . java : 340 )
org . apache . commons . el . ComplexValue . evaluate ( ComplexValue . java : 145 )
org . apache . commons . el . ExpressionEvaluatorImpl . evaluate ( ExpressionEvaluatorImpl . java : 263 )
org . apache . commons . el . ExpressionEvaluatorImpl . evaluate ( ExpressionEvaluatorImpl . java : 190 )
org . apache . jasper . runtime . PageContextImpl . proprietaryEvaluate ( PageContextImpl . java : 899 )
org . apache . jsp . paginas . PesquisaEmpresa_jsp . _jspx_meth_c_out_1 ( PesquisaEmpresa_jsp . java : 251 )
org . apache . jsp . paginas . PesquisaEmpresa_jsp . _jspx_meth_c_forEach_0 ( PesquisaEmpresa_jsp . java : 140 )
org . apache . jsp . paginas . PesquisaEmpresa_jsp . _jspService ( PesquisaEmpresa_jsp . java : 92 )
org . apache . jasper . runtime . HttpJspBase . service ( HttpJspBase . java : 94 )
javax . servlet . http . HttpServlet . service ( HttpServlet . java : 802 )
org . apache . jasper . servlet . JspServletWrapper . service ( JspServletWrapper . java : 324 )
org . apache . jasper . servlet . JspServlet . serviceJspFile ( JspServlet . java : 292 )
org . apache . jasper . servlet . JspServlet . service ( JspServlet . java : 236 )
javax . servlet . http . HttpServlet . service ( HttpServlet . java : 802 )
org . apache . struts . action . RequestProcessor . doForward ( RequestProcessor . java : 1056 )
org . apache . struts . tiles . TilesRequestProcessor . doForward ( TilesRequestProcessor . java : 261 )
org . apache . struts . action . RequestProcessor . processForwardConfig ( RequestProcessor . java : 388 )
org . apache . struts . tiles . TilesRequestProcessor . processForwardConfig ( TilesRequestProcessor . java : 316 )
org . apache . struts . action . RequestProcessor . process ( RequestProcessor . java : 231 )
org . apache . struts . action . ActionServlet . process ( ActionServlet . java : 1164 )
org . apache . struts . action . ActionServlet . doGet ( ActionServlet . java : 397 )
javax . servlet . http . HttpServlet . service ( HttpServlet . java : 689 )
javax . servlet . http . HttpServlet . service ( HttpServlet . java : 802 )
note The full stack trace of the root cause is available in the Apache Tomcat / 5.0.28 logs .
--------------------------------------------------------------------------------
Apache Tomcat / 5.0.28
Meu código está assim:
< %@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
< html>
< head>
< %@include file="Cabecalho.jsp"%>
< title> Lista Empresas< /title>
< /head>
< table width="500" border="0" cellspacing="0" cellpadding="0">
< tr>
< td width="50"> Teste< /td>
< td width="50"> Codigo< /td>
< td width="250"> Razao social< /td>
< td width="150"> CNPJ/CPF< /td>
< /tr>
< c:forEach var="empresa" items="${ listaEmpresas } ">
< tr>
< td>
< c:url value="/empresa.do" var="empresa">
< c:param name="codigo" value="${ requestScope . codigo } " />
< /c:url>
<a href= '<c:out value= " ${ empresa } " /> " >Editar</a>
</td>
<td><c:out value= " ${ empresa . codigo } " /></td>
<td><c:out value= " ${ empresa . razaoSocial } " /></td>
<td><c:out value= " ${ empresa . cnpj } " /></td>
</tr>
</c:forEach>
</table>
</body>
</html>
'>
smorigo 6 de abr. de 2005
Pessoal alguém tem uma dica sobre o que deve estar acontecendo?
Obrigado…
mister_m 6 de abr. de 2005
Está bem claro no stack trace. Não existe um atributo chamado codigo no request.
smorigo 6 de abr. de 2005
mais entao esse codigo nao era para funcionar certo:
<c:out value="${empresa.codigo}"/>
mais está funcionando, ou estou falando besteira?
skill_ufmt 6 de abr. de 2005
smorigo:
mais entao esse codigo nao era para funcionar certo:
<c:out value="${empresa.codigo}"/>
mais está funcionando, ou estou falando besteira?
já tentou por isso no trecho lá em cima
& lt ; c : url value = "/empresa.do" var = "empresa" & gt ;
& lt ; c : param name = "codigo" value = "${empresa.codigo}" /& gt ;
& lt ; / c : url & gt ;
smorigo 6 de abr. de 2005
Olha só fiz da maneira que você posto e a mensagem que eu recebo é a seguinte:
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request .
exception
javax . servlet . ServletException : Unable to find a value for "codigo" in object of class "java.lang.String" using operator "."
org . apache . jasper . runtime . PageContextImpl . doHandlePageException ( PageContextImpl . java : 825 )
org . apache . jasper . runtime . PageContextImpl . handlePageException ( PageContextImpl . java : 758 )
org . apache . jsp . paginas . PesquisaEmpresa_jsp . _jspService ( PesquisaEmpresa_jsp . java : 105 )
org . apache . jasper . runtime . HttpJspBase . service ( HttpJspBase . java : 94 )
javax . servlet . http . HttpServlet . service ( HttpServlet . java : 802 )
org . apache . jasper . servlet . JspServletWrapper . service ( JspServletWrapper . java : 324 )
org . apache . jasper . servlet . JspServlet . serviceJspFile ( JspServlet . java : 292 )
org . apache . jasper . servlet . JspServlet . service ( JspServlet . java : 236 )
javax . servlet . http . HttpServlet . service ( HttpServlet . java : 802 )
org . apache . struts . action . RequestProcessor . doForward ( RequestProcessor . java : 1056 )
org . apache . struts . tiles . TilesRequestProcessor . doForward ( TilesRequestProcessor . java : 261 )
org . apache . struts . action . RequestProcessor . processForwardConfig ( RequestProcessor . java : 388 )
org . apache . struts . tiles . TilesRequestProcessor . processForwardConfig ( TilesRequestProcessor . java : 316 )
org . apache . struts . action . RequestProcessor . process ( RequestProcessor . java : 231 )
org . apache . struts . action . ActionServlet . process ( ActionServlet . java : 1164 )
org . apache . struts . action . ActionServlet . doGet ( ActionServlet . java : 397 )
javax . servlet . http . HttpServlet . service ( HttpServlet . java : 689 )
javax . servlet . http . HttpServlet . service ( HttpServlet . java : 802 )
root cause
javax . servlet . jsp . el . ELException : Unable to find a value for "codigo" in object of class "java.lang.String" using operator "."
org . apache . commons . el . Logger . logError ( Logger . java : 481 )
org . apache . commons . el . Logger . logError ( Logger . java : 498 )
org . apache . commons . el . Logger . logError ( Logger . java : 611 )
org . apache . commons . el . ArraySuffix . evaluate ( ArraySuffix . java : 340 )
org . apache . commons . el . ComplexValue . evaluate ( ComplexValue . java : 145 )
org . apache . commons . el . ExpressionEvaluatorImpl . evaluate ( ExpressionEvaluatorImpl . java : 263 )
org . apache . commons . el . ExpressionEvaluatorImpl . evaluate ( ExpressionEvaluatorImpl . java : 190 )
org . apache . jasper . runtime . PageContextImpl . proprietaryEvaluate ( PageContextImpl . java : 899 )
org . apache . jsp . paginas . PesquisaEmpresa_jsp . _jspx_meth_c_out_0 ( PesquisaEmpresa_jsp . java : 231 )
org . apache . jsp . paginas . PesquisaEmpresa_jsp . _jspx_meth_c_forEach_0 ( PesquisaEmpresa_jsp . java : 136 )
org . apache . jsp . paginas . PesquisaEmpresa_jsp . _jspService ( PesquisaEmpresa_jsp . java : 92 )
org . apache . jasper . runtime . HttpJspBase . service ( HttpJspBase . java : 94 )
javax . servlet . http . HttpServlet . service ( HttpServlet . java : 802 )
org . apache . jasper . servlet . JspServletWrapper . service ( JspServletWrapper . java : 324 )
org . apache . jasper . servlet . JspServlet . serviceJspFile ( JspServlet . java : 292 )
org . apache . jasper . servlet . JspServlet . service ( JspServlet . java : 236 )
javax . servlet . http . HttpServlet . service ( HttpServlet . java : 802 )
org . apache . struts . action . RequestProcessor . doForward ( RequestProcessor . java : 1056 )
org . apache . struts . tiles . TilesRequestProcessor . doForward ( TilesRequestProcessor . java : 261 )
org . apache . struts . action . RequestProcessor . processForwardConfig ( RequestProcessor . java : 388 )
org . apache . struts . tiles . TilesRequestProcessor . processForwardConfig ( TilesRequestProcessor . java : 316 )
org . apache . struts . action . RequestProcessor . process ( RequestProcessor . java : 231 )
org . apache . struts . action . ActionServlet . process ( ActionServlet . java : 1164 )
org . apache . struts . action . ActionServlet . doGet ( ActionServlet . java : 397 )
javax . servlet . http . HttpServlet . service ( HttpServlet . java : 689 )
javax . servlet . http . HttpServlet . service ( HttpServlet . java : 802 )
note The full stack trace of the root cause is available in the Apache Tomcat / 5.0.28 logs .
--------------------------------------------------------------------------------
Apache Tomcat / 5.0.28
Esse meu “codigo” é do tipo Int mais acho que isso nao iria atrapalhar…
mister_m 6 de abr. de 2005
Novamente, o erro é claro:
smorigo:
javax.servlet.ServletException: Unable to find a value for “codigo” in object of class “java.lang.String” using operator “.”
// editado
org . apache . jsp . paginas . PesquisaEmpresa_jsp . _jspx_meth_c_out_0 ( PesquisaEmpresa_jsp . java : 231 )
org . apache . jsp . paginas . PesquisaEmpresa_jsp . _jspx_meth_c_forEach_0 ( PesquisaEmpresa_jsp . java : 136 )
org . apache . jsp . paginas . PesquisaEmpresa_jsp . _jspService ( PesquisaEmpresa_jsp . java : 92 )
</ blockquote >
O objeto no qual você está acessando codigo é uma String e não o que você pensa que ele é. Uma pergunta besta: a página que emite o erro é /paginas/PesquisaEmpresa.jsp?
rodrigo_ctba 20 de set. de 2006
conseguiu resolver…
Estou com um problema semelhante, no entanto as variáveis do bean não são populadas.
<c:url value= "/empresa.do" var= "empresa" >
<c:param name= "codigo" value= " ${ empresa . codigo } " />
</c:url>
O TOMCAT não processa em tempo real isso… ${empresa.codigo} ?
No JBOSS funciona !
carneiro 21 de set. de 2006
Rodrigo, deve ser questão da versão do Servlet Container.
marciorodr0 30 de jun. de 2009
usa c:out, se não me engano EL assim direto não tem em algumas versões mais antigas do tomcat
[]'s