Discussion:
Why we need struts.action.extension property
Igor Vlasov
2008-07-18 11:54:16 UTC
Permalink
Hello. I wrote a simple s2 application.

I described a filter in web.xml

<filter>
<filter-name>struts2</filter-name>

<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>

<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.jspa</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>

but i forgot a struts.properties file and "struts.action.extension=jspa"

AND my project does not WORK


My question: why we need to write "struts.action.extension=jspa" when we
already have filter-mapping binding struts2->*.jspa
--
View this message in context: http://www.nabble.com/Why-we-need-struts.action.extension-property-tp18527639p18527639.html
Sent from the Struts - User mailing list archive at Nabble.com.
Gabriel Belingueres
2008-07-18 13:07:43 UTC
Permalink
AFAIK, the Servlet API doesn't expose any standard way to know the
mapping associated to a filter. Maybe that's way.
Post by Igor Vlasov
Hello. I wrote a simple s2 application.
I described a filter in web.xml
<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>*.jspa</url-pattern>
<dispatcher>FORWARD</dispatcher>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
but i forgot a struts.properties file and "struts.action.extension=jspa"
AND my project does not WORK
My question: why we need to write "struts.action.extension=jspa" when we
already have filter-mapping binding struts2->*.jspa
--
View this message in context: http://www.nabble.com/Why-we-need-struts.action.extension-property-tp18527639p18527639.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
Dave Newton
2008-07-18 13:44:24 UTC
Permalink
Post by Igor Vlasov
but i forgot a struts.properties file and
"struts.action.extension=jspa"
AND my project does not WORK
My question: why we need to write
"struts.action.extension=jspa" when we
already have filter-mapping binding struts2->*.jspa
So Struts 2 itself knows what extension is being used for actions.

Note that mapping the S2 filter to something other than "/*" will break a few things unless we work around it. I added a note to the web.xml documenation [1], but basically unless we do something to get the static content served (extracting the files, etc.) things will break.

Dave

[1] web.xml coniguration documentation (new note won't show up right away)
http://struts.apache.org/2.x/docs/webxml.html

Continue reading on narkive:
Loading...