<%-- hello2.jsp --%> Hello

Hello, <%= getName(request) %>

<%! private static final String DEFAULT_NAME = "World"; private String getName(HttpServletRequest req) { String name = req.getParameter("name"); if (name == null) return DEFAULT_NAME; else return name; } %>