When I compile my JSP page, it does not seem to work since it doesn't resolve the System
class. I need to get the time in milliseconds so I can input it in the DB
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: [63] in the jsp file: [/VerifyBid.jsp]
System cannot be resolved
60: + "VALUES(?,?)"; // this is just a segment of the SQL Query
61: ps = con.prepareStatement(insert);
62: ps.setString(1, bid);
63: ps.setTimestamp(2, new Timestamp(System.currentTimeMillis()));
64: ps.executeUpdate();
65:
Here are my imports:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ page import="java.io.*,java.util.*,java.sql.*,java.time.LocalDateTime,java.time.format.DateTimeFormatter,java.lang.*"%>
<%@ page import="javax.servlet.http.*,javax.servlet.*"%>
<%@ page import="com.dbapp.*" %>
I tried going into my project properties and making sure I had the most up to date JRE. I also made sure my imports were correct, which they appear to be. This is the only time I use the System class anywhere in my program so it is the only file that seems to be messed up.
It turns out that the issue was that the version of Apache Tomcat I was using was having trouble with the JRE. I solved this by using the latest version of Apache, which would happen to be version 10 at the time of this writing.