Estou tentando desenvolver um algoritmo web que calcule Bhaskara, porém consta o erro HTTP Status 500 - Internal Server Error
Segue codigo bhaskara.jsp
<%@page import="br.bhaskara.Bhaskara"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Calcular Bhaskara</title>
</head>
<body>
<h1>Calcular Bhaskara</h1>
<hr>
<%
float a, b, c, delta, x;
a = Float.parseFloat(request.getParameter("a"));
b = Float.parseFloat(request.getParameter("b"));
c = Float.parseFloat(request.getParameter("c"));
delta = Float.parseFloat(request.getParameter("delta"));
x = Float.parseFloat(request.getParameter("x"));
Bhaskara bhaskara = new Bhaskara();
bhaskara.setA(a);
bhaskara.setB(b);
bhaskara.setC(c);
bhaskara.setDelta(delta);
bhaskara.setX(x);
%>
<strong>Dado Informados: </strong>
<ul>
<li><strong>Defina o valor de a: </strong><%= a%></li>
<li><strong>Defina o valor de b: </strong><%= b%></li>
<li><strong>Defina o valor de c: </strong><%= c%></li>
</ul>
<hr>
<strong>Calculo de Delta: </strong>
<ul>
<li><strong>Delta: </strong><%=String.format("%.2f",bhaskara.calcularDelta())%></li>
<li><strong>x1: </strong><%= bhaskara.getDelta()%></li>
</ul>
</body>
</html>
Segue código bhaskara.java
package br.bhaskara;
import java.util.Scanner;
public class Bhaskara {
private float a;
private float b;
private float c;
private float delta;
private float x;
public float getA() {
return a;
}
public void setA(float a) {
this.a = a;
}
public float getB() {
return b;
}
public void setB(float b) {
this.b = b;
}
public float getC() {
return c;
}
public void setC(float c) {
this.c = c;
}
public float getDelta() {
return delta;
}
public void setDelta(float delta) {
this.delta = delta;
}
public float getX() {
return x;
}
public void setX(float x) {
this.x = x;
}
public double calcularDelta(){
delta = (b*b) - 4 * a * c;
return delta;
}
public float valorX(){
float x1,x2;
x1 = (float) (-b + Math.sqrt(delta) / (2 * a));
x2 = (float) (-b - Math.sqrt(delta) / (2 * a));
return x;
}