Ver Mensaje Individual
  #4 (permalink)  
Antiguo 28/05/2008, 08:29
Avatar de Lino-kun
Lino-kun
 
Fecha de Ingreso: mayo-2008
Ubicación: Cuernavaca Morelos Mexico
Mensajes: 126
Antigüedad: 16 años, 7 meses
Puntos: 2
Respuesta: Struts ayuda please!!

perdon creo que se repitio la primera bueno, esta es la segunda checa este struts-config.xml
Código PHP:
<!-- Data Sources -->
    <
data-sources>
    </
data-sources>

    <!-- 
Form Beans -->
    <
form-beans>
      <
form-bean name="ConsultaForm" type="prueba.form.ConsultaForm">
      </
form-bean>
    </
form-beans>

    <!-- Global 
Exceptions -->
    <global-
exceptions>
    </global-
exceptions>

    <!-- Global 
Forwards -->
    <global-
forwards>
      <
forward name="Error" path="/admin/Error.jsp"></forward>
    </global-
forwards>

    <!-- 
Action Mappings -->
    <
action-mappings>
      <
action path="/consulta" type="prueba.action.ConsultaAction" name="ConsultaForm" scope="request" validate="true" input="/index.jsp">
        <
forward name="main" path="/index.jsp"></forward>
        <
forward name="results" path="/admin/resultados.jsp"></forward>
      </
action>
    </
action-mappings>

    <!-- 
Message Resources -->
    <
message-resources parameter="prueba.resources.ApplicationResources"/> 
si te das cuenta enlazo el action y el form pormedio del name de forma que mi form-bean se llame igual que mi action

y en el web.xml
Código PHP:
<servlet>
        <
servlet-name>action</servlet-name>
        <
servlet-class>
        
org.apache.struts.action.ActionServlet</servlet-class>
        <
init-param>
            <
param-name>config</param-name>
            <
param-value>/WEB-INF/struts-config.xml</param-value>
        </
init-param>
        <
init-param>
            <
param-name>debug</param-name>
            <
param-value>2</param-value>
        </
init-param>
        <
init-param>
            <
param-name>detail</param-name>
            <
param-value>2</param-value>
        </
init-param>
        <
init-param>
            <
param-name>validate</param-name>
            <
param-value>true</param-value>
        </
init-param>
        <
load-on-startup>2</load-on-startup>
    </
servlet>
    <
servlet-mapping>
        <
servlet-name>action</servlet-name>
        <
url-pattern>*.do</url-pattern>
    </
servlet-mapping>
    <
welcome-file-list>
        <
welcome-file>index.html</welcome-file>
        <
welcome-file>index.htm</welcome-file>
        <
welcome-file>index.jsp</welcome-file>
        <
welcome-file>default.html</welcome-file>
        <
welcome-file>default.htm</welcome-file>
        <
welcome-file>default.jsp</welcome-file>
    </
welcome-file-list>
    <
jsp-config>
        <
taglib>
            <
taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
            <
taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
        </
taglib>
        <
taglib>
            <
taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
            <
taglib-location>/WEB-INF/struts-html.tld</taglib-location>
        </
taglib>
        <
taglib>
            <
taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
            <
taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
        </
taglib>
        <
taglib>
            <
taglib-uri>/WEB-INF/struts-nested.tld</taglib-uri>
            <
taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
        </
taglib>
        <
taglib>
            <
taglib-uri>/WEB-INF/struts-template.tld</taglib-uri>
            <
taglib-location>/WEB-INF/struts-template.tld</taglib-location>
        </
taglib>
        <
taglib>
            <
taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>
            <
taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
        </
taglib>
    </
jsp-config
checa diferencias posiblemente te sirva saludos.