Background:
I use JDK1.8 and tomcat8.0, but I encounter the following two problems
then I made a new tomcat, and its version is as follows:
and it succeeded…..
The reason: Tomcat version is higher than JDK version
In addition, I have problems with my code
here is the error code:
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib tagdir="/WEB-INF/tags" prefix="computer"%>
<html>
The three values entered a,b,c (representing the three sides of a triangle or the upper base, lower base and height of a trapezoid);
<body color=cyan>
<form action="" method=get name=form>
<%--Get parameters to submit to yourself--%>
<table>
<tr><td>Enter value a: </td>
<td><input type="text" name="a"></td>
</tr>
<tr><td>input value b: </td>
<td><input type="text" name="b"></td>
</tr>
<tr><td>input value c: </td>
<td><input type="text" name="c"></td>
</tr>
</table>
<input type="radio" name="r" value="triangle">stands for triangle
<input type="radio" name="r" value="lader">stands for trapezoid
<br>
<input type="submit" name="submit" value="submit" name=submit>stands for submit button
</form>
<% String a=request.getParameter("a");
String b=request.getParameter("b");
String c=request.getParameter("c");
String cd=request.getParameter("r");
if(a==null||b==null||c==null){
a="0";
b="0";
c="0";
cd="0";
}
if(a.length()>0&&b.length()>0&&c.length()>0){
%>
<computer:Getarea numberA="<%=a%>" numberB="<%=b%>"
numberC="<%=c%>" condition="<%=cd%>"/>
<br><%= message%>
<br><%= area %>
<% }
%>
</body>
</html>
The reason for the error is that there are two more spaces. The error report is the same
here is the correct code:
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib tagdir="/WEB-INF/tags" prefix="computer"%>
<html>
The three values entered a,b,c (representing the three sides of a triangle or the upper base, lower base and height of a trapezoid);
<body color=cyan>
<form action="" method=get name=form>
<%--Get parameters to submit to yourself--%>
<table>
<tr><td>Enter value a: </td>
<td><input type="text" name="a"></td>
</tr>
<tr><td>input value b: </td>
<td><input type="text" name="b"></td>
</tr>
<tr><td>input value c: </td>
<td><input type="text" name="c"></td>
</tr>
</table>
<input type="radio" name="r" value="triangle">stands for triangle
<input type="radio" name="r" value="lader">stands for trapezoid
<br>
<input type="submit" name="submit" value="submit" name=submit>stands for submit button
</form>
<% String a=request.getParameter("a");
String b=request.getParameter("b");
String c=request.getParameter("c");
String cd=request.getParameter("r");
if(a==null||b==null||c==null){
a="0";
b="0";
c="0";
cd="0";
}
if(a.length()>0&&b.length()>0&&c.length()>0){
%>
<computer:Getarea numberA="<%=a%>" numberB="<%=b%>"
numberC="<%=c%>" condition="<%=cd%>"/>
<br><%=message%>
<br><%=area %>
<% }
%>
</body>
</html>
Read More:
- The server internal error that prevented it from fulfilling this request Error (Fixed)
- HTTP status 500 – internal server error (resolved) for Tomcat running project
- Ant Design ‘cross env’ is not an internal or external command, nor is it an error reporting problem for a runnable program
- Flask Request an extension before_request after_request errorhandler
- The file server reports an error of 413, and the file uploaded by nginx reports an error of 413 request entity too large
- Dell server reported CPU 1 has an internal error (ierr)
- The Vue project is packaged and deployed to tomcat, and an Error 404 is reported as soon as it is refreshed
- Server Tomcat v8.0 Server at localhost failed to start.
- [Solved] Tomcat Failed to Start Error: Server Tomcat v8.5 Server at localhost failed to start
- Solve the problem of There was an unexpected error (type=Internal Server Error, status=500) (using Thymeleaf to report an error)
- Server Tomcat v7.0 server at localhost failed to start
- When a system is deployed on weblogic12.2.1.3, it reports an error “IllegalStateException zip file closed”. When it is deployed on weblogic12.2.1.2, it does not report an error and can be accessed normally.
- When docker starts tomcat, the access port of the container displays 404, and the source server fails to find the representation of the target resource or is unwilling to disclose an existing one
- The web project removal server reports an error, and the web project in eclipse cannot be automatically deployed to Tomcat
- Tomcat error parsing HTTP request header
- Could not publish server configuration for Tomcat v8.5 server at localhost
- After node.js is installed, use the instruction node version in vscode to show that it is not an external or internal instruction. The solution is as follows:
- TIDB-kafka server: Message was too large, server rejected it to avoid allocation error
- Linux Tomcat accessing files on the server
- The installation of Homebrew encountered a 400 Bad Request error