Tomcat 8.5.35 gives a strange error when trying to initialize a simple object inside a JSP page.
Here is the error:
and here is the JSP:
<%@page import="dust.One"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>Hello World!</h1>
<%
One o = new One("Joe");
out.println(o.getName());
%>
</body>
</html>
and here is the class
package dust;
public class One {
String name;
public One(String name) {
this.name = name;
}
public String getName() {
return name;
}
}
I have to mention that the same webapp is working just fine in Jetty (9.4.35).
What can it be?
--Edit--
It seems that if the app is packed as .war and deployed on Tomcat through it's Manager web interface it's working fine.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…