matiasb04 de Mayo del 2006
Preguntaes un programa muy sencillo que debe tomar datos de un jsp y luego tendria q hacer un forward a otro jsp q le muestra un mensaje q la operacion fue con exito, pero no lo hace.
Toma los datos de en http://localhost:8080/MyStruts/Hola.jsp y luego de aceptar tendria que ir a http://localhost:8080/MyStruts/SavedOk.jsp, sin embargo va a http://localhost:8080/MyStruts/book.do.
Alguien q me ayude Muchas Gracias
En el struts-config.xml tengo (en parte):
<struts-config>
<form-beans>
<form-bean name="libroForm" type="net.technisys.curso.LibroForm"/>
</form-beans>
<action-mappings>
<action path="/book" type="net.technisys.curso.LibroAction" name="libroForm" >
<forward name="saved" path="/SavedOk.jsp" />
</action>
</action-mappings>
</struts-config>
En el Hola.jsp tengo:
<%@ taglib uri="WEB-INF/struts-html.tld" prefix="html" %>
<html>
<head>
<title>Testing struts</title>
</head>
<body>
<html:form action="book.do" >
Title/Titulo: <html:text property="title" /><br>
Author/Autor: <html:text property="author" /><br>
<html:submit/>
</html:form>
</body>
</html>
Una cosa, Hola.jsp y SavedOk.jsp se encuentran en la carpeta webapp.
y por si sirve de algo en web.xml hay:
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
Muchas gracias, es que estoy tratando de aprender y me trabo, el ejemplo esta resuelto en http://www.tek271.com/articles/struts/strutsHowTo-0-12.html.
pero a mi no me anda como dice ahi.
Toma los datos de en http://localhost:8080/MyStruts/Hola.jsp y luego de aceptar tendria que ir a http://localhost:8080/MyStruts/SavedOk.jsp, sin embargo va a http://localhost:8080/MyStruts/book.do.
Alguien q me ayude Muchas Gracias
En el struts-config.xml tengo (en parte):
<struts-config>
<form-beans>
<form-bean name="libroForm" type="net.technisys.curso.LibroForm"/>
</form-beans>
<action-mappings>
<action path="/book" type="net.technisys.curso.LibroAction" name="libroForm" >
<forward name="saved" path="/SavedOk.jsp" />
</action>
</action-mappings>
</struts-config>
En el Hola.jsp tengo:
<%@ taglib uri="WEB-INF/struts-html.tld" prefix="html" %>
<html>
<head>
<title>Testing struts</title>
</head>
<body>
<html:form action="book.do" >
Title/Titulo: <html:text property="title" /><br>
Author/Autor: <html:text property="author" /><br>
<html:submit/>
</html:form>
</body>
</html>
Una cosa, Hola.jsp y SavedOk.jsp se encuentran en la carpeta webapp.
y por si sirve de algo en web.xml hay:
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
Muchas gracias, es que estoy tratando de aprender y me trabo, el ejemplo esta resuelto en http://www.tek271.com/articles/struts/strutsHowTo-0-12.html.
pero a mi no me anda como dice ahi.
