草庐IT

principal-components

全部标签

java - Spring 3中@Component和@Configuration的区别

我遇到了Spring3提供的两个注释(@Component和@Configuration)我对这些有点困惑。这是我读到的关于@Component的内容Putthis“context:component”inthebeanconfigurationfile,itmeans,enabletheauto-scanningfeatureinSpring.Thebase-packageisindicatewhereareyourcomponentsstored,Springwillscanthisfolderandfindoutthebean(annotatedwith@Component)an

java - Spring @Configuration 和 <context :component-scan/>

我有一个场景configuringSpringSecurityonembeddedJetty如果我使用JavaConfig来配置Jetty服务器,这似乎有点解决了。因此,对于大型项目来说,JavaConfig而不是XML可能是更好的选择。但是,XML命名空间中有一些细节,例如@Configuration中不容易获得的设置。我发现ApplicationContextAware荣获@Configuration类,所以以下是可能的@ConfigurationpublicclassFooConfigimplementsApplicationContextAware{@Overridepubli

java - Spring @Configuration 和 <context :component-scan/>

我有一个场景configuringSpringSecurityonembeddedJetty如果我使用JavaConfig来配置Jetty服务器,这似乎有点解决了。因此,对于大型项目来说,JavaConfig而不是XML可能是更好的选择。但是,XML命名空间中有一些细节,例如@Configuration中不容易获得的设置。我发现ApplicationContextAware荣获@Configuration类,所以以下是可能的@ConfigurationpublicclassFooConfigimplementsApplicationContextAware{@Overridepubli

java - Spring 3 @Component 和静态工厂方法

如果我正在编写一个静态工厂方法来创建对象,我如何为该工厂类使用“@Component”注释并指示(带有一些注释)应该调用的静态工厂方法来创建该工厂类类(class)?以下是我的意思的伪代码:@ComponentclassMyStaticFactory{@publicstaticMyObjectgetObject(){//codetocreate/returntheinstance}} 最佳答案 恐怕你目前不能这样做。但是使用Java配置非常简单:@ConfigurationpublicclassConf{@BeanpublicMyO

java - Spring 3 @Component 和静态工厂方法

如果我正在编写一个静态工厂方法来创建对象,我如何为该工厂类使用“@Component”注释并指示(带有一些注释)应该调用的静态工厂方法来创建该工厂类类(class)?以下是我的意思的伪代码:@ComponentclassMyStaticFactory{@publicstaticMyObjectgetObject(){//codetocreate/returntheinstance}} 最佳答案 恐怕你目前不能这样做。但是使用Java配置非常简单:@ConfigurationpublicclassConf{@BeanpublicMyO

xml - 元素 "context"的前缀 "context:component-scan"未绑定(bind)

我正在研究spring3mvc并提出了这个错误org.xml.sax.SAXParseException:元素“context:component-scan”的前缀“context”未绑定(bind)。这是我的调度程序servlet 最佳答案 当您缺少xmlns:context声明但您已声明它时,就会出现这种类型的错误。检查您在"com.web"包中的类是否存在任何错误编码。 关于xml-元素"context"的前缀"context:component-scan"未绑定(bind),我们

xml - 元素 "context"的前缀 "context:component-scan"未绑定(bind)

我正在研究spring3mvc并提出了这个错误org.xml.sax.SAXParseException:元素“context:component-scan”的前缀“context”未绑定(bind)。这是我的调度程序servlet 最佳答案 当您缺少xmlns:context声明但您已声明它时,就会出现这种类型的错误。检查您在"com.web"包中的类是否存在任何错误编码。 关于xml-元素"context"的前缀"context:component-scan"未绑定(bind),我们

java - Spring Security 中的 "principal"是什么?

我对Spring和SpringSecurity非常陌生。我正在阅读有关SpringSecurity的内容,它提出了principal的概念,它应该是当前登录的用户。但是,如果我们有多个当前登录用户怎么办?那么,我的问题是,那么SpringSecurity的主体到底是什么?例如,我已经阅读了本教程:http://www.mkyong.com/spring-security/get-current-logged-in-username-in-spring-security/他们似乎考虑到当前只有一个登录用户,但这种情况并不常见。如何检索特定用户?以及如何区分正在执行请求的用户?

java - Spring Security 中的 "principal"是什么?

我对Spring和SpringSecurity非常陌生。我正在阅读有关SpringSecurity的内容,它提出了principal的概念,它应该是当前登录的用户。但是,如果我们有多个当前登录用户怎么办?那么,我的问题是,那么SpringSecurity的主体到底是什么?例如,我已经阅读了本教程:http://www.mkyong.com/spring-security/get-current-logged-in-username-in-spring-security/他们似乎考虑到当前只有一个登录用户,但这种情况并不常见。如何检索特定用户?以及如何区分正在执行请求的用户?

windows - 为什么我不能浏览 dll 来了解其中的内容? : "Some components could not be browsed"

我正在寻找一个丢失的COM接口(interface)X,我怀疑它是在Y.dll中定义的。我可以使用查看这个假定的界面grepXY.dll表示“匹配”。欢呼,怀疑得到证实!唉,当我在VisualStudioExpress中使用对象浏览器时,试图将Y.dll添加到我的自定义组件集中,我收到错误:“无法浏览某些组件”弹出窗口。那么我无法浏览这个dll的原因是什么?COM接口(interface)是否可以有意或无意地受到保护、隐藏、保护或遮蔽?显然我需要一个底漆!从官方的角度来看,Microsoft对此的所有了解似乎都缺乏洞察力:Thiserrorgenerallyoccurswhenyoua