Skip to content

Instantly share code, notes, and snippets.

@vickie-sl
Last active April 1, 2021 21:29
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setContentType("text/html");
java.util.Map<String, String[]> map = request.getParameterMap();
String param = "";
if (!map.isEmpty()){
String values = map.get("vector");
if (values != null){
param = values[0];
}
}
String bar = htmlEscape(param);
Object[] obj = {"a", bar};
response.getWriter().printf(java.util.Locale.US, "Formatted like: %1$s and %2$s.", obj);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment