You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Thomas E Enebo <en...@acm.org> on 2003/12/18 01:15:54 UTC

DOTs, wild cards, and action mapping

I started using the wild-card support in action mappings (from a CVS 
build).  It works, but I noticed something strange (until I realized 
what it was doing).  So, I have a action mapping like:

         <action
             path="/areas/*"
             type="apackage.AreaAction">
             <forward name="success" path=".area"/>
         </action>

Then in some jsp I have:

	<html:link title="${area.name}" action="/areas/${area.address}">

Where area.address expands to '10.0.0.1'.  Struts will look for the last 
dot in an action and chop it off.  So I keep getting a string like:

          <a href="/managearea/do/areas/10.0.0" title="area1">area1</a>

So I am not using extensions in my struts configuration and I would 
intuitively think that I would get '10.0.0.1' back.  Is this an 
ambiguity that appeared with the new wildcard support that cannot be 
resolved (meaning I should never use '.' in any names) or is there some 
way to resolve this?  Perhaps I must always use extensions to combat 
this (i.e. action="/areas/${area.address}.bogus_extension" - which is 
fine by me as a workaround)?

-Tom



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: DOTs, wild cards, and action mapping

Posted by Thomas E Enebo <en...@acm.org>.
David Friedman wrote:
> Thomas,
> 
> (Probably a) Dumb question ....
> 
> From the "${area.name}" it looks like you're using Velocity Templates.  I
> thought Velocity couldn't mix with JSP's like that (My impression from ch 17
> of 'Struts in Action'.  How are you mixing the two?  (Or is there a Velocity
> update which allows it?)

   I should have noted that I am using tomcat 5.0 also.  I am not using 
Velocity, but merely JSP EL.  So no mixing.   In debugging, the EL is 
returning the right thing.  Struts is stripping the last .something 
assuming it is an extension.

   I guess barring any other comment I will just add a bogus extension to
make sure I have no more conflicts.

-Tom



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: DOTs, wild cards, and action mapping

Posted by David Friedman <hu...@ix.netcom.com>.
Thomas,

(Probably a) Dumb question ....

>From the "${area.name}" it looks like you're using Velocity Templates.  I
thought Velocity couldn't mix with JSP's like that (My impression from ch 17
of 'Struts in Action'.  How are you mixing the two?  (Or is there a Velocity
update which allows it?)

Regards,
David

-----Original Message-----
From: Thomas E Enebo [mailto:enebo@acm.org]
Sent: Wednesday, December 17, 2003 7:16 PM
To: struts-user@jakarta.apache.org
Subject: DOTs, wild cards, and action mapping


I started using the wild-card support in action mappings (from a CVS
build).  It works, but I noticed something strange (until I realized
what it was doing).  So, I have a action mapping like:

         <action
             path="/areas/*"
             type="apackage.AreaAction">
             <forward name="success" path=".area"/>
         </action>

Then in some jsp I have:

	<html:link title="${area.name}" action="/areas/${area.address}">

Where area.address expands to '10.0.0.1'.  Struts will look for the last
dot in an action and chop it off.  So I keep getting a string like:

          <a href="/managearea/do/areas/10.0.0" title="area1">area1</a>

So I am not using extensions in my struts configuration and I would
intuitively think that I would get '10.0.0.1' back.  Is this an
ambiguity that appeared with the new wildcard support that cannot be
resolved (meaning I should never use '.' in any names) or is there some
way to resolve this?  Perhaps I must always use extensions to combat
this (i.e. action="/areas/${area.address}.bogus_extension" - which is
fine by me as a workaround)?

-Tom



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org