<%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <%@page import="dao.*, vo.*, utils.*, exceptions.*, exceptions.sql.*"%> <%@page import="java.util.*"%> <% try{ int webPageId = WebUtils.getParameterInt(request, "webPageId");//go to school's main page int schoolId = WebUtils.getParameterInt(request, "schoolId");//if valid go to specific page Database db = new Database();//REVIEW...is this OK? WebDAO webDao = new WebDAO(db); WebVO web = webDao.selectWeb(schoolId); WebPageVO webPage = webDao.selectWebPage(webPageId); WebPageVO mainPage = webDao.selectWebPage(web.getMainPage()); SchoolDAO schoolDao = new SchoolDAO(db); SchoolVO school = schoolDao.selectSchool(schoolId); if(school.getSchoolId()<0 || web.getIsVisible().equals("n")){ response.sendRedirect("/schools/"); } %> ACMAF
<% if(webPage.isValidPage() || mainPage.isValidPage()){ if(!webPage.isValidPage()){ webPage = mainPage; } %> <%=webPage.getTitle()%>

<%=webPage.getContent()%> <% }else{ %> <%=school.getName()%>
<%=school.getCity()%> <%=school.getRegion()%>

Phone: <%=school.getPhone()%>
Address: <%=school.getStreet()%>
<%=school.getStreet2()%>
<%=school.getCity()%> <%=school.getRegionAbbrev()%> <%=school.getZip()%>

Hours: <%=school.getHours()%> <% } %>







<% db.disconnect(); }catch(Exception e){ throw new WebException("homepage.jsp", e.getMessage()); } %>