java - Struts2 excludePattern for rest implementation -
i have application halfway completed rest web services calls implemented bypassing struts2 filter dispatcher.
the web.xml implemented below.
<?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="webapp_id" version="2.5"> <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>*.action</url-pattern> </filter-mapping> <session-config> <session-timeout>10</session-timeout> </session-config> <display-name>rabbit</display-name> <welcome-file-list> <welcome-file>/jsps/index.jsp</welcome-file> </welcome-file-list> <servlet> <servlet-name>jerseyrestservice</servlet-name> <servlet-class>com.sun.jersey.spi.container.servlet.servletcontainer</servlet-class> <init-param> <param-name>com.sun.jersey.config.property.packages</param-name> <param-value>com.webservice.rest</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>jerseyrestservice</servlet-name> <url-pattern>/rest/*</url-pattern> </servlet-mapping> </web-app>
now had implement struts2-jquery plugin had change web.xml to
<?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="webapp_id" version="2.5"> <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> <session-config> <session-timeout>10</session-timeout> </session-config> <display-name>rabbit</display-name> <welcome-file-list> <welcome-file>/jsps/index.jsp</welcome-file> </welcome-file-list> <servlet> <servlet-name>jerseyrestservice</servlet-name> <servlet-class>com.sun.jersey.spi.container.servlet.servletcontainer</servlet-class> <init-param> <param-name>com.sun.jersey.config.property.packages</param-name> <param-value>com.webservice.rest</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>jerseyrestservice</servlet-name> <url-pattern>/rest/*</url-pattern> </servlet-mapping> </web-app>
all fine except tha rest calls not working wanted implement excludepatterns in struts configuration file this
<struts> <constant name="struts.action.excludepattern" value="/rest"></constant> <include file="authenticate-config.xml" /> <include file="functional-config.xml" /> </struts>
but not working. can suggest me how working. need exclude calls formed urls http://...app/rest/...
Comments
Post a Comment