You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ruben <ru...@yahoo.es> on 2003/06/19 20:17:04 UTC

newbie q why this doesn`t work?

Hi everybody, i’ve got the next problem.
I’ve got a 404 when I click on the link that I show below. The action
retrieve the data from model(and it is called), but when redirect it
doesn’t show the jsp.
 
Persistencia.jsp is on the root , with inicio.jsp
 
This is my struts-config.xml
…..
<action
               input="/Persistencia.jsp" name="persistenciaForm"
               parameter="method" path="/Persistencia" scope="request"
               type="struts.persistencia.PersistenciaAction"
                    validate="false">                               
                                   <set-property
                    property="inicioResults" value="true"/>
                <forward name="mostrado"
                    path="/Persistencia.jsp" redirect="true"/>
   </action>
 
and the jsp that call the action is …
…
<html:link style="color:blue;" action="/Persistencia.do?method=muestra">
aqui </html:link>
 
…
 
the action class is simple 
 
public ActionForward muestra(ActionMapping mapping,
                                  ActionForm form,
                                  HttpServletRequest request,
                                  HttpServletResponse response) throws
IOException,ServletException
      {
 
      //En este método encapsulamos la funcionalidad del controlador
      
      String target=new String("mostrado");
      
      
      HttpSession s = request.getSession(true);
      
      IPedirHabitaciones pedir =
(IPedirHabitaciones)FactoriaEJB.createEJB("PedirHabitacionesBean");
      s.setAttribute("habitaciones",pedir.habitacionesLibres());
      
      
      
            System.out.println(mapping.getPath());
            return mapping.findForward(target);      
      }
 
thanks and best regards

RE: newbie q why this doesn`t work?

Posted by ruben <ru...@yahoo.es>.
Thanks Mike,

But i think that it find it because it do the work of the method
muestra, I mean, it call the EJB, and do the work of this DispatchAction
method, it redirect to a 404 for target mostrado.


-----Mensaje original-----
De: Mike Jasnowski [mailto:mjasnows@bea.com] 
Enviado el: jueves, 19 de junio de 2003 20:20
Para: Struts Users Mailing List
Asunto: RE: newbie q why this doesn`t work?

Are you by chance using a dispatch action? From appearances you might
be.
In the case of DispatchActions when it can't find the method you named,
it
calls a supplied method named "unspecified()". The default
implementation of
this method returns a 404 I believe.

-----Original Message-----
From: ruben [mailto:ruospalo@yahoo.es]
Sent: Thursday, June 19, 2003 2:17 PM
To: 'Struts Users Mailing List'
Subject: newbie q why this doesn`t work?


Hi everybody, i’ve got the next problem.
I’ve got a 404 when I click on the link that I show below. The action
retrieve the data from model(and it is called), but when redirect it
doesn’t show the jsp.

Persistencia.jsp is on the root , with inicio.jsp

This is my struts-config.xml
…..
<action
               input="/Persistencia.jsp" name="persistenciaForm"
               parameter="method" path="/Persistencia" scope="request"
               type="struts.persistencia.PersistenciaAction"
                    validate="false">
                                   <set-property
                    property="inicioResults" value="true"/>
                <forward name="mostrado"
                    path="/Persistencia.jsp" redirect="true"/>
   </action>

and the jsp that call the action is …
…
<html:link style="color:blue;" action="/Persistencia.do?method=muestra">
aqui </html:link>

…

the action class is simple

public ActionForward muestra(ActionMapping mapping,
                                  ActionForm form,
                                  HttpServletRequest request,
                                  HttpServletResponse response) throws
IOException,ServletException
      {

      //En este método encapsulamos la funcionalidad del controlador

      String target=new String("mostrado");


      HttpSession s = request.getSession(true);

      IPedirHabitaciones pedir =
(IPedirHabitaciones)FactoriaEJB.createEJB("PedirHabitacionesBean");
      s.setAttribute("habitaciones",pedir.habitacionesLibres());



            System.out.println(mapping.getPath());
            return mapping.findForward(target);
      }

thanks and best regards


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: newbie q why this doesn`t work?

Posted by Mike Jasnowski <mj...@bea.com>.
Are you by chance using a dispatch action? From appearances you might be.
In the case of DispatchActions when it can't find the method you named, it
calls a supplied method named "unspecified()". The default implementation of
this method returns a 404 I believe.

-----Original Message-----
From: ruben [mailto:ruospalo@yahoo.es]
Sent: Thursday, June 19, 2003 2:17 PM
To: 'Struts Users Mailing List'
Subject: newbie q why this doesn`t work?


Hi everybody, i’ve got the next problem.
I’ve got a 404 when I click on the link that I show below. The action
retrieve the data from model(and it is called), but when redirect it
doesn’t show the jsp.

Persistencia.jsp is on the root , with inicio.jsp

This is my struts-config.xml
…..
<action
               input="/Persistencia.jsp" name="persistenciaForm"
               parameter="method" path="/Persistencia" scope="request"
               type="struts.persistencia.PersistenciaAction"
                    validate="false">
                                   <set-property
                    property="inicioResults" value="true"/>
                <forward name="mostrado"
                    path="/Persistencia.jsp" redirect="true"/>
   </action>

and the jsp that call the action is …
…
<html:link style="color:blue;" action="/Persistencia.do?method=muestra">
aqui </html:link>

…

the action class is simple

public ActionForward muestra(ActionMapping mapping,
                                  ActionForm form,
                                  HttpServletRequest request,
                                  HttpServletResponse response) throws
IOException,ServletException
      {

      //En este método encapsulamos la funcionalidad del controlador

      String target=new String("mostrado");


      HttpSession s = request.getSession(true);

      IPedirHabitaciones pedir =
(IPedirHabitaciones)FactoriaEJB.createEJB("PedirHabitacionesBean");
      s.setAttribute("habitaciones",pedir.habitacionesLibres());



            System.out.println(mapping.getPath());
            return mapping.findForward(target);
      }

thanks and best regards


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org