You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Adam Sherman <ad...@teachandtravel.com> on 2002/10/02 22:39:20 UTC

Mapping Problems

Is it possible to map requests to an Action using a pattern?

I would like to map "*.html" to my Action.

Using Tomcat, if I request "/thing.html", I get a 400 saying "Invalid 
path /thing was requested". A few snippets:

In web.xml:
   <servlet-mapping>
   	<servlet-name>action</servlet-name>
	<url-pattern>*.html</url-pattern>
   </servlet-mapping>

In struts-config.xml:
<action path="*.html" 
type="com.teachandtravel.presentation.actions.RenderPageAction" />

Thanks,

A.

P.S. I'm looking for a Best Practice on handling generic non-dynamic 
pages on a site using Tiles, which is what I'm trying to implement 
above. A better solution would be appreciated!

-- 
Adam Sherman
Software Developer
Teach and Travel Inc.
+1.613.241.3103



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


RE: Mapping Problems

Posted by Rene Eigenheer <re...@bridgesolutions.net>.
Adam,

I didi something similar with the following action definition:

        <action
            path="/myAction"
            type="my.actionClass"
            name="myForm"
            scope="request"
            validate="false"
            unknown="true">
        </action>

I is not important what action name (path) you use! With the parameter
unknown="true" struts handles all request which do not belong to another
action with this one (i.e. all *.html).

hope this helps
Rene


> -----Original Message-----
> From: Adam Sherman [mailto:adam@teachandtravel.com]
> Sent: Mittwoch, 2. Oktober 2002 22:39
> To: Struts Users Mailing List
> Subject: Mapping Problems
>
>
> Is it possible to map requests to an Action using a pattern?
>
> I would like to map "*.html" to my Action.
>
> Using Tomcat, if I request "/thing.html", I get a 400 saying "Invalid
> path /thing was requested". A few snippets:
>
> In web.xml:
>    <servlet-mapping>
>    	<servlet-name>action</servlet-name>
> 	<url-pattern>*.html</url-pattern>
>    </servlet-mapping>
>
> In struts-config.xml:
> <action path="*.html"
> type="com.teachandtravel.presentation.actions.RenderPageAction" />
>
> Thanks,
>
> A.
>
> P.S. I'm looking for a Best Practice on handling generic non-dynamic
> pages on a site using Tiles, which is what I'm trying to implement
> above. A better solution would be appreciated!
>
> --
> Adam Sherman
> Software Developer
> Teach and Travel Inc.
> +1.613.241.3103
>
>
>
> --
> 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>