我想在Tomcat 7中使用Mojarra 2.1,所以我在我的pom文件中添加了以下依赖项:
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.1.2</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.1.2</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
但是,当我尝试启动Tomcat时,我遇到以下异常:
org.apache.catalina.LifecycleException: Failed to start component [StandardServer[8007]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
at org.apache.catalina.startup.Catalina.start(Catalina.java:621)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450)
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardService[Catalina]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:727)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
... 7 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
... 9 more
Caused by: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]]
at …Run Code Online (Sandbox Code Playgroud) 如何使用Maven创建桌面(独立/ Swing)应用程序?
我正在使用Eclipse 3.6.
从Eclipse 3.6运行Tomcat时,避免permgen空间错误的最佳方法是什么?这是通过添加以下行来完成的:
-XX:MaxPermSize=512m
Run Code Online (Sandbox Code Playgroud)
在结尾eclipse.ini?或者是否需要额外的配置?
我正在使用eclipse helios 3.6 ,我正在开发JSF页面(带有JSF功能的动态Web项目),有时我需要在xhtml页面中为组件添加样式
<h:commandLink style="margin-righ:10px">
Run Code Online (Sandbox Code Playgroud)
(不是样式类)我想添加CSS自动完成到eclipse如何这样做?请指教,谢谢.
我很困惑使用 maven-surefire-plugin或maven-failsafe-plugin在集成测试阶段运行我的selenium测试(没有运行单元测试)的概念我看到一些例子使用maven- surefire -plugin和其他示例使用maven-故障保护,插件
请告知样品或链接到配置.
continuous-integration integration-testing automated-tests java-ee maven
我想使用Spring Security Facelets标记库来保护我的JSF 2页面中的UI组件
我有春天安全版3.0.5的以下依赖项:
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId>
<version>${spring-security.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-web</artifactId>
<version>${spring-security.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-config</artifactId>
<version>${spring-security.version}</version>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-taglibs</artifactId>
<version>${spring-security.version}</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)
我配置了applicationSecurity.xml以进行spring安全性登录,它可以与UserDetailsService一起使用,并且在尝试添加安全性定义时:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:ice="http://www.icesoft.com/icefaces/component"
xmlns:pretty="http://ocpsoft.com/prettyfaces"
xmlns:sec="http://www.springframework.org/security/tags">
Run Code Online (Sandbox Code Playgroud)
当运行应用程序时,我得到以下错误:
Warning: This page calls for XML namespace http://www.springframework.org/security/tags declared with prefix sec but no taglibrary exists for that namespace.
Run Code Online (Sandbox Code Playgroud)
参考:http://static.springsource.org/spring-security/site/petclinic-tutorial.html
请指教.
我有一个弹簧安全保护方法如下:
@PreAuthorize("hasRole('add_user')")
public void addUser(User user) ;
Run Code Online (Sandbox Code Playgroud)
如果没有enoguh权限的用户试图调用它,则抛出accessDenied异常:
org.springframework.security.access.AccessDeniedException: Access is denied
Run Code Online (Sandbox Code Playgroud)
这是预期的,但问题是,为什么定义的访问被拒绝处理程序
在security.xml配置文件中不起作用:
<access-denied-handler error-page="accessDenied"/>
Run Code Online (Sandbox Code Playgroud)
我的意思是没有工作,当用户没有足够的权限尝试按下按钮addUser将调用服务addUser(只有用户可以访问具有此权限)时,抛出AccessDenied异常,这是所需的行为,但用户不是不会重定向到xml中配置的访问被拒绝异常.
当抛出此异常时,用户是否应该自动重定向到访问被拒绝的页面,或者我必须在代码中明确定义此类行为?
请指教.
我使用Spring Security 3.0.5与JSF 2.1和ICEFaces 2
更新: applicationSecurity.xml:
<beans:beans xmlns="http://www.springframework.org/schema/security"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.0.4.xsd
http://www.springframework.org/schema/util
http://www.springframework.org/schema/util/spring-util-3.1.xsd">
<!-- Enable @pre, @post spring security method level annotations -->
<global-method-security pre-post-annotations="enabled" />
<http use-expressions="true" auto-config="true" access-denied-page="/accessDenied">
<session-management session-fixation-protection="none"/>
<remember-me token-validity-seconds="1209600"/>
<intercept-url pattern="/accessDenied" access="permitAll"/>
<intercept-url pattern="/login" access="permitAll"/>
<intercept-url pattern="/j_spring_security_check" access="permitAll" />
<intercept-url pattern="/faces/javax.faces.resource/**" access="permitAll" …Run Code Online (Sandbox Code Playgroud) 我有一个spring应用程序 ,我按如下方式编写测试类:
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:/META-INF/spring/applicationContext.xml" })
@TransactionConfiguration(defaultRollback = true)
@Transactional
public class MyTest {
}
Run Code Online (Sandbox Code Playgroud)
当我尝试创建另一个测试类并尝试运行该应用程序时,我在新的测试类上得到以下异常:
ERROR [main] (TestContextManager.java:324) - Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecut
r@22e85825] to prepare test instance [Testing.MyTest2@43f2f70a]
org.springframework.aop.framework.AopConfigException: Cannot proxy target class because CGLIB2 is not available. Add CGLIB to the class path or specify proxy interfaces.
at org.springframework.aop.framework.DefaultAopProxyFactory.createAopProxy(DefaultAopProxyFactory.java:67)
at org.springframework.aop.framework.ProxyCreatorSupport.createAopProxy(ProxyCreatorSupport.java:104)
at org.springframework.aop.framework.ProxyFactory.getProxy(ProxyFactory.java:112)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.createProxy(AbstractAutoProxyCreator.java:476)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.wrapIfNecessary(AbstractAutoProxyCreator.java:362)
at org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator.postProcessAfterInitialization(AbstractAutoProxyCreator.java:322)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1426)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:386)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:111)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:321)
at …Run Code Online (Sandbox Code Playgroud) 我对创建服务层和DAO层的结构感到困惑:在某些示例中,我看到有些人为服务和DAO 创建接口+实现,在其他示例中,我看到人们仅在DAO扩展包含AbstractDao类时才创建实现那些DAO的通用方法,所以我很困惑该怎么做,为什么要选择这个解决方案或另一个,以及最佳实践(常用)请提供建议.
我在我的spring bean中有一个字段(使用jsf管理bean),我使用JSR303 bean验证使用@Size注释验证它的长度,如下所示:
@Size(min = 7, max = 15, message = "{password.range}")
private String newPassword;
Run Code Online (Sandbox Code Playgroud)
我想知道如何从属性文件中读取最小值和最大值,请指教.
java-ee ×5
eclipse ×3
java ×3
maven ×3
spring ×3
jsf ×2
tomcat ×2
autocomplete ×1
facesservlet ×1
junit ×1
oop ×1
spring-aop ×1
structure ×1
validation ×1