A couple of questions:
If I have mapped a Customer with an i-var
List<Order> orders
with annotation CascadeType.ALL, should I also set the relation in MySQL InnoDBON DELETE CASCADE
? Or will these interfer?Is it necessary to say
<%@page contentType="text/html" pageEncoding="UTF-8"%>
in every JSP file? Can I set this as a configuration parameter in web.xml somehow instead?Is is possible to have the compiler check the servlet mapping url's and the url's in the JSP for you, or somehow enforce that they're in sync? Example: in web.xml
<url-pattern>/login</url-pattern>
, and in login.jsp:<c:url value="/loginn" />
(note the extra n).What's the difference between
<c:out value="${value}" />
and just ${value}, both seem to work (except when you want a default value)? When should I use which?Is there a better way to validate input parameters (from a form) in a servlet:
String possibleUserID = request.getParameter("userid"); if(possibleUserID == null){ errors.add("User-ID must be exist"); } else { if(possibleUserID.trim().length() == 0){ errors.add("User-ID must be filled in"); } // etc }
without a web-framework of some kind?