You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Matt Raible <ma...@yahoo.com> on 2001/08/18 18:21:42 UTC

action mapping as /do/* rather than *.do

I am trying to convert the struts-example application to use:

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

And in the index.jsp page, I've change the "tour" link from:

<html:link page="/tour.do">
<font size="-1"><bean:message key="index.tour"/></font>
</html:link>

to:

<html:link page="/do/tour">
<font size="-1"><bean:message key="index.tour"/></font>
</html:link>

And have changed nothing in struts-config.xml.  However, when I try to execute
this link (http://localhost/NASApp/struts-example/do/tour), I get the error:

[18/Aug/2001 10:16:53:9] info: --------------------------------------
[18/Aug/2001 10:16:53:9] info: action: Processing a GET for /tour
[18/Aug/2001 10:16:53:9] info: --------------------------------------
[18/Aug/2001 10:16:53:9] info: --------------------------------------
[18/Aug/2001 10:16:53:9] info: action: Setting locale 'en_US'
[18/Aug/2001 10:16:53:9] info: --------------------------------------
[18/Aug/2001 10:16:53:9] info: --------------------------------------
[18/Aug/2001 10:16:53:9] info: action:  No mapping available for path /tour
[18/Aug/2001 10:16:53:9] info: --------------------------------------


But in my struts-config.xml, there is the entry:

    <action    path="/tour"
            forward="/tour.htm">
    </action>

Anyone know how to fix this?

Thanks,

Matt

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

RE: action mapping as /do/* rather than *.do

Posted by Phase Communcations <ma...@phase.ws>.
I use this kind of mapping successfully and I prefer it way over *.do. Read
the Ted Husted website under catalog. I follow his suggestions and I have
had great success.

Brandon Goodin
Phase Web and Multimedia
P (406) 862-2245
F (406) 862-0354
mail@phase.ws
http://www.phase.ws


-----Original Message-----
From: Scott A. Roehrig [mailto:saroehr@hotmail.com]
Sent: Wednesday, December 05, 2001 6:03 PM
To: Struts Users Mailing List
Subject: Re: action mapping as /do/* rather than *.do


I think from another post, the problem lies in that the request is being
redirected rather than forwarded. Upon the redirect, the webserver chokes on
it. Perhaps the answer is to use the subclass of ActionForward that sets
forwarding to true by default.

Haven't had the time to check this. However, I get the same error with
mappings like this.

Scott
----- Original Message -----
From: "Barry L. Kline" <bl...@attglobal.net>
To: <st...@jakarta.apache.org>
Sent: Wednesday, December 05, 2001 7:22 PM
Subject: Re: action mapping as /do/* rather than *.do


> Did you ever figure out how to do this?  I have seen many messages
> about how great it is to use /do/ but haven't seen anyone mention how
> to.  I'm just starting with struts and have been modifying Ted's
> sample (this same thing) but I'm been unable to get anything back from
> the browser but a blank screen...
>
> Barry
>
>
> Matt Raible wrote:
> >
> > I am trying to convert the struts-example application to use:
> >
> >   <servlet-mapping>
> >     <servlet-name>action</servlet-name>
> >     <url-pattern>/do/*</url-pattern>
> >   </servlet-mapping>
> >
> > And in the index.jsp page, I've change the "tour" link from:
> >
> > <html:link page="/tour.do">
> > <font size="-1"><bean:message key="index.tour"/></font>
> > </html:link>
> >
> > to:
> >
> > <html:link page="/do/tour">
> > <font size="-1"><bean:message key="index.tour"/></font>
> > </html:link>
> >
> > And have changed nothing in struts-config.xml.  However, when I try to
execute
> > this link (http://localhost/NASApp/struts-example/do/tour), I get the
error:
> >
> > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > [18/Aug/2001 10:16:53:9] info: action: Processing a GET for /tour
> > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > [18/Aug/2001 10:16:53:9] info: action: Setting locale 'en_US'
> > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > [18/Aug/2001 10:16:53:9] info: action:  No mapping available for path
/tour
> > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> >
> > But in my struts-config.xml, there is the entry:
> >
> >     <action    path="/tour"
> >             forward="/tour.htm">
> >     </action>
> >
> > Anyone know how to fix this?
> >
> > Thanks,
> >
> > Matt
> >
>
> --
> 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: action mapping as /do/* rather than *.do

Posted by "Scott A. Roehrig" <sa...@hotmail.com>.
I think from another post, the problem lies in that the request is being
redirected rather than forwarded. Upon the redirect, the webserver chokes on
it. Perhaps the answer is to use the subclass of ActionForward that sets
forwarding to true by default.

Haven't had the time to check this. However, I get the same error with
mappings like this.

Scott
----- Original Message -----
From: "Barry L. Kline" <bl...@attglobal.net>
To: <st...@jakarta.apache.org>
Sent: Wednesday, December 05, 2001 7:22 PM
Subject: Re: action mapping as /do/* rather than *.do


> Did you ever figure out how to do this?  I have seen many messages
> about how great it is to use /do/ but haven't seen anyone mention how
> to.  I'm just starting with struts and have been modifying Ted's
> sample (this same thing) but I'm been unable to get anything back from
> the browser but a blank screen...
>
> Barry
>
>
> Matt Raible wrote:
> >
> > I am trying to convert the struts-example application to use:
> >
> >   <servlet-mapping>
> >     <servlet-name>action</servlet-name>
> >     <url-pattern>/do/*</url-pattern>
> >   </servlet-mapping>
> >
> > And in the index.jsp page, I've change the "tour" link from:
> >
> > <html:link page="/tour.do">
> > <font size="-1"><bean:message key="index.tour"/></font>
> > </html:link>
> >
> > to:
> >
> > <html:link page="/do/tour">
> > <font size="-1"><bean:message key="index.tour"/></font>
> > </html:link>
> >
> > And have changed nothing in struts-config.xml.  However, when I try to
execute
> > this link (http://localhost/NASApp/struts-example/do/tour), I get the
error:
> >
> > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > [18/Aug/2001 10:16:53:9] info: action: Processing a GET for /tour
> > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > [18/Aug/2001 10:16:53:9] info: action: Setting locale 'en_US'
> > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > [18/Aug/2001 10:16:53:9] info: action:  No mapping available for path
/tour
> > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> >
> > But in my struts-config.xml, there is the entry:
> >
> >     <action    path="/tour"
> >             forward="/tour.htm">
> >     </action>
> >
> > Anyone know how to fix this?
> >
> > Thanks,
> >
> > Matt
> >
>
> --
> 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: action mapping as /do/* rather than *.do

Posted by "Barry L. Kline" <bl...@attglobal.net>.
Matt Raible wrote:
> 
> I did convert the struts-example to use this mapping.  It can be found at
> http://www.icsynergy.com/downloads/index.html#struts-example
> 
> Online documentation can be found at
> http://www.icsynergy.com/downloads/struts/strutsHowTo.html
> 
> Hope this helps.
> 
> Matt
> 

Thanks!

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


Re: action mapping as /do/* rather than *.do

Posted by "Barry L. Kline" <bl...@attglobal.net>.
Matt Raible wrote:
> 
> I did convert the struts-example to use this mapping.  It can be found at
> http://www.icsynergy.com/downloads/index.html#struts-example
> 
> Online documentation can be found at
> http://www.icsynergy.com/downloads/struts/strutsHowTo.html
> 
> Hope this helps.
> 
> Matt
> 

I downloaded your struts-example.zip file -- this is really great! 
Well documented.  I still am having some problems tho... On any of the
links I keep getting a:

Not Found

URL /struts-example/do/logon was not found on this server.  I'm
perplexed -- I added the lines:


JkMount /*.jsp     ajp13
JkMount /*.do      ajp13
JkMount /servlet/* ajp13
JkMount /do/*      ajp13

To my httpd.conf file and restarted it.  Any struts *.do files work
but /do/* doesn't.  Any suggestions?

Barry

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


Re: action mapping as /do/* rather than *.do

Posted by Matt Raible <ma...@yahoo.com>.
Yep,

You just need to change the <servlet-mapping> in web.xml and any
global-forwards in struts-config.xml.  If you look at the documentation (see
link below) you can see what I changed to facilitate the /do/* mapping - just
follow the same path and change "/do/" to "/controller/".

If you doing this on your own application, I'd recommend that you put all your
links in struts-config.xml as forwards, rather than coding them in your pages.

It is easier to change then if you decide to change this mapping.

For instance, the following forward:

<forward
       name="signIn"
       path="/do/signIn" />

can be used in a page with <html:link forward="signIn" />Sign In</html:link>,
rather than <html:link page="/do/signIn" />...

Hope this helps,

Matt




--- Philip Tong <ph...@yahoo.com.hk> wrote:
> Matt
> 
> Can I configure action mapping as /controller/* rather than /do/*
> Thx.
> 
> Philip.
> 
>  --- Matt Raible <ma...@yahoo.com> ���l�󤺮e�G> I did convert the
> struts-example to use this mapping.  It can be found at
> > http://www.icsynergy.com/downloads/index.html#struts-example
> > 
> > Online documentation can be found at
> > http://www.icsynergy.com/downloads/struts/strutsHowTo.html
> > 
> > Hope this helps.
> > 
> > Matt
> > 
> > --- "Barry L. Kline" <bl...@attglobal.net> wrote:
> > > Did you ever figure out how to do this?  I have seen many messages
> > > about how great it is to use /do/ but haven't seen anyone mention how
> > > to.  I'm just starting with struts and have been modifying Ted's
> > > sample (this same thing) but I'm been unable to get anything back from
> > > the browser but a blank screen...
> > > 
> > > Barry
> > > 
> > > 
> > > Matt Raible wrote:
> > > > 
> > > > I am trying to convert the struts-example application to use:
> > > > 
> > > >   <servlet-mapping>
> > > >     <servlet-name>action</servlet-name>
> > > >     <url-pattern>/do/*</url-pattern>
> > > >   </servlet-mapping>
> > > > 
> > > > And in the index.jsp page, I've change the "tour" link from:
> > > > 
> > > > <html:link page="/tour.do">
> > > > <font size="-1"><bean:message key="index.tour"/></font>
> > > > </html:link>
> > > > 
> > > > to:
> > > > 
> > > > <html:link page="/do/tour">
> > > > <font size="-1"><bean:message key="index.tour"/></font>
> > > > </html:link>
> > > > 
> > > > And have changed nothing in struts-config.xml.  However, when I try to
> > > execute
> > > > this link (http://localhost/NASApp/struts-example/do/tour), I get the
> > > error:
> > > > 
> > > > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > > > [18/Aug/2001 10:16:53:9] info: action: Processing a GET for /tour
> > > > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > > > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > > > [18/Aug/2001 10:16:53:9] info: action: Setting locale 'en_US'
> > > > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > > > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > > > [18/Aug/2001 10:16:53:9] info: action:  No mapping available for path
> > /tour
> > > > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > > > 
> > > > But in my struts-config.xml, there is the entry:
> > > > 
> > > >     <action    path="/tour"
> > > >             forward="/tour.htm">
> > > >     </action>
> > > > 
> > > > Anyone know how to fix this?
> > > > 
> > > > Thanks,
> > > > 
> > > > Matt
> > > >
> > > 
> > > --
> > > To unsubscribe, e-mail:  
> > <ma...@jakarta.apache.org>
> > > For additional commands, e-mail:
> > <ma...@jakarta.apache.org>
> > > 
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Send your FREE holiday greetings online!
> > http://greetings.yahoo.com
> > 
> > --
> > To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> >  
> 
> _________________________________________________________
> Do you Yahoo!?
> ��U���� http://travel.yahoo.com.hk
> Comprehensive travel guide at http://travel.yahoo.com.hk
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

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


Re: action mapping as /do/* rather than *.do

Posted by Philip Tong <ph...@yahoo.com.hk>.
Matt

Can I configure action mapping as /controller/* rather than /do/*
Thx.

Philip.

 --- Matt Raible <ma...@yahoo.com> 的郵件內容:> I did convert the
struts-example to use this mapping.  It can be found at
> http://www.icsynergy.com/downloads/index.html#struts-example
> 
> Online documentation can be found at
> http://www.icsynergy.com/downloads/struts/strutsHowTo.html
> 
> Hope this helps.
> 
> Matt
> 
> --- "Barry L. Kline" <bl...@attglobal.net> wrote:
> > Did you ever figure out how to do this?  I have seen many messages
> > about how great it is to use /do/ but haven't seen anyone mention how
> > to.  I'm just starting with struts and have been modifying Ted's
> > sample (this same thing) but I'm been unable to get anything back from
> > the browser but a blank screen...
> > 
> > Barry
> > 
> > 
> > Matt Raible wrote:
> > > 
> > > I am trying to convert the struts-example application to use:
> > > 
> > >   <servlet-mapping>
> > >     <servlet-name>action</servlet-name>
> > >     <url-pattern>/do/*</url-pattern>
> > >   </servlet-mapping>
> > > 
> > > And in the index.jsp page, I've change the "tour" link from:
> > > 
> > > <html:link page="/tour.do">
> > > <font size="-1"><bean:message key="index.tour"/></font>
> > > </html:link>
> > > 
> > > to:
> > > 
> > > <html:link page="/do/tour">
> > > <font size="-1"><bean:message key="index.tour"/></font>
> > > </html:link>
> > > 
> > > And have changed nothing in struts-config.xml.  However, when I try to
> > execute
> > > this link (http://localhost/NASApp/struts-example/do/tour), I get the
> > error:
> > > 
> > > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > > [18/Aug/2001 10:16:53:9] info: action: Processing a GET for /tour
> > > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > > [18/Aug/2001 10:16:53:9] info: action: Setting locale 'en_US'
> > > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > > [18/Aug/2001 10:16:53:9] info: action:  No mapping available for path
> /tour
> > > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > > 
> > > But in my struts-config.xml, there is the entry:
> > > 
> > >     <action    path="/tour"
> > >             forward="/tour.htm">
> > >     </action>
> > > 
> > > Anyone know how to fix this?
> > > 
> > > Thanks,
> > > 
> > > Matt
> > >
> > 
> > --
> > To unsubscribe, e-mail:  
> <ma...@jakarta.apache.org>
> > For additional commands, e-mail:
> <ma...@jakarta.apache.org>
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Send your FREE holiday greetings online!
> http://greetings.yahoo.com
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>  

_________________________________________________________
Do you Yahoo!?
行萬里路 http://travel.yahoo.com.hk
Comprehensive travel guide at http://travel.yahoo.com.hk

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


Re: action mapping as /do/* rather than *.do

Posted by Matt Raible <ma...@yahoo.com>.
I did convert the struts-example to use this mapping.  It can be found at
http://www.icsynergy.com/downloads/index.html#struts-example

Online documentation can be found at
http://www.icsynergy.com/downloads/struts/strutsHowTo.html

Hope this helps.

Matt

--- "Barry L. Kline" <bl...@attglobal.net> wrote:
> Did you ever figure out how to do this?  I have seen many messages
> about how great it is to use /do/ but haven't seen anyone mention how
> to.  I'm just starting with struts and have been modifying Ted's
> sample (this same thing) but I'm been unable to get anything back from
> the browser but a blank screen...
> 
> Barry
> 
> 
> Matt Raible wrote:
> > 
> > I am trying to convert the struts-example application to use:
> > 
> >   <servlet-mapping>
> >     <servlet-name>action</servlet-name>
> >     <url-pattern>/do/*</url-pattern>
> >   </servlet-mapping>
> > 
> > And in the index.jsp page, I've change the "tour" link from:
> > 
> > <html:link page="/tour.do">
> > <font size="-1"><bean:message key="index.tour"/></font>
> > </html:link>
> > 
> > to:
> > 
> > <html:link page="/do/tour">
> > <font size="-1"><bean:message key="index.tour"/></font>
> > </html:link>
> > 
> > And have changed nothing in struts-config.xml.  However, when I try to
> execute
> > this link (http://localhost/NASApp/struts-example/do/tour), I get the
> error:
> > 
> > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > [18/Aug/2001 10:16:53:9] info: action: Processing a GET for /tour
> > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > [18/Aug/2001 10:16:53:9] info: action: Setting locale 'en_US'
> > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > [18/Aug/2001 10:16:53:9] info: action:  No mapping available for path /tour
> > [18/Aug/2001 10:16:53:9] info: --------------------------------------
> > 
> > But in my struts-config.xml, there is the entry:
> > 
> >     <action    path="/tour"
> >             forward="/tour.htm">
> >     </action>
> > 
> > Anyone know how to fix this?
> > 
> > Thanks,
> > 
> > Matt
> >
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

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


Re: action mapping as /do/* rather than *.do

Posted by "Barry L. Kline" <bl...@attglobal.net>.
Did you ever figure out how to do this?  I have seen many messages
about how great it is to use /do/ but haven't seen anyone mention how
to.  I'm just starting with struts and have been modifying Ted's
sample (this same thing) but I'm been unable to get anything back from
the browser but a blank screen...

Barry


Matt Raible wrote:
> 
> I am trying to convert the struts-example application to use:
> 
>   <servlet-mapping>
>     <servlet-name>action</servlet-name>
>     <url-pattern>/do/*</url-pattern>
>   </servlet-mapping>
> 
> And in the index.jsp page, I've change the "tour" link from:
> 
> <html:link page="/tour.do">
> <font size="-1"><bean:message key="index.tour"/></font>
> </html:link>
> 
> to:
> 
> <html:link page="/do/tour">
> <font size="-1"><bean:message key="index.tour"/></font>
> </html:link>
> 
> And have changed nothing in struts-config.xml.  However, when I try to execute
> this link (http://localhost/NASApp/struts-example/do/tour), I get the error:
> 
> [18/Aug/2001 10:16:53:9] info: --------------------------------------
> [18/Aug/2001 10:16:53:9] info: action: Processing a GET for /tour
> [18/Aug/2001 10:16:53:9] info: --------------------------------------
> [18/Aug/2001 10:16:53:9] info: --------------------------------------
> [18/Aug/2001 10:16:53:9] info: action: Setting locale 'en_US'
> [18/Aug/2001 10:16:53:9] info: --------------------------------------
> [18/Aug/2001 10:16:53:9] info: --------------------------------------
> [18/Aug/2001 10:16:53:9] info: action:  No mapping available for path /tour
> [18/Aug/2001 10:16:53:9] info: --------------------------------------
> 
> But in my struts-config.xml, there is the entry:
> 
>     <action    path="/tour"
>             forward="/tour.htm">
>     </action>
> 
> Anyone know how to fix this?
> 
> Thanks,
> 
> Matt
>

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