草庐IT

invalid_request

全部标签

java - 为什么没有发送 cookie 时 request.getCookies() 返回 null?

根据Javadoc,HttpServletRequest.getCookies()“返回包含客户端随此请求发送的所有Cookie对象的数组。”,如果没有发送cookie,则返回null。除了返回一个空数组之外,这种行为是否有特定的原因,这对我来说似乎更直观一些,并且避免了在迭代数组以查找特定cookie之前需要检查是否为null? 最佳答案 在这种情况下,这曾经是Java的常见做法。主要原因可能是不返回任何内容比返回空列表更有效(垃圾收集器的工作更少)。 关于java-为什么没有发送co

java - org.springframework.beans.NotWritablePropertyException : Invalid property 'adminEmails' of bean class

我被下面给出的这个错误卡住了:堆栈跟踪Apr16,201412:21:23PMorg.springframework.beans.factory.xml.XmlBeanDefinitionReaderloadBeanDefinitionsINFO:LoadingXMLbeandefinitionsfromclasspathresource[beans.xml]Exceptioninthread"main"org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'collection

java - 松弛请求验证 : Can't compute matching request digest using signed secret

我正在Slack上实现交互式消息,其中包含一些操作按钮。使用SlackApp我能够处理Slack用户点击我的JavaSpringbootAPI上的按钮。到这一刻,一切都很好。但是,我努力计算匹配的请求签名(摘要)以验证它实际上来自Slack。我阅读了Slackverificationdocumentationpage上的所有文档。该页面描述,签名必须计算为HMACSHA256哈希,使用SigningSecret作为key和内容作为松弛版本、时间戳和请求主体的串联,例如:v0:123456789:command=/weather&text=94070页面上写着:...Evaluateon

java - Liferay 中不同的 "request"隐式对象

从这些隐式对象中获取属性有什么区别:renderRequest.getAttribute("myVar")actionRequest.getAttribute("myVar")request.getAttribute("myVar")为什么都允许?我的意思是您通常将属性存储在actionRequest或renderRequest对象中,但您可以在request隐式对象中获取它,为什么?什么是正确的做法?如何在View时间内获取Action对象?是不是违反了action-render的renderParams传递机制?如果在JSP中尝试使用它们时抛出NullPointerExceptio

java - Spring DispatcherServlet : No mapping found for HTTP request

我在使用springmvc3.2.4.RELEASE实现一个非常简单的页面时遇到问题。我的Controller看起来像这样:@Transactional@ControllerpublicclassMembersDetailsController{@AutowiredprivateMemberServicememberService;@RequestMapping(value="/member/{name}",method=RequestMethod.GET)publicStringdisplayMember(@PathVariableStringname){System.out.pri

java - log4j2-gelf "ERROR StatusLogger appenders contains an invalid element or attribute "GELF""

刚开始接触Graylog2,想通过GELF输入记录一些Java应用程序。因此我使用了库log4j2并添加了graylog2-gelfclient。满足所有依赖项并且程序正在运行。但是我的Logmanager的初始化抛出以下错误:ERRORStatusLoggerappenderscontainsaninvalidelementorattribute"GELF"我的代码只是将错误记录到记录器:staticfinalLoggerlogger=LogManager.getLogger(Application.class);publicstaticvoidmain(String[]args){

java - "error_description": "AADSTS70002: The request body must contain the following parameter: ' client_secret or client_assertion'

我使用了https://github.com/AzureAD/azure-activedirectory-library-for-java/blob/master/src/samples/public-client-app-sample/src/main/java/PublicClient.java中的代码.唯一的区别是CLIENT_ID已更新。我一直收到错误消息"error_description":"AADSTS70002:Therequestbodymustcontainthefollowingparameter:'client_secretorclient_assertion'

java - Keycloak错误invalid_client Bearer only not allowed

我正在尝试部署一个使用keycloak保护的非常简单的REST服务,但出现以下错误:Causedby:org.keycloak.authorization.client.util.HttpResponse.Exception:Unexpectedresponsefromserver:400/BadRequest/Responsefromserver:("error":"invalid_client","error_description":"Bearer-onlynotallowed")这个错误是什么意思?我该如何解决? 最佳答案

javadoc : error - invalid flag: -Xdoclint:none, 当我使用 java 7 时,它在 java 8 中有效

当我运行具有-Xdoclint:none的pom时,Maven工作正常使用JAVA8,因为-Xdoclint在JAVA8中添加。但是,当我使用JAVA7运行maven时它会抛出错误,因为它在JAVA7中不存在。但我想让pom为JAVA7和JAVA8通用化,即如果JAVA8我应该能够使用指定的“additionalparam”但是当使用JAVA7时,它应该排除该参数。 最佳答案 找到解决方案-doclint-java8-disable[1.8,)-Xdoclint:none然后使用${javadoc.opts}信用-https://s

java - MyBatis Spring MVC 错误 : Invalid bound statement (not found)

这是我尝试使用MyBatis执行简单查询时的堆栈跟踪:org.apache.ibatis.binding.BindingException:Invalidboundstatement(notfound):com.my.package.persistence.BrandMapper.getBrandorg.apache.ibatis.binding.MapperMethod$SqlCommand.(MapperMethod.java:189)org.apache.ibatis.binding.MapperMethod.(MapperMethod.java:43)org.apache.ib