Thank you Laurie. That is exactly what I am looking for. I had looked at the documentation on wildcard mappings but I couldn't notice the ** mapping. Thank you again.
Now, I have another problem. We have written our Struts application using prefix mappings, i.e "*.do". In order to use DownloadAction with ** mapping, we should migrate to suffix mapping, i.e. "/do/*" . Is there an easy way of migrating a whole Struts application from prefix mapping to suffix mapping? Or, is it possible that both mappings exists in web.xml ? (Sorry, if these are weird questions.) From: Laurie Harper <[EMAIL PROTECTED]> > To: user@struts.apache.org > Date: Sat, 24 Sep 2005 16:38:12 -0400 > Subject: Re: Struts action servlet mapping, getPathInfo() returns null > Did you look at the documentation on wildcard mappings yet? If you use > /do/admin/** it'll match arbitrarily 'deep' URLs. > > L. > > emre akbas wrote: > > Thank you Dave. I'm afraid predefined mapping schemes like > /do/admin/*/*" > > and "/do/admin/*/*/* won't work for me since I want to implement a > generic > > file server. I cannot know the length of the URL nor its number of > tokens > > separated with "/". Actually, I have written such a fileserver using > plain > > old servlets. Since I don't want to mix servlets and Struts actions in > my > > Struts application, I'm looking for a way to implement this fileserver > with > > a DownloadAction class. But it seems to me that even if I use suffix > > mapping, there is no way of getting the rest of the URL after the > action's > > name, in a generic manner. > > > > ---------- Forwarded message ---------- > > > >>From: Dave Newton <[EMAIL PROTECTED]> > >>To: Struts Users Mailing List <user@struts.apache.org> > >>Date: Fri, 23 Sep 2005 17:53:56 -0400 > >>Subject: Re: user Digest 23 Sep 2005 19:04:19 -0000 Issue 6127 > >>emre akbas wrote: > >> > >> > >>>Dave, of course I know the URL is avaliable from HttpServletRequest. I > >> > >>think > >> > >>>you didn't read my previous e-mails on the topic. > >>> > >>>I couldn't find a way to get the remaining part of the URL after the > >>>action's name. That is, to get /chapter1/1.html in > >>>http://localhost:8080/action.do/chapter1/1.html > >>> > >>>request.getPathInfo() always returns null. > >>> > >>> > >> > >>I'm actually a little surprised your Action is firing at all if you're > >>doing *.do mapping and passing in something that doesn't end with *.do. > >> > >>If you use /do/* mapping and pass in something that isn't "actively" > >>being mapped (i.e., mapping from "/do/chapter1/1.html" to an Action) I'm > >>not sure I'd expect Struts to handle this. > >> > >>Now, if you do something like a wildcard mapping and define how you want > >>that to work (i.e., mapping from "/do/download/*/*" to an Action) you'll > >>probably get further--I'd look in to that. > >> > >>For instance, I created a generic CRUD action class that mapped > >>"/do/admin/*/*" and "/do/admin/*/*/*" and stripped out chunks to get > >>table names, commands, and ids. > >> > >>Also check out ActionMapping.getPath(): > >> > >>"Return context-relative path of the submitted request, starting with a > >>slash ("/") character, and omitting any filename extension if extension > >>mapping is being used." > >> > >>Dave > >> > >> > >> > >> >