You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Robin Mannering <ro...@mtndesigns.co.uk> on 2009/08/15 11:29:16 UTC
URL Mappings
Please excuse if this question has been answered before. I can't find
any direct reference to it.
How would I configure Struts2 to treat .htm requests in the same way as
.action requests.
I freely admit I do not understand how
org.apache.struts2.dispatcher.FilterDispatcher identifies between static
and not static content.
For SEO and for familiarity for average users, I'd like all our URLs to
end in .htm
Is this possible and how do I go about this.
Thanks
Robin
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: URL Mappings
Posted by Martin Gainty <mg...@hotmail.com>.
i *thought* the op was using 2.1.3
thanks scott!
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> To: user@struts.apache.org
> Subject: Re: URL Mappings
> Date: Sat, 15 Aug 2009 10:18:25 -0400
> From: musomesa@aol.com
>
>
> Note that
>
>
>
> org.apache.struts2.dispatcher.FilterDispatcher
>
>
> is deprecated since 2.1.3 in favor of
> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.
>
>
>
>
>
>
>
>
> -----Original Message-----
> From: Martin Gainty <mg...@hotmail.com>
> To: Struts Users Mailing List <us...@struts.apache.org>
> Sent: Sat, Aug 15, 2009 9:29 am
> Subject: RE: URL Mappings
>
>
>
>
>
>
>
>
>
>
>
> Martin Gainty wrote:
>
> action extensions are specified in struts.xml
> struts.action.extension
>
> <constant name="struts.action.extension" value="action,htm" />
>
>
>
> static-content:
>
> * <p/> This
> filter(org.apache.struts2.dispatcher.FilterDispatcher) also serves
> common static * content needed when using various parts of Struts, such
> as JavaScript
>
> * files, CSS files, etc. It works by looking for requests to /struts/*,
> and then mapping the * * value after "/struts/"
>
> * to common packages in Struts and, optionally, in your class path. By
> default, the *
>
> * following packages are
>
> * automatically searched:
>
> * <li>org.apache.struts2.static</li>
>
>
>
> specifying additional 'packages' in init-param will allow
> DefaultStaticContentLoader to load
>
> those additional packages
>
> does this answer your questions?
> Martin Gainty
> ______________________________________________
> Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
>
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger
> sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung
> oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem
> Aus
> tausch von Informationen und entfaltet keine rechtliche Bindungswirkung.
> Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung
> fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire informez
> l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est
> interdite. Ce message sert à l'information seulement et n'aura pas n'importe
> quel effet légalement obligatoire. Étant donné que les email peuvent facilement
> être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité
> pour le contenu fourni.
>
>
>
>
> > Date: Sat, 15 Aug 2009 11:29:16 +0200
> > From: robin@mtndesigns.co.uk
> > To: user@struts.apache.org
> > Subject: URL Mappings
> >
> > Please excuse if this question has been answered before. I can't find
> > any direct reference to it.
> >
> > How would I configure Struts2 to treat .htm requests in the same way as
> > .action requests.
> >
> > I freely admit I do not understand how
> > org.apache.struts2.dispatcher.FilterDispatcher identifies between static
> > and not static content.
> >
> > For SEO and for familiarity for average users, I'd like all our URLs to
> > end in .htm
> >
> > Is this possible and how do I go about this.
> >
> > Thanks
> > Robin
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands
> , e-mail: user-help@struts.apache.org
> >
>
> _________________________________________________________________
> Get your vacation photos on your phone!
> http://windowsliveformobile.com/en-us/photos/default.aspx?&OCID=0809TL-HM=
>
>
>
>
>
_________________________________________________________________
Express your personality in color! Preview and select themes for Hotmail®.
http://www.windowslive-hotmail.com/LearnMore/personalize.aspx?ocid=PID23391::T:WLMTAGL:ON:WL:en-US:WM_HYGN_express:082009
Re: URL Mappings
Posted by Robin Mannering <ro...@mtndesigns.co.uk>.
Thanks for all the feedback on this post!
Having seen the post from Martin regarding
<constant name="struts.action.extension" value="action,htm" />
I've now also seen the equivalent declaration in struts.properties :
struts.action.extension=action
But most probably know that I guess.
Thanks also for the heads up on the deprecated
org.apache.struts2.dispatcher.FilterDispatcher in favour of
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.
Robin
Wes Wannemacher wrote:
> Next generation?
>
> Multiple filters were created to deal with problems arising from using
> things like the sitemesh filter and struts tags inside of decorators.
>
> On 8/15/09, Dale Newfield <da...@newfield.org> wrote:
>
>> musomesa@aol.com wrote:
>>
>>> Note that org.apache.struts2.dispatcher.FilterDispatcher is
>>> deprecated since 2.1.3 in favor of
>>> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.
>>>
>> D'oh! I didn't know that!
>>
>> I'm a bit confused, though -- are the javadocs here:
>> http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/dispatcher/ng/package-summary.html
>> out of date? The example web.xml code doesn't include the .ng portion
>> of the packages... (what's "NG" short for, anyway?)
>>
>> -Dale
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>>
>
>
>
> ------------------------------------------------------------------------
>
>
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 8.5.392 / Virus Database: 270.13.57/2303 - Release Date: 08/14/09 18:10:00
>
>
Re: URL Mappings
Posted by Wes Wannemacher <we...@wantii.com>.
Next generation?
Multiple filters were created to deal with problems arising from using
things like the sitemesh filter and struts tags inside of decorators.
On 8/15/09, Dale Newfield <da...@newfield.org> wrote:
> musomesa@aol.com wrote:
>> Note that org.apache.struts2.dispatcher.FilterDispatcher is
>> deprecated since 2.1.3 in favor of
>> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.
>
> D'oh! I didn't know that!
>
> I'm a bit confused, though -- are the javadocs here:
> http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/dispatcher/ng/package-summary.html
> out of date? The example web.xml code doesn't include the .ng portion
> of the packages... (what's "NG" short for, anyway?)
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
--
Wes Wannemacher
Head Engineer, WanTii, Inc.
Need Training? Struts, Spring, Maven, Tomcat...
Ask me for a quote!
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
RE: URL Mappings
Posted by Martin Gainty <mg...@hotmail.com>.
in 2.1.6 StrutsPrepareAndExecuteFilter is implemented in /blank/WEB-INF/web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_9" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>Struts Blank</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
code:
/*Handles both the preparation and execution phases of the Struts dispatching process.
* This filter is better to use
* when you don't have another filter that needs access to action context information,
* such as Sitemesh. */
public class StrutsPrepareAndExecuteFilter implements StrutsStatics, Filter {
.......
}
mainly to access action-context
but also implements StrutsStatics
maybe wes would know i think he works extensively with SiteMesh
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> Date: Sat, 15 Aug 2009 11:13:48 -0400
> From: dale@newfield.org
> To: user@struts.apache.org
> Subject: Re: URL Mappings
>
> musomesa@aol.com wrote:
> > Note that org.apache.struts2.dispatcher.FilterDispatcher is
> > deprecated since 2.1.3 in favor of
> > org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.
>
> D'oh! I didn't know that!
>
> I'm a bit confused, though -- are the javadocs here:
> http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/dispatcher/ng/package-summary.html
> out of date? The example web.xml code doesn't include the .ng portion
> of the packages... (what's "NG" short for, anyway?)
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
_________________________________________________________________
Get free photo software from Windows Live
http://www.windowslive.com/online/photos?ocid=PID23393::T:WLMTAGL:ON:WL:en-US:SI_PH_software:082009
Re: URL Mappings
Posted by Dale Newfield <da...@newfield.org>.
musomesa@aol.com wrote:
> Note that org.apache.struts2.dispatcher.FilterDispatcher is
> deprecated since 2.1.3 in favor of
> org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.
D'oh! I didn't know that!
I'm a bit confused, though -- are the javadocs here:
http://struts.apache.org/2.x/struts2-core/apidocs/org/apache/struts2/dispatcher/ng/package-summary.html
out of date? The example web.xml code doesn't include the .ng portion
of the packages... (what's "NG" short for, anyway?)
-Dale
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: URL Mappings
Posted by mu...@aol.com.
Note that
org.apache.struts2.dispatcher.FilterDispatcher
is deprecated since 2.1.3 in favor of
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.
-----Original Message-----
From: Martin Gainty <mg...@hotmail.com>
To: Struts Users Mailing List <us...@struts.apache.org>
Sent: Sat, Aug 15, 2009 9:29 am
Subject: RE: URL Mappings
Martin Gainty wrote:
action extensions are specified in struts.xml
struts.action.extension
<constant name="struts.action.extension" value="action,htm" />
static-content:
* <p/> This
filter(org.apache.struts2.dispatcher.FilterDispatcher) also serves
common static * content needed when using various parts of Struts, such
as JavaScript
* files, CSS files, etc. It works by looking for requests to /struts/*,
and then mapping the * * value after "/struts/"
* to common packages in Struts and, optionally, in your class path. By
default, the *
* following packages are
* automatically searched:
* <li>org.apache.struts2.static</li>
specifying additional 'packages' in init-param will allow
DefaultStaticContentLoader to load
those additional packages
does this answer your questions?
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem
Aus
tausch von Informationen und entfaltet keine rechtliche Bindungswirkung.
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est
interdite. Ce message sert à l'information seulement et n'aura pas n'importe
quel effet légalement obligatoire. Étant donné que les email peuvent facilement
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité
pour le contenu fourni.
> Date: Sat, 15 Aug 2009 11:29:16 +0200
> From: robin@mtndesigns.co.uk
> To: user@struts.apache.org
> Subject: URL Mappings
>
> Please excuse if this question has been answered before. I can't find
> any direct reference to it.
>
> How would I configure Struts2 to treat .htm requests in the same way as
> .action requests.
>
> I freely admit I do not understand how
> org.apache.struts2.dispatcher.FilterDispatcher identifies between static
> and not static content.
>
> For SEO and for familiarity for average users, I'd like all our URLs to
> end in .htm
>
> Is this possible and how do I go about this.
>
> Thanks
> Robin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands
, e-mail: user-help@struts.apache.org
>
_________________________________________________________________
Get your vacation photos on your phone!
http://windowsliveformobile.com/en-us/photos/default.aspx?&OCID=0809TL-HM=
RE: URL Mappings
Posted by Martin Gainty <mg...@hotmail.com>.
Martin Gainty wrote:
action extensions are specified in struts.xml
struts.action.extension
<constant name="struts.action.extension" value="action,htm" />
static-content:
* <p/> This
filter(org.apache.struts2.dispatcher.FilterDispatcher) also serves
common static * content needed when using various parts of Struts, such
as JavaScript
* files, CSS files, etc. It works by looking for requests to /struts/*,
and then mapping the * * value after "/struts/"
* to common packages in Struts and, optionally, in your class path. By
default, the *
* following packages are
* automatically searched:
* <li>org.apache.struts2.static</li>
specifying additional 'packages' in init-param will allow
DefaultStaticContentLoader to load
those additional packages
does this answer your questions?
Martin Gainty
______________________________________________
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le destinataire prévu, nous te demandons avec bonté que pour satisfaire informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est interdite. Ce message sert à l'information seulement et n'aura pas n'importe quel effet légalement obligatoire. Étant donné que les email peuvent facilement être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité pour le contenu fourni.
> Date: Sat, 15 Aug 2009 11:29:16 +0200
> From: robin@mtndesigns.co.uk
> To: user@struts.apache.org
> Subject: URL Mappings
>
> Please excuse if this question has been answered before. I can't find
> any direct reference to it.
>
> How would I configure Struts2 to treat .htm requests in the same way as
> .action requests.
>
> I freely admit I do not understand how
> org.apache.struts2.dispatcher.FilterDispatcher identifies between static
> and not static content.
>
> For SEO and for familiarity for average users, I'd like all our URLs to
> end in .htm
>
> Is this possible and how do I go about this.
>
> Thanks
> Robin
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
_________________________________________________________________
Get your vacation photos on your phone!
http://windowsliveformobile.com/en-us/photos/default.aspx?&OCID=0809TL-HM