Spring Security: how to get an authorized user in applicationContext.xml

Sorry for my english. How to get an authorized user in applicationContext.xml Authentication class: public class Authentication { public Account getAccount(){ return (Account) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); } } And in file applicationContext.xml: <bean id="Authentication" class="com.otv.util.Authentication"> </bean> <be

Spring Security:如何获得applicationContext.xml中的授权用户

对不起我的英语不好。 如何获得applicationContext.xml中的授权用户 Authentication等级: public class Authentication { public Account getAccount(){ return (Account) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); } } 并在文件applicationContext.xml中: <bean id="Authentication" class="com.otv.util.Authentication"> </bean> <bean id="CurrentAc

Integer.decode() in Spring application context

How to pass an integer value from properties to application, if this value can be stored in octal / decimal / hexadecimal form? properties example: app.size=0120 // should be 80 (dec). spring context: <bean id="resource"> <property name="size"> <bean class="java.lang.Integer" factory-method="decode"> <constructor-arg name="nm">

在Spring应用程序上下文中的Integer.decode()

如果该值可以以八进制/十进制/十六进制形式存储,如何将属性的整数值传递给应用程序? 属性示例: app.size=0120 //应该是80(十进制)。 春天背景: <bean id="resource"> <property name="size"> <bean class="java.lang.Integer" factory-method="decode"> <constructor-arg name="nm"> <bean class="java.lang.String">

Error 404 when reading properties file in spring

I am trying to read data from properties file.I have specified the path in xml.When I run the app it throws an error - * org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'fbStuffKeeper' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Could not resolve placeholder 'facebook.appId' My applicationContext.xml -

在春天读取属性文件时发生错误404

我正在尝试从属性文件中读取数据。我在xml中指定了路径。当我运行该应用程序时,它会引发错误 - * org.springframework.beans.factory.BeanDefinitionStoreException:在ServletContext资源中定义名为'fbStuffKeeper'的无效bean定义[/WEB-INF/applicationContext.xml]:无法解析占位符'facebook.appId' 我的applicationContext.xml - <bean class="org.springframework.web.servlet.mvc.a

Selenium tests with dockers or without

Let say I have some automated tests written in Selenium WebDriver. As far as I know I can use dockerized Firefox browser or even Selenium Grid. But my question is what is an advantage of docker firefox over standart firefox borwser? The same question when it comes to Selenium Grid in docker over standard Selenium Grid without docker. Can anyone tell me why one is better than another? Or in

硒测试与码头或不带

假设我有一些使用Selenium WebDriver编写的自动化测试。 据我所知,我可以使用dockerized Firefox浏览器甚至Selenium Grid。 但我的问题是docker firefox比firefox borwser的优势是什么? 在Docker上使用标准Selenium Grid而不使用Docker时,Selenium Grid会出现同样的问题。 谁能告诉我为什么一个人比另一个人好? 或者在哪些情况下最好在Selenium测试中使用docker? 一些码头优势: Docker可以为每个测试提供干净和

I want Selenium without tests

I've spent a lot of time writing Selenium scripts, and more recently, I've been using Selenium to automate repetitive processes I use a web browser to accomplish at work. I really wish I could write Selenium scripts without the need for a @Test annotation, or even better, any testing framework. I have done my fair share of research into the question, but they always point back to the s

我想要没有测试的硒

我花了很多时间编写Selenium脚本,最近,我一直在使用Selenium来自动化重复流程,我使用Web浏览器来完成工作。 我真的希望我可以编写Selenium脚本,而不需要@Test注释,或者甚至更好,任何测试框架。 我已经对这个问题进行了一些公正的研究,但是他们总是回头指出:“开始使用Selenium编写测试!” 页面。 那么,我用什么来自动化Web流程呢? 不需要@Test,只需在独立应用程序中编写通常的Selenium代码即可。 例如: publ

Selenium with Xvfb: firefox.NotConnectedException

I have selenium running on a server and I want it to display the browser on the client. I have launched xvfb on my server like that: Xvfb :1 -screen 0 1024x768x24 & Then on my Java code I wrote: String xPort = System.getProperty("Importal.xvfb.id", ":1"); FirefoxBinary firefoxBinary = new FirefoxBinary(new File("/usr/lib/firefox/firefox")); firefoxBinary.setEnvironmentProperty

硒与Xvfb:firefox.NotConnectedException

我有selenium在服务器上运行,我希望它在客户端上显示浏览器。 我已经在我的服务器上启动了xvfb: Xvfb :1 -screen 0 1024x768x24 & 然后在我的Java代码中写道: String xPort = System.getProperty("Importal.xvfb.id", ":1"); FirefoxBinary firefoxBinary = new FirefoxBinary(new File("/usr/lib/firefox/firefox")); firefoxBinary.setEnvironmentProperty("DISPLAY", xPort); WebDriver webDriver

How to use / in a Datomic query?

This query [:find ?p ?af :where [?p :person/age ?pa] [?p :person/father ?f] [?f :person/age ?fa] [(/ ?pa ?fa) ?af]] returns only rounded (to 0 decimal places) values for ?af , so I can't add sth. like [(< 0.25 ?af)] [(< ?af 0.5)] to the :where clause. I have tried casts to various types inside the query like [(double ?pa) ?pa2] but this only affects t

如何在Datomic查询中使用/?

这个查询 [:find ?p ?af :where [?p :person/age ?pa] [?p :person/father ?f] [?f :person/age ?fa] [(/ ?pa ?fa) ?af]] 只返回?af四舍五入(小数点后0位)值,所以我不能添加某物。 喜欢 [(< 0.25 ?af)] [(< ?af 0.5)] 到:where子句。 我已经试过在查询内部的各种类型 [(double ?pa) ?pa2] 但是这只影响结果类型,并且从不删除舍入。 如果你知道某些东西并且经验丰富,我还有更

Unexpected behavior of double primitive type data

I want to understand how the Java double type will store its value in memory in Java. When I run the following code I get unexpected output: public static void main(String[] args) { float a = 1.5f; float b= 0.5f; double c= 1.5; double d = 0.5; float a1 = 1.4f; float b1= 0.5f; double c1= 1.4; double d1 = 0.5; System.out.println(" a- b is " + (a-b)); Sy

双原始类型数据的意外行为

我想了解Java double类型如何将其值存储在Java中的内存中。 当我运行下面的代码时,我得到意外的输出: public static void main(String[] args) { float a = 1.5f; float b= 0.5f; double c= 1.5; double d = 0.5; float a1 = 1.4f; float b1= 0.5f; double c1= 1.4; double d1 = 0.5; System.out.println(" a- b is " + (a-b)); System.out.println(" c- d is " + (c-d)); S

Step into Java EE code in Eclipse

Debugging sessions in Eclipse and Java EE code are a pain and I'm hoping someone has a better method than mine. Here is a typical call stack between 2 EJB stateless bean methods (using TomEE 1.0) : NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39 DelegatingMethodAccessorImpl.invoke(

在Eclipse中进入Java EE代码

Eclipse和Java EE代码中的调试会话很痛苦,我希望有人比我更好。 以下是两个EJB无状态bean方法(使用TomEE 1.0)之间的典型调用堆栈: NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method] NativeMethodAccessorImpl.invoke(Object, Object[]) line: 39 DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 25 Method.invoke(Object, Object...) line: 597 Re

Is there an Android native library for XMPP client?

I am working on XMPP client for Android, we have establish our Ejabberd server(2.1.11) on ubuntu 14.04. For implementing XMPP android client i have used patched version of java smack called aSmack and it is great as you have to include asmack.XXX.jar in your android project lib folder and write some code which is easy available on INTERNET,i want to thank all developer for their awesome work.

XMPP客户端是否有Android本机库?

我正在为Android开发XMPP客户端,我们已经在ubuntu 14.04上建立了我们的Ejabberd服务器(2.1.11)。 为了实现XMPP android客户端,我使用了java smack的补丁版本,名为aSmack,它非常棒,因为您必须在您的android项目lib文件夹中包含asmack.XXX.jar并编写一些在INTERNET上易于使用的代码,我要感谢所有开发人员为他们的工作做出了杰 这里 我很好奇使用什么样的机制与XMPP服务器进行通信 但根据我们的客户要求,我不能使