protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		response.setContentType("text/html");
		out = response.getWriter();

		try {
			movieid = request.getParameter("movieid");
		} catch (NumberFormatException ex) {
			movieid = null;
		}
		
		if (movieid != null) {
			try {
				conn = ds.getConnection();
				
				movieid = movieid.replace("mid_", "");

				statement = conn.prepareStatement("SELECT * FROM movies WHERE id = ?");
				statement.setString(1, movieid);
				rs = statement.executeQuery();
				rs.last();
				int rows = rs.getRow();
				if (rows > 0) {
					out.println("<div class=\"wrap\">");
					rs.beforeFirst();
					while(rs.next()){
						out.println("<div class=\"list_item\">");
						out.println("<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">");
						out.println("<tr>");
						
						out.println("<td rowspan=\"2\" valign=\"top\">");
						out.println("<div class=\"image\">");
						out.println(String.format("<a href=\"movie?id=%s\">", rs.getString(1)));
						out.println("<div>");
						out.println(String.format("<img alt=\"\" title=\"\" src=\"%s\" />", rs.getString(5)));
						out.println("</div>");
						out.println("</a>");
						out.println("</div>");
						out.println("</td>");
						
						out.println("<td class=\"overview-top\">");
						out.println(String.format("<h4><a href=\"movie?id=%s\" class=\"movie-title\">%s (%s)</a></h4>", rs.getString(1), rs.getString(2), rs.getString(3)));
						out.println("<div class=\"txt-block\">");
						out.println("<h5>Movie ID:</h5>");
						out.println(String.format("<span><span>%s</span></span>", rs.getString(1)));
						out.println("</div>");
						out.println("<div class=\"txt-block\">");
						out.println("<h5>Director:</h5>");
						out.println(String.format("<span><span>%s</span></span>", rs.getString(4)));
						out.println("</div>");
						out.println("<div class=\"txt-block\">");
						out.println("<h5>Stars:</h5>");
						PreparedStatement star_statement = conn.prepareStatement("SELECT s.id, s.first_name, s.last_name FROM stars s, stars_in_movies sim WHERE s.id = sim.star_id AND sim.movie_id = ?");
						star_statement.setInt(1, rs.getInt(1));
						ResultSet star_result = star_statement.executeQuery();
						star_result.last();
						int star_row = star_result.getRow();
						int star_index = 0;
						star_result.beforeFirst();
						while (star_result.next()) {
							star_index++;
							int star_id = star_result.getInt(1);
							String first_name = star_result.getString(2);
							String last_name = star_result.getString(3);
							out.print("<span><span><a href=\"star?id=" + star_id
									+ "\">" + first_name + " " + last_name
									+ "</a></span></span>");
							if (star_index != star_row)
								out.print(", ");
						}
						out.println("</div>");
						out.println("<div class=\"txt-block\">");
						out.println("<h5>Genres:</h5>");
						PreparedStatement genre_statement = conn
								.prepareStatement("SELECT g.* FROM genres g, genres_in_movies gim WHERE g.id = gim.genre_id AND gim.movie_id = ?");
						genre_statement.setInt(1, rs.getInt(1));
						ResultSet genre_result = genre_statement.executeQuery();
						genre_result.last();
						int genre_row = genre_result.getRow();
						int genre_index = 0;
						genre_result.beforeFirst();
						while (genre_result.next()) {
							genre_index++;
							int g_id = genre_result.getInt(1);
							String genre_name = genre_result.getString(2);
							out.print("<span><span><a href=\"result?by=genre&id=" + g_id
									+ "&page=1&size=10&sort=title&order=asc\">" + genre_name
									+ "</a></span></span>");
							if (genre_index != genre_row)
								out.print(", ");
						}
						out.println("</div>");
						out.println("</td>");
						
						out.println("</tr>");
						out.println("</table>");
						out.println("</div>");
					}
					out.println("</div>");
				}
				conn.close();
			} catch (SQLException e1) {
			}
		}
		
		out.close();
	}