struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jérémie Quinet (JIRA) <j...@apache.org>
Subject [jira] Commented: (WW-2640) The Tiles in Struts 2 doesn't support action
Date Wed, 08 Oct 2008 10:07:37 GMT

    [ https://issues.apache.org/struts/browse/WW-2640?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44820#action_44820
] 

Jérémie Quinet commented on WW-2640:
------------------------------------

I recently add this problem and digging in it it has nothing to do with struts 2 nor tiles
plugin, it's due to a servlet engine behavior.

The servlet engine doesn't invoke the filters on a forward/include on a RequestDispatcher,
it was working in struts 1 because a servlet was in charge to manage the request and not a
filter.

As i now there is no standard way to change this for a servlet 2.3 compliant engine, but for
version 2.4 and subsequent it can be change, here is an extract from spec :

{quote}
New for version 2.4 of the Java Servlet specification is the ability to configure filters
to be invoked under request dispatcher forward() and include() calls.
By using the new <dispatcher> element in the deployment descriptor, the
developer can indicate for a filter-mapping whether he would like the filter to be
applied to requests when:
1. The request comes directly from the client.
This is indicated by a <dispatcher> element with value REQUEST,
or by the absence of any <dispatcher> elements.
2. The request is being processed under a request dispatcher representing the
Web component matching the <url-pattern> or <servlet-name> using a forward()
call.
This is indicated by a <dispatcher> element with value FORWARD.
3. The request is being processed under a request dispatcher representing the
Web component matching the <url-pattern> or <servlet-name> using an include()
call.
This is indicated by a <dispatcher> element with value INCLUDE.
4. The request is being processed with the error page mechanism specified in "Error
Handling" on page 73 to an error resource matching the <url-pattern>.
This is indicated by a <dispatcher> element with the value ERROR.
5. Or any combination of 1, 2, 3, or 4 above.{quote}

The tiles include on RequestDispatcher is now working for me with :

{code:xml} 
<filter-mapping>
	<filter-name>struts</filter-name>
	<url-pattern>/*</url-pattern>
	<dispatcher>REQUEST</dispatcher>
	<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
{code} 


> The Tiles in Struts 2 doesn't support action
> --------------------------------------------
>
>                 Key: WW-2640
>                 URL: https://issues.apache.org/struts/browse/WW-2640
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Plugin - Tiles
>    Affects Versions: 2.1.2
>         Environment: WebSphere6.0.2 + JDK1.4 + Struts2.0.11.1 
>            Reporter: Richard Cao
>             Fix For: 2.1.3
>
>
> Hi, 
> My project is using tiles + Struts 2 to composite views, but the plug-in tiles(2.0.5)
doesnt' support .action view any more as the following:
> <definition name="xxx" template="/tiles/xxx/layout.jsp">
> 		<put-attribute name="title"
> 			value="xxx" />
> 		<put-attribute name="header" value="/tiles/shas/header.jsp" />
>                           *********  <put-attribute name="toolbar" value="/navigate/navigateMenu.action"
/>  **********
> 		<put-attribute name="body" />
> 		<put-attribute name="copyright" value="/tiles/copyright.jsp" />
> 		<put-attribute name="footer" value="/tiles/shas/footer.jsp" />
> </definition>
> But if I am not wrong, Struts1.X + Tiles1.X do support this function. 
> Many thanks
> Richard

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message