IncludeAction
IncludeAction is much like ForwardAction except that the resulting
resource is included in the HTTP response instead of being forwarded to.
In the JSP which don't use struts for include we do
<jsp:include page="/test/ServletA"/>
In struts JSP
<jsp:include page="/test/actA.do" />
There are two steps involved in using the
IncludeAction.
Step 1. First, in the jsp:
|
<jsp:include page="/test/actA.do" />
|
Step 2. Add action mapping in the struts-config.xml file:
Add the following action mapping in the
struts-config.xml file:
<action path="/actA"
parameter="/test/ServletA"
type="org.apache.struts.actions.IncludeAction" /> |
The parameter attribute indicates the actual resource that has to be included
in the response.The use of IncludeAction is limited to including
responses from existing Servlet in the current page.