Again, thank you very much Laurie.

I couldn't understand how ** wildcard mapping could work with suffix mapping
(*.do). I have tried, in web.xml, *.do/** but tomcat said "invalid
url-pattern". If I manage to get ** wilcard mapping work with *.do, I will
be able to correctly process a request like
http://localhost:8080/myapp/server.do/chapter1/1.html

Also, I've tried *.do** , tomcat did accept this but this time, it expected
me to write ** at the end of all URL's. That is, it didn't work as a
wildcard mapping.

And in struts-config.xml, I modified my action as " <action path=/server**
... " but this didn't work either. It seems that ** wildcard mapping is not
possible with *.do suffix mapping. What do you think Laurie?

---------- Forwarded message ----------
From: Laurie Harper <[EMAIL PROTECTED]>
To: user@struts.apache.org
Date: Mon, 26 Sep 2005 14:31:10 -0400
Subject: Re: user Digest 25 Sep 2005 21:39:29 -0000 Issue 6130
emre akbas wrote:
> 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.)

[Note: '*.do' is a suffix, /do/* is a prefix (pre- -> previous); just to
reduce any confusion for people following along ;-)]

Actually, I think wildcard mappings *should* work with suffix mapping
too, though I've never tried it. But you can define both types of
mapping in web.xml, so long as you pick a prefix your application
doesn't already use. In other words, as long as you don't already have
linkes that start /do/... then adding a /do/* mapping is fine.

Migrating your whole app from one mapping style to the other wouldn't be
super hard -- just find anywhere you have an explicit .do and update
appropriately. However, I wouldn't recommend trying that if this is the
only driver. If what you have works, keep it ;-)

L.

Reply via email to