You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ryan Townshend <so...@hotmail.com> on 2001/11/23 17:17:25 UTC

Actionmapping bafflement

Hello all
I am new to jsp in general and struts in specific, and working through the
examples.
I seem to be having a problem seeing how the paths relate to each other in
the actionmappings.
What this is supposed to be is a forward from index.jsp in /webapps/tactics
to tipsindex.jsp in /pages/tips

If anyone has any insight in what the new guy { me } is missing I would sure
appreciate it.

I am using tomcat 4.0.1
        strutes 1.0
        jdk 1.3

thanks in advance.

- index.jsp link code
     <html:link forward="tipsindex"><font size="-1">Tips
Index</font></html:link>

- tipsindex.jsp
    is a bare bones jsp

- My file structure
    /webapps/tactics/WEB-INF/pages/tips/[ pages go here ]

- My struts-config.xml code so far

<struts-config>

    <global-forwards>
        <forward    name="tipsindex"
                            path="/tips"/>
    </global-forwards>

    <action-mappings>
        <action
          path="/tips"
          name="tipsindexbean"
          type="lairware.actions.DispatchForward"
          scope="request"
          validate="false"
          input="/index.jsp">

            <forward
              name="continue"
              path="/WEB-INF/pages/tips/tipsindex.jsp"/>
        </action>

  </action-mappings>

</struts-config>

- MY web.xml action servlet definition

  <servlet-mapping>
    <servlet-name>action</servlet-name>
    <url-pattern>*.do</url-pattern>
  </servlet-mapping>



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


Re: Actionmapping bafflement

Posted by Ted Husted <hu...@apache.org>.
The path on the global forward needs to be 

"/tips.do"

The link tag will add the servlet context, so it becomes a
fully-qualified URL, but will not perform any other processing. For all
it knows,  you are trying to link "/tips/index.jsp" or something.


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel +1 716 737-3463
-- http://www.husted.com/struts/

Ryan Townshend wrote:
> 
> Hello all
> I am new to jsp in general and struts in specific, and working through the
> examples.
> I seem to be having a problem seeing how the paths relate to each other in
> the actionmappings.
> What this is supposed to be is a forward from index.jsp in /webapps/tactics
> to tipsindex.jsp in /pages/tips
> 
> If anyone has any insight in what the new guy { me } is missing I would sure
> appreciate it.
> 
> I am using tomcat 4.0.1
>         strutes 1.0
>         jdk 1.3
> 
> thanks in advance.
> 
> - index.jsp link code
>      <html:link forward="tipsindex"><font size="-1">Tips
> Index</font></html:link>
> 
> - tipsindex.jsp
>     is a bare bones jsp
> 
> - My file structure
>     /webapps/tactics/WEB-INF/pages/tips/[ pages go here ]
> 
> - My struts-config.xml code so far
> 
> <struts-config>
> 
>     <global-forwards>
>         <forward    name="tipsindex"
>                             path="/tips"/>
>     </global-forwards>
> 
>     <action-mappings>
>         <action
>           path="/tips"
>           name="tipsindexbean"
>           type="lairware.actions.DispatchForward"
>           scope="request"
>           validate="false"
>           input="/index.jsp">
> 
>             <forward
>               name="continue"
>               path="/WEB-INF/pages/tips/tipsindex.jsp"/>
>         </action>
> 
>   </action-mappings>
> 
> </struts-config>
> 
> - MY web.xml action servlet definition
> 
>   <servlet-mapping>
>     <servlet-name>action</servlet-name>
>     <url-pattern>*.do</url-pattern>
>   </servlet-mapping>
> 
> --
> 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>