草庐IT

get_type

全部标签

java - Spring 安全oauth2 : get username in REST webservice

我已经创建了一个RESTful网络服务来对工作流执行操作。Web服务使用我自己的授权服务器通过oauth2进行保护。我想在我的工作流程中添加有关谁对其执行操作的信息。我想不通的是,谁可以获取调用Web服务的用户名。对于Web服务实现,我使用jersey(1.18.1),为了安全,我使用spring-security-oauth2(2.0.2.RELEASE)。我正在使用数据库token存储,其中包含一个表OAUTH_ACCESS_TOKEN(TOKEN_ID、TOKEN、AUTHENTICATION_ID、USER_NAME、CLIENT_ID、AUTHENTICATION、REFRE

java - 为什么我得到 org.codehaus.jackson.map.JsonMappingException : No suitable constructor found for type

有人可以告诉我为什么我会收到org.codehaus.jackson.map.JsonMappingException:Nosuitableconstructorfoundfortypeerror?这是我的电话:try{Stringjsonreturn=restTemplate.getForObject("http://"+mRESTServer.getHost()+":8080/springmvc-rest-secured-test/json/{name}",String.class,vars);LOGGER.debug("returnobject:"+jsonreturn.toSt

java - ArrayList.contains() 对比 HashMap.containsKey() 对比 HashMap.get()

ArrayList.contains()是否必须遍历所有项目才能进行检查?HashMap.containsKey()吗?我知道HashMap.get()不需要,但这就是它最有效的原因吗? 最佳答案 嗯嗯ArrayList.contains()迭代?/***Returnstrueifthislistcontainsthespecifiedelement.*Moreformally,returnstrueifandonlyifthislistcontains*atleastoneelementesuchthat*(o==null&nbs

java - rxjava 延迟 : How to get variable delay on each item emitted from a list?

我想在从可观察列表发出的每个项目之间设置自定义延迟,作为项目本身的函数。假设我们有一个列表作为(项目,延迟):[("item1",2),("item2",1),("item3",2),("item4",3),("item5",2),("item6",3)]我希望输出是这样的:0seconds:1seconds:item12seconds:item23seconds:4seconds:item35seconds:6seconds:7seconds:item48seconds:9seconds:item510seconds:11seconds:12seconds:item6Complete

hibernate 中的 Javassist 失败 : invalid constant type: 60

我正在创建一个cli工具来管理现有的应用程序。应用程序和测试都构建良好并运行良好,但尽管我在运行jar中存在的cli工具时收到javassist失败:INFO:Bytecodeprovidername:javassist...INFO:HibernateEntityManager3.5.1-FinalExceptioninthread"main"javax.persistence.PersistenceException:UnabletoconfigureEntityManagerFactoryatorg.hibernate.ejb.Ejb3Configuration.configur

Java secondary not public 类的使用会产生错误 "Type is not Visible",即使访问的方法在主类中是公共(public)的

我有一个Main.java文件:publicclassMain{privateEntityDrawerentityDrawer;publicvoidsetEntityDrawer(EntityDrawerentityDrawer){this.entityDrawer=entityDrawer;}publicEntityDrawergetEntityDrawer(){returnentityDrawer;}}classEntityDrawer{privateEmpleadoempleado;publicEmpleadogetEmpleado(){returnempleado;}publi

java - Jersey 序列化/反序列化问题 : abstract types can only be instantiated with additional type information

我正在使用Jersey进行序列化和反序列化。我已经使用Jersey在WebLogic上创建了RESTchannel。我有包含抽象类的结果对象。Jersey使用此类的实现名称添加到结果元数据中:{"order":{"@type":"installationOrder",但是,同样的Jersey,在用于反序列化这些数据时,尖叫着以下内容:Causedby:org.codehaus.jackson.map.JsonMappingException:Cannotconstructinstanceofocl.mobile.service.data.order.DetailedOrder,prob

java - 为什么我会收到错误 "File cannot be resolved to a type"?

这是我的部分代码try{BufferedReaderin=newBufferedReader(newInputStreamReader(System.in));while((line=in.readLine())!="exit"){System.out.println("Entercommand");line=in.readLine();CommandcurrentCommand=newCommand(line);FilecurrentFile=newFile(currentCommand.getLsPath());currentCommand.getLsPath()方法返回一个字符串

java - HashMap put() 和 get() 方法工作原理的内部结构(仅基本逻辑)

当我们使用put()方法在HashMap类中放置一个键实例说“键”和一个值实例说“值”时,HashMap类内部做的。当我们说hashMap.get(key)时,它如何取回值?编辑:我不想在这里详细说明,主要是想了解大局以及equals()和hashcode()的作用>put()和get()操作中的方法。 最佳答案 如果你谈论更高的图片,就像下面这样。这里我将项目称为Map的key在放置元素时。计算key的hashcode如果存在具有该哈希码的basket,则在键上使用equals方法搜索该篮子中的键以确定元素是否将被添加或替换。如果

Java 正则表达式 : Just get a part of the matcher group

我在Java中有一个正则表达式:Patternpattern=Pattern.compile(text.+);Matchermatcher=pattern.matcher(ganzeDatei);while(matcher.find()){Stringstring=matcher.group();...这工作正常,但输出类似于textName但我只想要这个:Name我该怎么做? 最佳答案 通过将其括在括号中来捕获要返回的文本,因此在此示例中,您的正则表达式应变为text(.+)然后您可以访问括号之间匹配的文本matcher.grou