Я использую Netbeans версии 8.2 для отработки моего весеннего MVC проекта. Версия IDK по умолчанию, предоставляемая netbeans, составляет 1,8, я использую этот проект для изучения проверки формы. Я использую все библиотеки, необходимые для этого проекта, включая старую версию, сервер, который я использую здесь, GlassFi sh 4.1.1.
мои ошибки здесь:
HTTP Status 500 - Internal Server Error
type Exception report
messageInternal Server Error
descriptionThe server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: PWC6033: Error in Javac compilation for JSP
PWC6199: Generated servlet error:
source value 1.5 is obsolete and will be removed in a future release
PWC6199: Generated servlet error:
target value 1.5 is obsolete and will be removed in a future release
PWC6199: Generated servlet error:
To suppress warnings about obsolete options, use -Xlint:-options.
PWC6199: Generated servlet error:
diamond operator is not supported in -source 1.5
(use -source 7 or higher to enable diamond operator)
PWC6197: An error occurred at line: 23 in the jsp file: /WEB-INF/view/customer-form.jsp
PWC6199: Generated servlet error:
multi-catch statement is not supported in -source 1.5
(use -source 7 or higher to enable multi-catch statement)
PWC6199: Generated servlet error:
diamond operator is not supported in -source 1.5
(use -source 7 or higher to enable diamond operator)
PWC6199: Generated servlet error:
diamond operator is not supported in -source 1.5
(use -source 7 or higher to enable diamond operator)
PWC6199: Generated servlet error:
default methods are not supported in -source 1.5
(use -source 8 or higher to enable default methods)
PWC6199: Generated servlet error:
default methods are not supported in -source 1.5
(use -source 8 or higher to enable default methods)
PWC6197: An error occurred at line: 5 in the jsp file: /WEB-INF/view/customer-form.jsp
PWC6199: Generated servlet error:
diamond operator is not supported in -source 1.5
(use -source 7 or higher to enable diamond operator)
PWC6199: Generated servlet error:
diamond operator is not supported in -source 1.5
(use -source 7 or higher to enable diamond operator)
PWC6199: Generated servlet error:
lambda expressions are not supported in -source 1.5
(use -source 8 or higher to enable lambda expressions)
PWC6199: Generated servlet error:
try-with-resources is not supported in -source 1.5
(use -source 7 or higher to enable try-with-resources)
PWC6197: An error occurred at line: 41 in the jsp file: /WEB-INF/view/customer-form.jsp
PWC6199: Generated servlet error:
diamond operator is not supported in -source 1.5
(use -source 7 or higher to enable diamond operator)
PWC6199: Generated servlet error:
diamond operator is not supported in -source 1.5
(use -source 7 or higher to enable diamond operator)
PWC6199: Generated servlet error:
unknown enum constant javax.annotation.meta.When.MAYBE
reason: class file for javax.annotation.meta.When not found
PWC6199: Generated servlet error:
diamond operator is not supported in -source 1.5
(use -source 7 or higher to enable diamond operator)
PWC6199: Generated servlet error:
diamond operator is not supported in -source 1.5
(use -source 7 or higher to enable diamond operator)
PWC6199: Generated servlet error:
lambda expressions are not supported in -source 1.5
(use -source 8 or higher to enable lambda expressions)
PWC6199: Generated servlet error:
diamond operator is not supported in -source 1.5
(use -source 7 or higher to enable diamond operator)
PWC6197: An error occurred at line: 23 in the jsp file: /WEB-INF/view/customer-form.jsp
PWC6199: Generated servlet error:
lambda expressions are not supported in -source 1.5
(use -source 8 or higher to enable lambda expressions)
PWC6199: Generated servlet error:
diamond operator is not supported in -source 1.5
(use -source 7 or higher to enable diamond operator)
PWC6199: Generated servlet error:
multi-catch statement is not supported in -source 1.5
(use -source 7 or higher to enable multi-catch statement)
PWC6199: Generated servlet error:
lambda expressions are not supported in -source 1.5
(use -source 8 or higher to enable lambda expressions)
PWC6199: Generated servlet error:
diamond operator is not supported in -source 1.5
(use -source 7 or higher to enable diamond operator)
PWC6197: An error occurred at line: 23 in the jsp file: /WEB-INF/view/customer-form.jsp
PWC6199: Generated servlet error:
diamond operator is not supported in -source 1.5
(use -source 7 or higher to enable diamond operator)
PWC6199: Generated servlet error:
default methods are not supported in -source 1.5
(use -source 8 or higher to enable default methods)
PWC6199: Generated servlet error:
lambda expressions are not supported in -source 1.5
(use -source 8 or higher to enable lambda expressions)
PWC6197: An error occurred at line: 5 in the jsp file: /WEB-INF/view/customer-form.jsp
PWC6199: Generated servlet error:
diamond operator is not supported in -source 1.5
(use -source 7 or higher to enable diamond operator)
PWC6197: An error occurred at line: 23 in the jsp file: /WEB-INF/view/customer-form.jsp
PWC6199: Generated servlet error:
default methods are not supported in -source 1.5
(use -source 8 or higher to enable default methods)
PWC6197: An error occurred at line: 25 in the jsp file: /WEB-INF/view/customer-form.jsp
PWC6199: Generated servlet error:
default methods are not supported in -source 1.5
(use -source 8 or higher to enable default methods)
PWC6199: Generated servlet error:
default methods are not supported in -source 1.5
(use -source 8 or higher to enable default methods)
PWC6199: Generated servlet error:
diamond operator is not supported in -source 1.5
(use -source 7 or higher to enable diamond operator)
PWC6199: Generated servlet error:
diamond operator is not supported in -source 1.5
(use -source 7 or higher to enable diamond operator)
PWC6199: Generated servlet error:
lambda expression not expected here
PWC6197: An error occurred at line: 23 in the jsp file: /WEB-INF/view/customer-form.jsp
PWC6199: Generated servlet error:
lambda expression not expected here
PWC6199: Generated servlet error:
lambda expression not expected here
PWC6199: Generated servlet error:
lambda expression not expected here
PWC6197: An error occurred at line: 5 in the jsp file: /WEB-INF/view/customer-form.jsp
PWC6199: Generated servlet error:
default methods are not supported in -source 1.5
(use -source 8 or higher to enable default methods)
PWC6199: Generated servlet error:
lambda expression not expected here
PWC6199: Generated servlet error:
diamond operator is not supported in -source 1.5
(use -source 7 or higher to enable diamond operator)
PWC6197: An error occurred at line: 33 in the jsp file: /WEB-INF/view/customer-form.jsp
PWC6199: Generated servlet error:
diamond operator is not supported in -source 1.5
(use -source 7 or higher to enable diamond operator)
GlassFish Server Open Source Edition 4.1.1
мой клиент. java код:
package springdemo.mvc;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
public class Customer {
private String firstName;
@NotNull(message="is required")
@Size(min=2,message = "Field is required")
private String lastName;
@NotNull(message="is required")
@Min(value=0,message="must be greater than or equal to zero")
@Max(value=10,message="must be less than or equal to 10")
private Integer freePasses;
@Pattern(regexp="^[a-zA-Z0-9]{5}",message="only 5 chars/digit")
private String postalCode;
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public void setFreePasses(Integer freePasses) {
this.freePasses = freePasses;
}
public void setPostalCode(String postalCode) {
this.postalCode = postalCode;
}
public String getFirstName() {
return firstName;
}
public String getLastName() {
return lastName;
}
public Integer getFreePasses() {
return freePasses;
}
public String getPostalCode() {
return postalCode;
}
}
Моя форма клиента. jsp файл:
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Customer form</title>
<style>
.error{color:red}
</style>
</head>
<body>
<ul><li>Fill out the form. Asterisk(*) means required</li></ul>
<form:form action="processForm" modelAttribute="customer">
First Name : <form:input path="firstName"/>
Last Name(*) : <form:input path="lastName"/>
<p><form:errors name="lastName" cssClass="error"/></p>
Free Passes = <form:input path="freePasses"/>
<form:errors name="freePasses" cssClass="error"/>
Postal Code = <form:input path="postalCode"/>
<form:errors name="postalCode" cssClass="error"/>
<form:input path="submit"/>
</form:form></body></html>
Пожалуйста, помогите мне в этом.