草庐IT

request-uri

全部标签

java - 为什么 Java 会自动解码 URI 编码文件名中的 %2F?

我有一个servlet,需要写出具有用户可配置名称的文件。我正在尝试使用URI编码来正确转义特殊字符,但JRE似乎自动将编码的正斜杠%2F转换为路径分隔符。例子:Filedir=newFile("C:\DocumentsandSetting\username\temp");Stringfn="Top1/2.pdf";URIuri=newURI(dir.toURI().toASCIIString()+URLEncoder.encoder(fn,"ASCII").toString());Fileout=newFile(uri);System.out.println(dir.toURI().

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 - "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 - 如何在 Tomcat 中获取 org.apache.catalina.connector.Request 对象?

我需要编写一个Servlet或Filter类来访问org.apache.catalina.connector.Request对象,该对象包装在提供给我的servlet的RequestFacade对象中。转换不起作用,因为RequestFacade不是Request的子类。我需要这个的原因是因为我试图调用Request的setRequestedSessionId()方法,这显然不是Httpservlet规范的一部分。我需要这样做的原因是因为sessionID包含在URL中,名称与JSESSIONID不同。我无法更改URL或参数名称,因此我尝试通过提取sessionID并调用Request

java - NetBeans 中的警告 : Skipping entry because it is not an absolute URI. GlassFish

我成功安装了GlassFish。但是,当我启动服务器时,会收到两条警告消息:警告:跳过条目,因为它不是绝对URI。那是什么?LaunchingGlassFishonFelixplatformAug09,201410:38:38PMcom.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisionercreateBundleProvisionerINFO:Createbundleprovisionerclass=classcom.sun.enterprise.glassfish.bootstrap.osgi.BundleProvisio

java - 删除传输编码 :chunked in the POST request?

我正在使用以下代码发送一个POST请求,但该请求是以分块形式发送的(Transfer-Encoding:chunked)。我用谷歌搜索了这个问题,它说要包含Content-Length但在下面的代码中我不知道如何设置Content-Length:@RequestMapping(value="/contacts",method=RequestMethod.POST)publicMapaddContactInfo(@RequestBodyMapContactInfoDto){ContactInfocontactInfo=ContactInfoDto.get("contact");if(co

java - Spring : Multipart form data request : Read dynamic parameter from request

我正在使用Spring框架并能够成功将文件上传到服务器上。................//Controller层@RequestMapping(value="/upload.do",method={RequestMethod.POST})publicStringaddEditLocationToCompany(Modelmodel,@RequestParam("description")Stringdesc,@RequestParam(value="locationMapFile",required=false)CommonsMultipartFilelocationMapFile

java - 为什么在 POST JSON 字符串时得到 "Error parsing HTTP request header"?

我正在尝试从浏览器向我的服务器(本地主机)发送一个POST请求。我的请求网址是:http://localhost:8080/myPath/myServlet?requestData={.......//JsonString......};requestData是一个json字符串(我为此目的使用GSON。)一切正常,直到json字符串中的数据超过特定限制。比如说,我在json字符串中发送对象数组。如果列表中的对象数量超过67,则会出现以下错误:AMorg.apache.coyote.http11.AbstractHttp11ProcessorprocessINFO:Errorparsi

java - Play 2.0 Java : Bind an array from request

我...卡住了o.O我在国外请求中有参数:param[62537]=abc;param[20356]=cde;param[92837]=fgh;我正在寻找任何方式来绑定(bind)它们,即。使用DynamicForm。我可以通过以下方式获取参数:DynamicFormdynamicForm=form().bindFromRequest();StringfirstParam=dynamicForm.field("param[62537]").value();但是我当然不知道索引,因为它们是在独立应用程序创建的客户端表单中选择的。当我尝试使用时:String[]firstParam=dyn