hello , im trying to get my edit course to work in my program. my jsp is supposed to display the prerequisites with check boxs so the user can edit them. but i cant figure out how to make it work with jstl.
my couse display
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Course Display</title> </head> <body> <table border="1"> <tr> <th>Code</th> <th>Title</th> <th>Prerequisites</th> <th>operation</th> </tr> <c:forEach items="${entries}" var="entry"> <tr> <td>${entry.code}</td> <td>${entry.title}</td> <td><c:forEach items="${entry.prerequisites}" var="prerequisites"> <c:out value="${prerequisites}" /> </c:forEach> <td><a href="EditCourse?id=${entry.id}">Edit</a></td> </c:forEach> </table> <p> <a href="AddCourse">Add Course</a> </p> <p> <a href="CoursePlanner">Course Planner</a> </p> <c:if test="${not empty user}"> <a href='Logout'>Logout</a> </c:if> <c:if test="${empty user}"> <a href='Registration'>Not Registered?</a><br> <a href='Login'>Login</a><br> </c:if> </body> </html>
my edit course jsp , ive got the title and code working. i just cant pull the prereqs as check boxs
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <jsp:useBean id="gb" class="cs320Homework1.servlet.CourseDisplay" scope="application" /> <!-- param takes the value of what is typed in the edit --> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Edit Course</title> </head> <body> <c:choose> <c:when test="${not empty user}"> <form action="EditCourse" method="post"> Code: <input type="text" name="code" value="${entry.code}" /><br /> Title: <input type="text" name="code" value="${entry.title}" /><br /> <c:forEach items="${entries}" var="entry"> Prerequisite(s): <input type="checkbox" name="selected" value="${entry.prerequisites}"> </c:forEach> <input type="submit" name="edit" value="Edit" /> <input type="hidden" name="id" value="${param.id}" /> </form> <a href='Logout'>Logout</a> </c:when> <c:otherwise> <c:redirect url="Login"></c:redirect> </c:otherwise> </c:choose> </body> </html>