<init-param> <param-name>cors.supportedHeaders</param-name> <param-value>Accept, Origin, X-Requested-With, Content-Type, Last-Modified</param-value> </init-param> |
by 刘迎光@萤火虫工作室
OpenBI交流群:495266201
MicroService 微服务交流群:217722918
mail: liuyg#liuyingguang.cn
博主首页(==防止爬虫==):http://blog.liuyingguang.cn
<servlet> <servlet-name>Rest_Servlet</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>cn.firewarm.testRestShiro.rest</param-value> </init-param> <init-param> <param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name> <param-value>cn.firewarm.testRestShiro.filter.TestFilter</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> |
public class TestFilter implements ContainerRequestFilter { public ContainerRequest filter(ContainerRequest request) { if(判断条件){ return request; }else{ Response response = Response.ok("error").status(401).type(MediaType.APPLICATION_JSON).build(); throw new WebApplicationException(response); // Throw new UnAuthor |
材料:
by 刘迎光@萤火虫工作室
OpenBI交流群:495266201
MicroService 微服务交流群:217722918
mail: liuyg#liuyingguang.cn
博主首页(==防止爬虫==):http://blog.liuyingguang.cn
一、下载saiku-query的源码:
https://github.com/OSBI/saiku-query.git
二、修改文件:1、setting.xml文件(以下为关键代码):
<servers> <server> <id>releases</id> <username>admin</username> <password>admin123</password> </server> <server> <id>snapshots</id> <username>admin</username> <password>admin123</password> </server> <server> <id>thirdparty</id> <username>admin</username> <password>admin123</password> </server> <server> <id>snapshots-host</id> <username>admin</username> <password>admin123</password> </server> </servers> ........... <repositories> <repository> <id>snapshots</id> <name>Snapshots</name> <url>http://192.168.10.140:8081/nexus/content/repositories/snapshots</url> </repository> <repository> <id>releases</id> <name>Releases</name> <url>http://192.168.10.140:8081/nexus/content/repositories/releases</url> </repository> <repository> <id>snapshots-host</id> <name>SnapshotsHost</name> <url>http://192.168.10.140:8081/