Calling a servlet with Struts 2
843840Apr 29 2010 — edited Apr 29 2010Hi,
I have a struts 2 application which also uses tiles and it works as I expected. I need to add calling a servlet which fails.
My web.xml had this config:
<filter>
<filter-name>struts-prepare</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
<init-param>
<param-name>actionPackages</param-name>
<param-value>com.rescon.transview.action</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>struts-prepare</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
and I added:
<servlet>
<servlet-name>JQGridServlet</servlet-name>
<servlet-class>com.rescon.transview.servlet.JQGridServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>JQGridServlet</servlet-name>
<url-pattern>/JQGridServlet</url-pattern>
</servlet-mapping>
The servlet was not getting call as no action was defined.
I changed the filter-mapping from <url-pattern>/*</url-pattern> to <url-pattern>*.action</url-pattern>
and I could call servlet ok and some of the actions worked ok. What I can't seem to call is the tiles especially <tiles:insertDefinition name="transView.homepage" />
Can anyone tell me the filer-mapping required for the tiles or any other way around this?