草庐IT

namespace-uri

全部标签

java - 用于解析 URI 的 Spring 实用程序

我想使用现有的Spring功能从URL中提取路径变量和查询参数。我有一个路径格式字符串,它对MVC@RequestMapping或UriComponentsBuilder有效。我也有一个实际的路径。我想从该路径中提取路径变量。例如。Stringformat="location/{state}/{city}";StringactualUrl="location/washington/seattle";TheThingImLookingForparser=newTheThingImLookingFor(format);Mapvariables=parser.extractPathVaria

java - "Expecting/to follow the hostname in URI"密码包含@时异常

我正在尝试将本地系统文件复制到服务器packageclasses;importjava.io.File;importjava.io.FileInputStream;importjava.io.InputStream;importjava.util.Properties;importorg.apache.commons.vfs.FileObject;importorg.apache.commons.vfs.FileSystemOptions;importorg.apache.commons.vfs.Selectors;importorg.apache.commons.vfs.impl.S

java - 我如何找出我需要从 Java 库中导入的 namespace ?

我正在编写一些clojure代码,我依赖Jodatime进行时间处理。问题是我不知道要导入什么,文档也不是很清楚。现在我知道这里有人可能会在不到5秒的时间内给我正确答案,但我更想知道如何自己解决这个问题(除了翻阅文档直到找到正确答案)。如果我在Python中执行此操作,我将导入顶级包并使用dir和help的组合来找出我需要导入的内容.在clojure中有什么办法可以做到这一点吗?或者是否有任何其他类型的java工具可以解决这个问题?我更喜欢面向命令行的东西。 最佳答案 通常我会选择DavidGrant的回答,但如果您找不到任何Jav

java - 在 Tomcat 中自动检测 URI 编码

我有一个正在运行的ApacheTomcat6.x实例,我希望它能够比默认行为更智能地解释传入URL的字符集。特别是,我想实现以下映射:So%DFe=>SoßeSo%C3%9Fe=>SoßeSo%DF%C3%9F=>(error)我想要的行为可以描述为“尝试将字节流解码为UTF-8,如果它不起作用,则假定为ISO-8859-1”。在这种情况下,简单地使用URIEncoding配置是行不通的。那么我该如何配置Tomcat以我想要的方式对请求进行编码呢?我可能必须编写一个过滤器来接收请求(尤其是查询字符串)并将其重新编码为参数。这是自然的方式吗? 最佳答案

javax.xml.绑定(bind).UnmarshalException : unexpected element (uri :""

我在将XML响应从服务转换为POJO时遇到异常。XML如下所示:这是我的XMLresponse.javax.xml.bind.UnmarshalException:unexpectedelement(uri:"",local:"ItemSearchResponse").Expectedelementsare我是这样使用它的:Documentresponse=getResponse(url);JAXBContextcontext=JAXBContext.newInstance(AmazonItem.class);UnmarshallerunMarshaller=context.creat

java - 在 Java 中规范化可能编码的 URI 字符串

我想使用Java去除片段标识符并对一组不同的URI进行一些简单的规范化(例如,小写方案、主机)。输入和输出URI在一般HTTP意义上应该是等价的。通常,这应该是直截了当的。但是,对于像http://blah.org/A_%28Secret%29.xml#blah这样的URI,它的百分比编码(Secret),的行为java.util.URI让生活变得困难。规范化方法应该返回http://blah.org/A_%28Secret%29.xml因为URIshttp://blah.org/A_%28Secret%29。xml和http://blah.org/A_(Secret).xml在解释[

uri :: invalidurierror:糟糕的Uri(不是Uri?):Heroku Redis错误

我正在尝试在Heroku上推我的Rails应用程序,我正在使用HerokuRedistogo插件,我已经完成了此操作教程并经历了那里提到的所有步骤。但是,在推动Heroku时会遇到这个错误:remote:rakeaborted!remote:URI::InvalidURIError:badURI(isnotURI?):通过我的Heroku日志,我发现了这一点:2017-07-13T10:06:32.602356+00:00app[web.1]:[4]*Minthreads:5,maxthreads:52017-07-13T10:06:32.602356+00:00app[web.1]:[4]*

Java XPath : Queries with default namespace xmlns

我想对此文件执行XPath查询(显示摘录):这是我正在使用的代码片段:DocumentBuilderFactorydomFactory=DocumentBuilderFactory.newInstance();DocumentBuilderbuilder=domFactory.newDocumentBuilder();Documentdocument=builder.parse(newFile(testFile));XPathFactoryfactory=XPathFactory.newInstance();XPathxpath=factory.newXPath();xpath.set

java - Eclipse - 找不到 uri http ://java. sun.com/jsf/html 的 facelet 标签库

在我的index.xhtml中,我有一个像这样定义的命名空间xmlns:h="http://java.sun.com/jsf/html"。此url处的服务器指示页面cannotbefound.你知道页面移到哪里了吗?eclipse信息Version:IndigoReleaseBuildid:20110615-0604 最佳答案 为了解决这个问题,我就是这样做的:1.Closetheeclipseproject2.Opentheeclipseproject3.Rightclickontheproject4.ClickonValidat

java - 如何在 Java 中解析这样的 URI

我正在尝试解析以下URI:http://translate.google.com/#zh-CN|en|你但收到此错误消息:java.net.URISyntaxException:Illegalcharacterinfragmentatindex34:http://translate.google.com/#zh-CN|en|你atjava.net.URI$Parser.fail(URI.java:2809)atjava.net.URI$Parser.checkChars(URI.java:2982)atjava.net.URI$Parser.parse(URI.java:3028)“|