Re: Best practices regarding query strings and actions
I never understood why it would work in the first place. I'm sure the ActionServlet is getting the extra information, but it's trying to match the URI against one of the mappings defined in the config file. So I think we would have to change the way the controller looks up the URI's, and deal with converting the extra information to parameters. Mike Bridge wrote: > > I gave that a shot just now on the struts build from yesterday, > with: > >http://www.test.com:8080/mywebapp/do/getClipper/test > > and I get the same error that is described in the url > http://www.mail-archive.com/struts-user@jakarta.apache.org/msg12716.html: > >Error: 400 >Location: /mywebapp/do/getClipper/test >Invalid path /getClipper/test was requested > > My struts-config.xml entry is: > > type="com.test.actions.ClipperAction" >name="testForm" >scope="request" >validate="true"> > > > This is with Tomcat 3.2.3, and it works when I try to do the same > thing with a generic servlet (e.g. SnoopServlet), so I'm thinking > that it actually is a bug in Struts? > > -Mike > > On Wed, Oct 03, 2001 at 07:57:48PM -, [EMAIL PROTECTED] >wrote: > > Well, that's a different question ;-) > > > > Another approach would be to use urls like, > > > > http://www.test.com/do/getClipper/search/action%3dsearch/pageNumber%3d12/ > > > > where the part after the search is passed as the query string as "extra > > information". I'm told this would make some proxy servers happier too > > ;-) > > > > There's been talk of this before. Craig implied that it was already > > supported, but I haven't tried it myself. > > > > http://www.mail-archive.com/struts-user@jakarta.apache.org/msg12716.html > > > > I do think it would be useful for the action mappings to be parsed as > > the HTTP servers parse them, so if /do/this/parm1 didn't match, it would > > try /do/this?parm1 instead. > > > > -- Ted Husted, Husted dot Com, Fairport NY USA. > > -- Custom Software ~ Technical Services. > > -- Tel +1 716 737-3463 > > -- http://www.husted.com/about/struts/ > > -- > Mike Bridge > <[EMAIL PROTECTED]>
Re: Best practices regarding query strings and actions
I gave that a shot just now on the struts build from yesterday, with: http://www.test.com:8080/mywebapp/do/getClipper/test and I get the same error that is described in the url http://www.mail-archive.com/struts-user@jakarta.apache.org/msg12716.html: Error: 400 Location: /mywebapp/do/getClipper/test Invalid path /getClipper/test was requested My struts-config.xml entry is: This is with Tomcat 3.2.3, and it works when I try to do the same thing with a generic servlet (e.g. SnoopServlet), so I'm thinking that it actually is a bug in Struts? -Mike On Wed, Oct 03, 2001 at 07:57:48PM -, [EMAIL PROTECTED] wrote: > Well, that's a different question ;-) > > Another approach would be to use urls like, > > http://www.test.com/do/getClipper/search/action%3dsearch/pageNumber%3d12/ > > where the part after the search is passed as the query string as "extra > information". I'm told this would make some proxy servers happier too > ;-) > > There's been talk of this before. Craig implied that it was already > supported, but I haven't tried it myself. > > http://www.mail-archive.com/struts-user@jakarta.apache.org/msg12716.html > > I do think it would be useful for the action mappings to be parsed as > the HTTP servers parse them, so if /do/this/parm1 didn't match, it would > try /do/this?parm1 instead. > > -- Ted Husted, Husted dot Com, Fairport NY USA. > -- Custom Software ~ Technical Services. > -- Tel +1 716 737-3463 > -- http://www.husted.com/about/struts/ -- Mike Bridge <[EMAIL PROTECTED]>
Re: Best practices regarding query strings and actions
Well, that's a different question ;-) Another approach would be to use urls like, http://www.test.com/do/getClipper/search/action%3dsearch/pageNumber%3d12/ where the part after the search is passed as the query string as "extra information". I'm told this would make some proxy servers happier too ;-) There's been talk of this before. Craig implied that it was already supported, but I haven't tried it myself. http://www.mail-archive.com/struts-user@jakarta.apache.org/msg12716.html I do think it would be useful for the action mappings to be parsed as the HTTP servers parse them, so if /do/this/parm1 didn't match, it would try /do/this?parm1 instead. -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel +1 716 737-3463 -- http://www.husted.com/about/struts/ Mike Bridge wrote: > > It's too bad there isn't a way to do that. When one of the goals is > to get some dynamic pages listed in search engines (which is a > pretty common request), it would be nice to be able to construct a > dynamic url like this in struts: > > http://www.test.com/do/getClipper/action%3dsearch/pageNumber%3d12/search.html > > -Mike > > On Wed, Oct 03, 2001 at 01:39:58PM -, [EMAIL PROTECTED] >wrote: > > > You could shorten the query string somewhat, and end up with something > > like > > > > > http://www.test.com/do/getClipperSearch?pageNumber=12 > > > > but you can't eliminate it without using a form, and sending the > > parameters by POST rather than GET. > > > > This is just how HTTP works, and there's not much to be done about it > > ;-( > > > > -- Ted Husted, Husted dot Com, Fairport NY USA. > > -- Custom Software ~ Technical Services. > > -- Tel +1 716 737-3463 > > -- http://www.husted.com/about/struts/ > > > > chiji nwankwo wrote: > > > > > > Hi, > > > > > > Is there a recommended way to map query strings to actions so that > > > their values are not displayed in the address bar. > > > > > > eg > > > > > > http://www.test.com/do/getClipper?action=search&pageNumber=12 > > > > > > Thanks > > -- > Mike Bridge > <[EMAIL PROTECTED]>
Re: Best practices regarding query strings and actions
It's too bad there isn't a way to do that. When one of the goals is to get some dynamic pages listed in search engines (which is a pretty common request), it would be nice to be able to construct a dynamic url like this in struts: http://www.test.com/do/getClipper/action%3dsearch/pageNumber%3d12/search.html -Mike On Wed, Oct 03, 2001 at 01:39:58PM -, [EMAIL PROTECTED] wrote: > You could shorten the query string somewhat, and end up with something > like > > > http://www.test.com/do/getClipperSearch?pageNumber=12 > > but you can't eliminate it without using a form, and sending the > parameters by POST rather than GET. > > This is just how HTTP works, and there's not much to be done about it > ;-( > > -- Ted Husted, Husted dot Com, Fairport NY USA. > -- Custom Software ~ Technical Services. > -- Tel +1 716 737-3463 > -- http://www.husted.com/about/struts/ > > chiji nwankwo wrote: > > > > Hi, > > > > Is there a recommended way to map query strings to actions so that > > their values are not displayed in the address bar. > > > > eg > > > > http://www.test.com/do/getClipper?action=search&pageNumber=12 > > > > Thanks -- Mike Bridge <[EMAIL PROTECTED]>
Re: Best practices regarding query strings and actions
You could shorten the query string somewhat, and end up with something like > http://www.test.com/do/getClipperSearch?pageNumber=12 but you can't eliminate it without using a form, and sending the parameters by POST rather than GET. This is just how HTTP works, and there's not much to be done about it ;-( -- Ted Husted, Husted dot Com, Fairport NY USA. -- Custom Software ~ Technical Services. -- Tel +1 716 737-3463 -- http://www.husted.com/about/struts/ chiji nwankwo wrote: > > Hi, > > Is there a recommended way to map query strings to actions so that > their values are not displayed in the address bar. > > eg > > http://www.test.com/do/getClipper?action=search&pageNumber=12 > > Thanks > > Chiji > > -- > Get your FREE download of MSN Explorer at http://explorer.msn.com