Having major problems, really not that good at html, but this is to do with jsp. Basically i have 2 combo box's. The user selects a value from each of them, and these values are sent to my database with the results being printed back to a new html page. So i have my html source here
CODE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>London 2012</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.style4 {
font-size: 14px;
font-weight: bold;
font-style: italic;
}
.style5 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-weight: bold;
font-style: italic;
font-size: 14px;
}
-->
</style>
</head>
<body>
<table width="884"><td width="884"><img src="mainPageTitle.jpg" alt="" name="topPanel" width="884" height="143" border="4"></td>
</table>
<table>
<td background="registerImage.jpg">
<form name="form1" method="post" action="servlet/Register">
<p><span class="style5">Full Name</span><span class="style4">:</span>
<input name="fullName" type="text" id="FullName">
</p>
<p><span class="style5">User Name:</span>
<input name="userName" type="text" id="userName">
</p>
<p><span class="style5">Password</span><span class="style4">:</span>
<input name="passWord" type="text" id="passWord">
</p>
<p align="center">
<input type="submit" name="Submit2" value="Register">
</p>
</form></td>
<td><img name="centerPanel" src="mpCPanel.jpg" width="394" height="472" alt=""></td>
<td height="482" bordercolor="#000099" background="logInImage.jpg">
<form name="form1" method="post" action="servlet/Login">
<p><span class="style5">User Name:</span>
<input name="userName" type="text" id="userName">
</p>
<p><span class="style5">Password: </span>
<input name="passWord" type="text" id="passWord">
</p>
<p align="center">
<input type="submit" name="Submit" value="Login">
</p>
</form></td>
</table>
</body>
</html>
I dont know if i have set it up properly to hold a value in some sort of variable. But then when it comes to my jsp, i am doing this
CODE
import java.io.*;
import java.text.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class SearchEdit extends HttpServlet {
DatabaseSQL dBase = new DatabaseSQL();
public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws IOException, ServletException
{
response.setContentType("text/html");
PrintWriter out = response.getWriter();
out.println("<html>");
out.println("<head>");
String title = "Search/Edit";
out.println("<title>" + title + "</title>");
out.println("</head>");
out.println("<body bgcolor=\"blue\">");
out.println("<h1>" + title + "</h1>");
try{
String eventType = request.getParameter("Events");
String roundType = request.getParameter("Rounds");
List<UpdateEventSetGet> searchResult = dBase.searchRecords(eventType, roundType);
for(int x = 0, y = searchResult.size(); x < y; x++) //loop size of result
{
UpdateEventSetGet update = searchResult.get(x); //put results into objects
out.println(update.getNationality() + "<br>"); //assign each variable of object to a position in JTable
out.println(update.getFirstname() + "<br>");
out.println(update.getLastname() + "<br>");
out.println(update.getTime() + "<br>");
}
}
catch (Exception e) {
out.println("<p>Please make sure you select all required fields");
e.printStackTrace();
}
out.println("<a href=\"../searchEdit.html\">Back</a>");
out.println("</body>");
out.println("</html>");
}
}
When i click on the search button, it takes me to the jsp page but just shows the title. Do i have to make a change to my combo box's or somthing?
any help would be appreciated.
thanks