JSP (Java Server Page) - HTTP Status 404

 
Vista:
sin imagen de perfil

HTTP Status 404

Publicado por Adrian (10 intervenciones) el 13/02/2007 05:03:36
Estoy haciendo un html que invoca a un jsp este esta dentro del WEB-INF y a su vez dentro de un folder llamado mypacke. el tema es que me aparece el siguiente error. Les paso los dos archivos a ver si alguien tiene una idea

gracias

adrian

HTTP Status 404 - /mypackage.Categorie.jsp

--------------------------------------------------------------------------------

type Status report

message /mypackage.Categorie.jsp

description The requested resource (/mypackage.Categorie.jsp) is not available.

Categories.html

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<html>
<head>
	<title>Categories</title>
</head>
 
<body>
<h1>Categories</h1>
 
<p>
 
<form ACTION="/BookStore/mypackage.Categorie.jsp">
	A simple example to find information about a place in the United Kingdom.<br>
	Enter place name
	<input type=text name=place><br>
	<input type=submit value="Search database">
 
</form>
 
<p>
 
</body>
</html>
Categorie.jsp
 
<html>
<head>
	<%@ page
 
		package mypackage;
 
		import = "java.io.*"
		import = "java.lang.*"
		import = "java.sql.*"
		import = "java.lang.Object.*";
	%>
 
	<title>JSP Example 2 </title>
</head>
 
<body>
 
<h1>JSP Example 3</h1>
 
<%
	String	place;
	Connection dbconn;
	ResultSet results;
	PreparedStatement sql;
	try
	{
	Class.forName("com.mysql.jdbc.Driver");
	try
	{
		int	CategorieId;
		String Name;
		String Coments;
		boolean	doneheading = false;
 
		dbconn = DriverManager.getConnection("jdbc:mysql://localhost/ryersonbooks","root","");
		place = request.getParameter("place");
		sql = dbconn.prepareStatement("SELECT * FROM Categories WHERE Name = '" + place + "'");
		results = sql.executeQuery();
 
		while(results.next())
		{
		    if(! doneheading)
		   {
			out.println("<table border=2>");
			doneheading = true;
		  }
								CategorieId = results.getInt("CategorieId");
	Name        = results.getString("Name");
	Coments     = results.getString("Coments");
		out.println("<tr><td>" + CategorieId);
		out.println("<td>" + Name);
		out.println("<td>" + Coments);
	}
 
	if(doneheading)
	{
		out.println("</table>");
	}
	else
	{
		out.println("No matches for " + place);
	}
                  }
	catch (SQLException s)
	{
		out.println("SQL Error<br>");
	}
	}
	catch (ClassNotFoundException err)
	{
	   out.println("Class loading error");
                     }
%>
 
</body>
</html>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
sin imagen de perfil

RE:HTTP Status 404

Publicado por camus (89 intervenciones) el 13/02/2007 15:29:40
Hola, por lo que puedo ver estas haciendo conexiones a base de datos y de igual forma consultas SQL y esto no es muy recomendable hacerlo asi que te aconsejo que las conexiones a bases de datos y manipulación de la misma la realizas del lado del servlet (en clases java) con esto evitaras problemas como el que te esta pasando. Se que será un poquitin de más trabajo pero en lo futuro te daras cuenta de los beneficios que te traera implementar tus programas de esta forma.

saludos
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

RE:HTTP Status 404

Publicado por Adrian (10 intervenciones) el 13/02/2007 17:51:20
te agradezco por la recomendacion pero ya trate de todas formas posibles puede ser alguna otra cosa???

gracias

Adrian
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar