donde esta el error (String)
Publicado por OScaro (21 intervenciones) el 07/11/2007 06:43:32
Saludos, veran estoy haciendo mi aplicacion JSP. la cual es un formulario
para crear un catalogo de uniades de medida.
La pagina se invoca a si misma, para anexar y mostrar los datos en si misma.
la idea es que al presionar el boton guardar marca error la linea indicada......
y todavia no entiendo porque.....
cualquier ayuda gracias de antemano..
estoy utilizando tomcat 6.0 y jdk 1.5.0
<%
String comando = "";
DataAcess da = new DataAcess();
comando = request.getParameter("cmd");
if ( comando.equals( "add" ) ) <--------- Aqui me marca error porque ?
{
String descripcion = request.getParameter("descripcion");
String unidad = request.getParameter("unidad");
UnidadesMed med = new UnidadesMed();
med.setDescripcion( descripcion );
med.setUnidad( unidad );
da.InsertUnidadMed( med );
}
%>
<form method="post" action="unidades.jsp">
<input type="hidden" name="cmd" value="add">
<fieldset>
<legend>Agregar unidad de medida</legend>
<table width="315" border="0">
<tr>
<td>Nombre <input type="text" size="15" name="descripcion" maxlength="40"></td>
<td>Iniciales <input type="text" size="15" name="unidad" maxlength="4"></td>
</tr>
<tr>
<td colspan="2" align="right">
<input type="submit" value="Grabar">
</td>
</tr>
</table>
</fieldset>
</form>
<br>
<br>
<h3>Unidades de medida existentes</h3>
<table width="300">
<tr>
<td nowrap><b>DESCRIPCION</b></td>
<td nowrap><b>UNIDAD</b></td>
</tr>
<%
ArrayList al = new ArrayList();
al = da.Catalogo_Unidades();
UnidadesMed med = null;
//if(al != null)
{
Iterator it = al.iterator();
while ( it.hasNext() )
{
med = (UnidadesMed) it.next();
out.println("<tr><td>" + med.getDescripcion() + "</td>");
out.println("<td>" + med.getUnidad() + "</td></tr>\n");
}
}
%>
</table>
para crear un catalogo de uniades de medida.
La pagina se invoca a si misma, para anexar y mostrar los datos en si misma.
la idea es que al presionar el boton guardar marca error la linea indicada......
y todavia no entiendo porque.....
cualquier ayuda gracias de antemano..
estoy utilizando tomcat 6.0 y jdk 1.5.0
<%
String comando = "";
DataAcess da = new DataAcess();
comando = request.getParameter("cmd");
if ( comando.equals( "add" ) ) <--------- Aqui me marca error porque ?
{
String descripcion = request.getParameter("descripcion");
String unidad = request.getParameter("unidad");
UnidadesMed med = new UnidadesMed();
med.setDescripcion( descripcion );
med.setUnidad( unidad );
da.InsertUnidadMed( med );
}
%>
<form method="post" action="unidades.jsp">
<input type="hidden" name="cmd" value="add">
<fieldset>
<legend>Agregar unidad de medida</legend>
<table width="315" border="0">
<tr>
<td>Nombre <input type="text" size="15" name="descripcion" maxlength="40"></td>
<td>Iniciales <input type="text" size="15" name="unidad" maxlength="4"></td>
</tr>
<tr>
<td colspan="2" align="right">
<input type="submit" value="Grabar">
</td>
</tr>
</table>
</fieldset>
</form>
<br>
<br>
<h3>Unidades de medida existentes</h3>
<table width="300">
<tr>
<td nowrap><b>DESCRIPCION</b></td>
<td nowrap><b>UNIDAD</b></td>
</tr>
<%
ArrayList al = new ArrayList();
al = da.Catalogo_Unidades();
UnidadesMed med = null;
//if(al != null)
{
Iterator it = al.iterator();
while ( it.hasNext() )
{
med = (UnidadesMed) it.next();
out.println("<tr><td>" + med.getDescripcion() + "</td>");
out.println("<td>" + med.getUnidad() + "</td></tr>\n");
}
}
%>
</table>
Valora esta pregunta


0