package pacote;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet("/CalculaServlet")
public class CalculaServlet extends HttpServlet {

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		
	}

}

@@ -30,32 +30,33 @@
 io.IOException;%0A
+%0A
 import javax.ser
@@ -457,16 +457,1127 @@
 ption %7B%0A
+%09%09// obter dados%0A%09%09String s0p1 = request.getParameter(%22operando1%22);%0A%09%09String s0p2 = request.getParameter(%22operando2%22);%0A%09%09String operacao = request.getParameter(%22operacao%22);%0A%09%09%0A%09%09// processar dados%0A%09%09double operando1 = Double.parseDouble(s0p1);%0A%09%09double operando2 = Double.parseDouble(s0p2);%0A%09%09double resultado = 0;%0A%09%09%0A%09%09if(operacao.equals(%22+%22)) %7B%0A%09%09%09resultado = operando1 + operando2;%0A%09%09%7D else if(operacao.equals(%22-%22)) %7B%0A%09%09%09resultado = operando1 - operando2;%0A%09%09%7D else if(operacao.equals(%22/%22)) %7B%0A%09%09%09resultado = operando1 / operando2;%0A%09%09%7D else if(operacao.equals(%22x%22)) %7B%0A%09%09%09resultado = operando1 * operando2;%0A%09%09%7D else %7B%0A%09%09%09// ERRO!!!%0A%09%09%09request.setAttribute(%22tipoErro%22, %22operacao invalida%22);%0A%09%09%09request.getRequestDispatcher(%22../erros/erro.jsp%22).forward(request, response);%0A%09%09%09return;%0A%09%09%7D%0A%09%09%0A%09%09// encaminhar resultados para o visual%0A%09%09CalculaBean bean = new CalculaBean();%0A%09%09bean.setOp1(operando1);%0A%09%09bean.setOp2(operando2);%0A%09%09bean.setOperador(operacao);%0A%09%09bean.setResultado(resultado);%0A%09%09request.setAttribute(%22conta%22, bean);%0A%09%09request.getRequestDispatcher(%22calculadora/resultado.jsp%22).forward(request, response);%0A
 %09%09%0A%09%7D%0A%0A%7D

Update CalculaServlet.java