小编Kia*_*ian的帖子

具有spring security的spring boot:创建名为'securityFilterChainRegistration'的bean时出错

我试图让spring security filterchain工作,但是spring boot似乎忽略了我自己的bean并使用了它WebSecurityConfiguration.

这些是我得到的例外(从嵌入式tomcat启动失败开始):

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'securityFilterChainRegistration' defined in class path resource [org/springframework/boot/autoconfigure/security/SpringBootWebSecurityConfiguration.class]: Unsatisfied dependency expressed through constructor argument with index 0 of type [javax.servlet.Filter]...
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'springSecurityFilterChain' defined in class path resource [org/springframework/security/config/annotation/web/configuration/WebSecurityConfiguration.class]: Bean instantiation via factory method failed;...
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [javax.servlet.Filter]: Factory method 'springSecurityFilterChain' threw exception; nested exception is java.lang.IllegalAccessError: class org.springframework.security.config.annotation.authentication.configuration.$Proxy53 cannot access its superinterface org.springframework.security.config.annotation.authentication.configuration.AuthenticationConfiguration$LazyBean
Caused by: java.lang.IllegalAccessError: class …
Run Code Online (Sandbox Code Playgroud)

java spring-mvc spring-security spring-boot

14
推荐指数
1
解决办法
7万
查看次数

Spring Boot:从url中删除jsessionid

如何从我的网址中删除jsessionid?

我正在使用Spring Boot MVC(没有Spring Security; tomcat嵌入式).

我已经读过可以通过将disableUrlRewriting设置为"true"来完成.但这看起来像是一个Spring Security解决方案,我没有使用它(这是一个没有登录的简单项目;只是页面;会话控制器存在并且必须是会话控制器).

我问这个是因为GoogleBot正在创建包含id的网址.

编辑:我用以下描述的解决方案解决了它:https://randomcoder.org/articles/jsessionid-considered-harmful

java spring spring-mvc tomcat8

3
推荐指数
2
解决办法
1万
查看次数

构建Rocket车把示例时未解决的导入模板

我无法让Rocket 车把示例 工作.这些是我的Cargo.toml依赖项:

[dependencies]
rocket = "*"
rocket_codegen = "*"
rocket_contrib = "*"
serde = "*"
serde_json = "*"
serde_derive = "*"
Run Code Online (Sandbox Code Playgroud)

错误:

error[E0432]: unresolved import `rocket_contrib::Template`
  --> src\main.rs:29:5
   |
29 | use rocket_contrib::Template;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^ no `Template` in the root

error[E0599]: no method named `attach` found for type `rocket::Rocket` in the current scope
  --> src\main.rs:62:10
   |
62 |         .attach(Template::fairing())
   |          ^^^^^^
Run Code Online (Sandbox Code Playgroud)

第一个错误查找Template并找不到它.在该示例的git repo中,它不存在.该示例如何工作?我确信我的main.rs中的Rust代码没问题,它与示例中的相同.我认为这只是一个依赖性问题.

我将Cargo.toml更改为:

[dependencies]
rocket = "*"
rocket_codegen = "*"
serde = "*"
serde_json …
Run Code Online (Sandbox Code Playgroud)

rust rust-rocket

3
推荐指数
1
解决办法
617
查看次数

Fileupload和PrettyFaces以及JSF 2.2

我尝试过以下解决方案: Primefaces FileUpload with PrettyFaces和JSF 2.2.3

但它不适用于少数文件(在tomcat 7.0.50下测试).

其中一个文件是:http: //ftp.carnet.hr/misc/apache//xerces/j/source/Xerces-J-src.2.11.0-xml-schema-1.1-beta.zip

有人为这个问题找到了更好的解决方案(除了删除urlmapping)吗?

编辑:没有错误/异常抛出!文件显示在PrimeFaces FileUpload中,但是不会触发监听器!JSF2.2 inputFile也不起作用!

jsf file-upload prettyfaces jsf-2.2

2
推荐指数
1
解决办法
1475
查看次数

nuxt.js + Apollo Client:如何禁用缓存?

我设法得到了一个运行 typescript 和 apollo graphql 的 nuxt.js + nest.js。为了测试 graphql 是否有效,我使用了这个示例中的文件,并在 nuxt.js 页面中添加了一个按钮(on:click -> 通过 graphql 加载所有猫)。

一切正常,阅读和写作。

问题是在通过操场进行更改或使用其他 graphql 数据重新启动 nest.js 服务器后,nuxt.js 页面显示旧数据(单击时)。我必须在浏览器中重新加载整个页面,才能让 Apollo-Client 获取新数据。

我尝试向 nuxt.config.ts 添加“无缓存”标志和“仅网络”标志,但没有成功:

apollo: {
defaultOptions: {
  $query: {
    loadingKey: 'loading',
    fetchPolicy: 'no-cache'
  }
},
clientConfigs: {
  default: {
    httpEndpoint: 'http://localhost:4000/graphql',
    wsEndpoint: 'ws://localhost:4000/graphql'
  }
}
}
Run Code Online (Sandbox Code Playgroud)

获取猫的函数:

private getCats() {
this.$apollo.query({ query: GET_CATS_QUERY }).then((res:any) => {
  alert(JSON.stringify(res.data, null, 0));
});
}
Run Code Online (Sandbox Code Playgroud)

如何禁用缓存或是否有其他解决方案?

graphql apollo-client nuxt.js

0
推荐指数
1
解决办法
2647
查看次数