implementato esercizio studenti con collegamento da client via interfaccia remota
This commit is contained in:
@@ -47,6 +47,10 @@ public class Servlettest2 extends HttpServlet {
|
||||
class_with_builtin_constraints class_with_builtin_constraints;
|
||||
|
||||
|
||||
@Inject
|
||||
class_test_method class_test_method;
|
||||
|
||||
|
||||
protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
|
||||
response.setContentType("text/html;charset=UTF-8");
|
||||
try (PrintWriter out = response.getWriter()) {
|
||||
@@ -61,6 +65,10 @@ public class Servlettest2 extends HttpServlet {
|
||||
out.println("<h1>Servlet xg at " + request.getContextPath() + "</h1>");
|
||||
|
||||
|
||||
///////////////// check null return
|
||||
//class_test_method.test_method();
|
||||
//out.println("Test Null without validator");
|
||||
//out.println("<br>");
|
||||
|
||||
|
||||
///////////////// entire class validation
|
||||
@@ -123,7 +131,7 @@ public class Servlettest2 extends HttpServlet {
|
||||
|
||||
|
||||
out.println("<br>");
|
||||
//////////////// check single property
|
||||
//////////////// check single property without make an instance of the object
|
||||
Set<ConstraintViolation<class_with_builtin_constraints>> violations7 = validator.validateValue(class_with_builtin_constraints.class, "title", "aabb");
|
||||
if (violations7.size() > 0) out.println("error"); else out.println("tutto ok");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user