%@ page import="uk.org.mafoo.wordsearch.*" %>
<%@ page import="java.util.*" %>
<%@ page import="org.apache.commons.lang.StringUtils" %>
<%@ page import="org.apache.commons.lang.StringEscapeUtils" %>
<%@ page errorPage="error.jsp" %>
<%
int height = Integer.parseInt(request.getParameter("height"));
int width = Integer.parseInt(request.getParameter("width"));
Modes mode = Modes.NORMAL;
if(request.getParameter("mode") != null) {
if(request.getParameter("mode").equals("SIMPLE")) mode = Modes.SIMPLE;
if(request.getParameter("mode").equals("CROSSWORD")) mode = Modes.CROSSWORD;
}
String name = StringEscapeUtils.escapeHtml(request.getParameter("name"));
if (request.getParameter("words").length() > 2048) { throw new Exception("Input too large"); }
if (height > 100 || width > 100) { throw new Exception("Dimensions too large"); }
List<%= name %>
Grid
<% for(char[] row : grid) { %>
<% for(char c : row) {
csv += "" + c + ',';
%>
<%
csv += "\\n";
}
%>
<%= c != Character.UNASSIGNED ? c : " " %>
<% } %>
Words
<% for (String word : words) { %>
<%@include file="/WEB-INF/jspf/footer.jspf" %>