Coloque sempre os ; onde você os colocaria em um programa JAVA puro.
Depois da definição dos atributos x e result, por exemplo.
Adelina
Kleber Rodrigo de Carvalho wrote:
> PessALL !!!
> Tenho o seguinte codigo em JSP:
>
> <html>
> <head>
> <title>Untitled</title>
> </head>
>
> <body>
> <%! private int x=2, result%>
>
> <%
> result = Math.PI * Math.pow (x,2) throws IllegalArgumentException {
> if ( (x < 0 ) || ( x > 20) )
> throw new IllegalArgumentException("Out of range.");
> else if (x==0) return 1;
> else return x *(x+1);
> } %>
>
> </body>
> </html>
>
> Mas ao executar este código, dá o seguinte erro:
>
> 500 Servlet Exception
> /krc/teste4.jsp:9: ';' expected.
> private int x=2, result
> ^
> /krc/teste4.jsp:13: ';' expected.
> result = Math.PI * Math.pow (x,2) throws IllegalArgumentException {
> ^
> 2 errors
>
> Quem puder me ajudar, eu agradeço.
>
> Muito obrigado
>
> [] 's
> Kleber Rodrigo de Carvalho
> Software Engineer
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
> ------------------------------ LISTA SOUJAVA ----------------------------
> http://www.soujava.org.br - Sociedade de Usuários Java da Sucesu-SP
> dúvidas mais comuns: http://www.soujava.org.br/faq.htm
> regras da lista: http://www.soujava.org.br/regras.htm
> para sair da lista: envie email para [EMAIL PROTECTED]
> -------------------------------------------------------------------------
------------------------------ LISTA SOUJAVA ----------------------------
http://www.soujava.org.br - Sociedade de Usuários Java da Sucesu-SP
dúvidas mais comuns: http://www.soujava.org.br/faq.htm
regras da lista: http://www.soujava.org.br/regras.htm
para sair da lista: envie email para [EMAIL PROTECTED]
-------------------------------------------------------------------------