You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Paul Goepfert <pa...@gmail.com> on 2005/06/02 18:48:18 UTC

Having problems moving between pages with struts

Here it is,  I am developing a small program  that utilizes Struts, Java 
and Apache Velocity Templates.  I amm trying to move from one page to 
another via struts.  Every time I try to move to another page I get a 
404 Error in Tomcat.  Here is my struts-conf.xml file as well as my 
web.xml file.  Could someone please tell me what is wrng with it.

<struts-config>
        <form-beans>
                <form-bean name="infoForm" type="forms.InfoForm">
        <form-beans>
        <action-mappings>
                <action         path="/PersonalInfo"
                                type="actions.InfoAction"
                                name="infoForm">
                        <forward name="success" path="/info.vm" />
                        <forward name="failure" path="/menu.vm" />
                </action>
        </action-mappings>
<struts-config>

<web-app>
        <display-name>Personal Information</display-name>
        <servlet>
                <servlet-name>action</servlet-name>
              
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
                <init-parm>
                        <parm-name>config</parm-name>
                    <parm-value>/WEB-INF/conf/struts-conf.xml</parm-value>
                </init-parm>
                <load-on-startup>2</load-on-startup>
        </servlet>
        <servlet>
                <servlet-name>velocity</servlet-name>
                
<servlet-class>org.apache.velocity.tools.view.servlet.VelocityViewServlet</servlet-class>
                <load-on-startup>10</load-on-startup>
        </servlet>
        <servlet-mapping>
                <servlet-name>velocity</servlet-name>
                <url-pattern>*.vm</url-pattern>
        <servlet-mapping>
                <servlet-name>action</servlet-name>
                <url-pattern>*.do</url-pattern>
        </servlet-mapping>
</web-app>

The servlet-class for "action" is not the same class for where my 
servlet is located.  Anonther thing that I don't understand is the *.do 
url-mapping If anyone can explain that to me that would be great.

Thanks

Paul

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


Re: Having problems moving between pages with struts

Posted by Martin Gainty <mg...@hotmail.com>.
*Dave I think he might have posted to the wrong list*
Paul could you post this same question to velocity-user@jakarta.apache.org 
and I and the others will answer your inquiry
Many Thanks,
Martin-

----- Original Message ----- 
From: "Dave Newton" <ne...@pingsite.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Thursday, June 02, 2005 1:46 PM
Subject: Re: Having problems moving between pages with struts


> Paul Goepfert wrote:
>
>> Here it is,  I am developing a small program  that utilizes Struts, Java 
>> and Apache Velocity Templates.  I amm trying to move from one page to 
>> another via struts.  Every time I try to move to another page I get a 404 
>> Error in Tomcat.
>
> What do you mean by "move to another page?"
>
>> The servlet-class for "action" is not the same class for where my servlet 
>> is located.  Anonther thing that I don't understand is the *.do 
>> url-mapping If anyone can explain that to me that would be great.
>
> Have you looked at any of the Struts documentation? That might be a good 
> place to start.
>
> Dave
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
> 

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


Re: Having problems moving between pages with struts

Posted by Dave Newton <ne...@pingsite.com>.
Paul Goepfert wrote:

> Here it is,  I am developing a small program  that utilizes Struts, 
> Java and Apache Velocity Templates.  I amm trying to move from one 
> page to another via struts.  Every time I try to move to another page 
> I get a 404 Error in Tomcat.

What do you mean by "move to another page?"

> The servlet-class for "action" is not the same class for where my 
> servlet is located.  Anonther thing that I don't understand is the 
> *.do url-mapping If anyone can explain that to me that would be great.

Have you looked at any of the Struts documentation? That might be a good 
place to start.

Dave



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


Re: Having problems moving between pages with struts

Posted by John Fitzpatrick <jo...@vitarara.net>.
If I'm reading your desired config correctly, It looks like you've got one
action, InfoAction which would be reached at /action/PersonalInfo.do and
will either load info.vm or menu.vm depending on what the action returns.
(Note the placement of the ".do" -- that's what that means)

If there are other actions you want to browse to, you'll need the action
mappings.

I suspect however that your problem might also lie in the <web-app> tag
which I think belongs in a web.xml file instead.



On 20050602 12:48 PM, "Paul Goepfert" <pa...@gmail.com> wrote:

> Here it is,  I am developing a small program  that utilizes Struts, Java
> and Apache Velocity Templates.  I amm trying to move from one page to
> another via struts.  Every time I try to move to another page I get a
> 404 Error in Tomcat.  Here is my struts-conf.xml file as well as my
> web.xml file.  Could someone please tell me what is wrng with it.
> 
> <struts-config>
>       <form-beans>
>               <form-bean name="infoForm" type="forms.InfoForm">
>       <form-beans>
>       <action-mappings>
>               <action         path="/PersonalInfo"
>                               type="actions.InfoAction"
>                               name="infoForm">
>                       <forward name="success" path="/info.vm" />
>                       <forward name="failure" path="/menu.vm" />
>               </action>
>       </action-mappings>
> <struts-config>
> 
> <web-app>
>       <display-name>Personal Information</display-name>
>       <servlet>
>               <servlet-name>action</servlet-name>
>             
> <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
>               <init-parm>
>                       <parm-name>config</parm-name>
>                   <parm-value>/WEB-INF/conf/struts-conf.xml</parm-value>
>               </init-parm>
>               <load-on-startup>2</load-on-startup>
>       </servlet>
>       <servlet>
>               <servlet-name>velocity</servlet-name>
>               
> <servlet-class>org.apache.velocity.tools.view.servlet.VelocityViewServlet</ser
> vlet-class>
>               <load-on-startup>10</load-on-startup>
>       </servlet>
>       <servlet-mapping>
>               <servlet-name>velocity</servlet-name>
>               <url-pattern>*.vm</url-pattern>
>       <servlet-mapping>
>               <servlet-name>action</servlet-name>
>               <url-pattern>*.do</url-pattern>
>       </servlet-mapping>
> </web-app>
> 
> The servlet-class for "action" is not the same class for where my
> servlet is located.  Anonther thing that I don't understand is the *.do
> url-mapping If anyone can explain that to me that would be great.
> 
> Thanks
> 
> Paul
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 


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