Illegal start of expression?

3 respostas
A

Pessoal,

Olhe esse pedaco de codigo:

public class LoginAction extends CacheHttpServlet implements Action {
public ActionRouter perform(HttpServlet servlet, HttpServletRequest req, HttpServletResponse res) throws java.io.IOException, javax.servlet.ServletException {

String login_usuario = req.getParameter(“login_usuario”);
String login_senha = req.getParameter(“login_senha”);

String SELECT_LOGIN = “SELECT * FROM TB_USUARIO WHERE USR_USUARIO=” + login_usuario + " AND USR_SENHA=" + login_senha;

// PEGANDO O POOL DE CONEXOES

public void init() throws ServletException {

try {

Servlet Context context = getServletContext();

synchronized (context) {

attribute pool = (ConnectionPool) context.getAttribute(pool);

if (pool == null0 {

// Construir um pool usando o INIT

pool = new ConnectionPool(new ContextProperties(context), 3);

context.setAttribute(pool, pool);

}

}

}

catch (Exception e) {

throw new UnavailableException ("Falha na criação do POOL: " + e.getMessage());

}

}

na linha do “public void init() throws ServletException {”
ele acusa erro de illegal start of expression…

O que é isso?
Como posso resolver?

Obrigado a todos.

Allan. :roll:

3 Respostas

danieldestro

Você não fechou o método

public ActionRouter perform()

A

valeu pela resposta, mas nao é isso nao…

Eu fechei sim… é q eu só mandei um pedaco do codigo…

o q mais pode ser???

[]´s

Allan.

Bani

Mas você fechou antes da linha public void init() throws ServletException ?
Você não pode declarar um método dentro de outro método.

Criado 17 de agosto de 2003
Ultima resposta 18 de ago. de 2003
Respostas 3
Participantes 3