Hi everyone, my first time posting here.
My project here has both a jsp and a servlet. The JSP has dropdowns that are populated from a database. It lists all the certifications, qualifications and skills. I am trying to make it into a search engine. The servlet in turn would process what was selected and return a list of employees that meet all the criteria.
So far so good. I got one problem. I want it to be possible to select multiple certifications, or multiple qualifications or multiple skills. I'm not sure how to do this.
Here's the code from my jsp.
<%--
Document : Search credentials
Created on : 20-Jun-2009, 6:33:52 PM
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page import="java.util.List" %>
<%@page import="Classes.*"%>
<%@page import="BusinessLayer.*"%>
<% Business business = new Business();%>
<% List certList = business.getCertifications();%>
<% List qualList = business.getQualifications();%>
<% List skillList = business.getSkill();%>
<% List searchList = business.getSearchResults();%>
<%-- make list accessible to page --%>
<% request.setAttribute("certifications", certList);%>
<% request.setAttribute("qualifications", qualList);%>
<% request.setAttribute("skills", skillList);%>
<% request.setAttribute("search1", searchList);%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>Search Credentials and Availability</h1>
<form ACTION="/ctsdb/SearchProcess" METHOD="POST">
<h2>Certifications</h2><br>
<select name="ddlcerts" >
<c:forEach var="cert" items="" >
<option value="${cert.certificateName}">${cert.certificateName}</option>
</c:forEach>
<input type="Button" name="Add" onclick=" "/>
</select><br><br>
<h2>Qualifications</h2><br>
<select name="ddlqual" >
<c:forEach var="qual" items="${requestScope.qualifications}" >
<option value="${qual.qualificationName}">${qual.qualificationName}</option>
</c:forEach>
</select><br><br>
<h2>Skills</h2><br>
<select name="ddlskills" >
<c:forEach var="skill" items="${requestScope.skills}" >
<option value="${skill.skillName}">${skill.skillName}</option>
</c:forEach>
</select><br><br>
</form>
</body>
</html>
The idea is to have a button next to each drop down that would store the currently selected item in the dropdown.
I was thinking of creating a bean with Arraylists, but I'm not sure how to extract the specific data that is currently highlighted in the dropdown. Any help would be awesome.