You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Francisco Hernandez <fh...@fhernandez.net> on 2002/04/09 22:24:33 UTC

problem trying to use my own actions

i just cant get struts to use my own actions..

struts-config.xml snipplets:
  <global-forwards type="org.apache.struts.action.ActionForward">
        <forward name="editVenue" path="/editVenue.jsp"/>
    </global-forwards>

<action-mappings type="org.apache.struts.action.ActionMapping">
   <action path="/createVenue"
            type="venue.action.CreateVenueAction"
            name="venueForm">
   </action>
</action-mappings>

this is my class:

public class CreateVenueAction extends Action {
    public ActionForward perform(ActionMapping mapping,
                                 ActionForm form,
                                 ServletRequest request,
                                 ServletResponse response)
            throws IOException, ServletException {

        Util.println("IN CREATE VENUE ACTION");
        return mapping.findForward("editVenue");
    }
}

what am i missing? i just cant seem to get struts to execute my action.. and
goto the specified forward

is there a way to put struts into a 'verbose' mode so i can see just exactly
what action was executed, the url, etc?



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: problem trying to use my own actions

Posted by Francisco Hernandez <fh...@fhernandez.net>.
after much heart ache i finalley found the damm problem.. in my class
should have been:
>     public ActionForward perform(ActionMapping mapping,
>                                  ActionForm form,
>                                  HttpServletRequest request,
>                                  HttpServletResponse response)
>             throws IOException, ServletException {

NOT:

>     public ActionForward perform(ActionMapping mapping,
>                                  ActionForm form,
>                                  ServletRequest request,
>                                  ServletResponse response)
>             throws IOException, ServletException {

thanks all for the help :)


----- Original Message -----
From: "Francisco Hernandez" <fh...@fhernandez.net>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Tuesday, April 09, 2002 1:24 PM
Subject: problem trying to use my own actions


> i just cant get struts to use my own actions..
>
> struts-config.xml snipplets:
>   <global-forwards type="org.apache.struts.action.ActionForward">
>         <forward name="editVenue" path="/editVenue.jsp"/>
>     </global-forwards>
>
> <action-mappings type="org.apache.struts.action.ActionMapping">
>    <action path="/createVenue"
>             type="venue.action.CreateVenueAction"
>             name="venueForm">
>    </action>
> </action-mappings>
>
> this is my class:
>
> public class CreateVenueAction extends Action {
>     public ActionForward perform(ActionMapping mapping,
>                                  ActionForm form,
>                                  ServletRequest request,
>                                  ServletResponse response)
>             throws IOException, ServletException {
>
>         Util.println("IN CREATE VENUE ACTION");
>         return mapping.findForward("editVenue");
>     }
> }
>
> what am i missing? i just cant seem to get struts to execute my action..
and
> goto the specified forward
>
> is there a way to put struts into a 'verbose' mode so i can see just
exactly
> what action was executed, the url, etc?
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: problem trying to use my own actions

Posted by Francisco Hernandez <fh...@fhernandez.net>.
----- Original Message -----
From: "Jay sissom" <js...@toybox.uits.indiana.edu>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Tuesday, April 09, 2002 2:25 PM
Subject: Re: problem trying to use my own actions


> Lots of questions:
>
> 1.  Is your action servlet loading?  Your log files should tell you that.

my action servlet is loading correctly, i have an index.jsp page that can
use the struts tags logic:notPresent for testing if
org.apache.struts.action.MESSAGE is under the application scope and a few
html:link tags that work fine, the app server apps display some of struts's
message when loading

> 2.  Do you have a mapping for *.do to your action servlet in your web.xml
> file?

yes I do.

> 3.  Did you try to access /webapp/createVenue.do (where webapp is the
> context name of your web app)?

when i access /webapp/createVenue.do i just get a blank 0 byte page returned


in my struts config i have these simple mappings that do infact work
correctly,

    <action path="/test" forward="/index.jsp"></action>
    <action path="/admin/reload"
type="org.apache.struts.actions.ReloadAction" />

its just my own CreateVenueAction action that does not want to work



>
> Jay
>
> On Tue, 9 Apr 2002, Francisco Hernandez wrote:
>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: problem trying to use my own actions

Posted by Jay sissom <js...@toybox.uits.indiana.edu>.
Lots of questions:

1.  Is your action servlet loading?  Your log files should tell you that.
2.  Do you have a mapping for *.do to your action servlet in your web.xml 
file?
3.  Did you try to access /webapp/createVenue.do (where webapp is the 
context name of your web app)?

Jay

On Tue, 9 Apr 2002, Francisco Hernandez wrote:

> hmm..
> I already had my action servlet loaded with those params
> 
> Ive been trying to get this working but I just get a black 0 byte page
> returned.. tried the same code on 2 different app servers, orion and reson
> under jdk1.4
> 
> dont know whats going on.. im really lost now
> 
> ----- Original Message -----
> From: "Enrique Rodriguez" <la...@telefonica.net>
> To: "Struts Users Mailing List" <st...@jakarta.apache.org>
> Sent: Tuesday, April 09, 2002 2:00 PM
> Subject: RE: problem trying to use my own actions
> 
> 
> >
> > HI,
> >
> > -you can config the verbose option in web.xml, when you load the config
> > servlet, here the example.
> >
> >   <servlet>
> >     <servlet-name>action</servlet-name>
> >     <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
> >     <init-param>
> >       <param-name>application</param-name>
> >       <param-value>com.yourcompany.ApplicationResources</param-value>
> >     </init-param>
> >     <init-param>
> >       <param-name>config</param-name>
> >       <param-value>/WEB-INF/struts-config.xml</param-value>
> >     </init-param>
> > <!--verbose-->
> >     <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>
> > _____________________________
> > Enrique Rodriguez Lasterra
> >
> >
> >
> > > -----Mensaje original-----
> > > De: Francisco Hernandez [mailto:fhernandez@fhernandez.net]
> > > Enviado el: martes, 09 de abril de 2002 22:25
> > > Para: Struts Users Mailing List
> > > Asunto: problem trying to use my own actions
> > >
> > >
> > > i just cant get struts to use my own actions..
> > >
> > > struts-config.xml snipplets:
> > >   <global-forwards type="org.apache.struts.action.ActionForward">
> > >         <forward name="editVenue" path="/editVenue.jsp"/>
> > >     </global-forwards>
> > >
> > > <action-mappings type="org.apache.struts.action.ActionMapping">
> > >    <action path="/createVenue"
> > >             type="venue.action.CreateVenueAction"
> > >             name="venueForm">
> > >    </action>
> > > </action-mappings>
> > >
> > > this is my class:
> > >
> > > public class CreateVenueAction extends Action {
> > >     public ActionForward perform(ActionMapping mapping,
> > >                                  ActionForm form,
> > >                                  ServletRequest request,
> > >                                  ServletResponse response)
> > >             throws IOException, ServletException {
> > >
> > >         Util.println("IN CREATE VENUE ACTION");
> > >         return mapping.findForward("editVenue");
> > >     }
> > > }
> > >
> > > what am i missing? i just cant seem to get struts to execute my
> > > action.. and
> > > goto the specified forward
> > >
> > > is there a way to put struts into a 'verbose' mode so i can see
> > > just exactly
> > > what action was executed, the url, etc?
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >
> 
> 
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: problem trying to use my own actions

Posted by Francisco Hernandez <fh...@fhernandez.net>.
hmm..
I already had my action servlet loaded with those params

Ive been trying to get this working but I just get a black 0 byte page
returned.. tried the same code on 2 different app servers, orion and reson
under jdk1.4

dont know whats going on.. im really lost now

----- Original Message -----
From: "Enrique Rodriguez" <la...@telefonica.net>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Tuesday, April 09, 2002 2:00 PM
Subject: RE: problem trying to use my own actions


>
> HI,
>
> -you can config the verbose option in web.xml, when you load the config
> servlet, here the example.
>
>   <servlet>
>     <servlet-name>action</servlet-name>
>     <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
>     <init-param>
>       <param-name>application</param-name>
>       <param-value>com.yourcompany.ApplicationResources</param-value>
>     </init-param>
>     <init-param>
>       <param-name>config</param-name>
>       <param-value>/WEB-INF/struts-config.xml</param-value>
>     </init-param>
> <!--verbose-->
>     <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>
> _____________________________
> Enrique Rodriguez Lasterra
>
>
>
> > -----Mensaje original-----
> > De: Francisco Hernandez [mailto:fhernandez@fhernandez.net]
> > Enviado el: martes, 09 de abril de 2002 22:25
> > Para: Struts Users Mailing List
> > Asunto: problem trying to use my own actions
> >
> >
> > i just cant get struts to use my own actions..
> >
> > struts-config.xml snipplets:
> >   <global-forwards type="org.apache.struts.action.ActionForward">
> >         <forward name="editVenue" path="/editVenue.jsp"/>
> >     </global-forwards>
> >
> > <action-mappings type="org.apache.struts.action.ActionMapping">
> >    <action path="/createVenue"
> >             type="venue.action.CreateVenueAction"
> >             name="venueForm">
> >    </action>
> > </action-mappings>
> >
> > this is my class:
> >
> > public class CreateVenueAction extends Action {
> >     public ActionForward perform(ActionMapping mapping,
> >                                  ActionForm form,
> >                                  ServletRequest request,
> >                                  ServletResponse response)
> >             throws IOException, ServletException {
> >
> >         Util.println("IN CREATE VENUE ACTION");
> >         return mapping.findForward("editVenue");
> >     }
> > }
> >
> > what am i missing? i just cant seem to get struts to execute my
> > action.. and
> > goto the specified forward
> >
> > is there a way to put struts into a 'verbose' mode so i can see
> > just exactly
> > what action was executed, the url, etc?
> >
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: problem trying to use my own actions

Posted by Enrique Rodriguez <la...@telefonica.net>.
HI,

-you can config the verbose option in web.xml, when you load the config
servlet, here the example.

  <servlet>
    <servlet-name>action</servlet-name>
    <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
    <init-param>
      <param-name>application</param-name>
      <param-value>com.yourcompany.ApplicationResources</param-value>
    </init-param>
    <init-param>
      <param-name>config</param-name>
      <param-value>/WEB-INF/struts-config.xml</param-value>
    </init-param>
<!--verbose-->
    <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>
_____________________________
Enrique Rodriguez Lasterra



> -----Mensaje original-----
> De: Francisco Hernandez [mailto:fhernandez@fhernandez.net]
> Enviado el: martes, 09 de abril de 2002 22:25
> Para: Struts Users Mailing List
> Asunto: problem trying to use my own actions
>
>
> i just cant get struts to use my own actions..
>
> struts-config.xml snipplets:
>   <global-forwards type="org.apache.struts.action.ActionForward">
>         <forward name="editVenue" path="/editVenue.jsp"/>
>     </global-forwards>
>
> <action-mappings type="org.apache.struts.action.ActionMapping">
>    <action path="/createVenue"
>             type="venue.action.CreateVenueAction"
>             name="venueForm">
>    </action>
> </action-mappings>
>
> this is my class:
>
> public class CreateVenueAction extends Action {
>     public ActionForward perform(ActionMapping mapping,
>                                  ActionForm form,
>                                  ServletRequest request,
>                                  ServletResponse response)
>             throws IOException, ServletException {
>
>         Util.println("IN CREATE VENUE ACTION");
>         return mapping.findForward("editVenue");
>     }
> }
>
> what am i missing? i just cant seem to get struts to execute my
> action.. and
> goto the specified forward
>
> is there a way to put struts into a 'verbose' mode so i can see
> just exactly
> what action was executed, the url, etc?
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>