java-ee

ClientRequestFactory RestEasy Deprecated… Any other RestEasy alternative ?

房东的猫 提交于 2019-12-12 09:01:19
问题 I need to create rest-easy client, using de interface of the RestService created by others... That's work good, except by just one thing... When i update from rest-easy 2.3.5.Final to rest-easy 3.0.x, the ClientRequestFactory class appear like @Deprecated. The actual code is: ClientRequestFactory crf = new ClientRequestFactory(UriBuilder.fromUri("http://url-of-service").build()); SomeRestInterface client = crf.createProxy(SomeRestInterface.class); client.theMethod(); Any one, now what is the

Is there any difference on JDK5/JDK 6 when converting String to Date

孤街醉人 提交于 2019-12-12 09:00:55
问题 Could it possible that JDK 5 can produce "default message [Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'orderDate'; nested exception is org.springframework.core.convert.ConversionFailedException:Failed to convert from type java.lang.String to type java.util.Date for value 'Mon May 27 12:27:20 ART 2013'" But not on JDK6? current application is Spring on JBoss so that the conversion is not explicit. I get this issue from Jboss

JSF 2.0 and Facelets

ぐ巨炮叔叔 提交于 2019-12-12 08:56:37
问题 In blogs i have read that JSF 2.0 is inlcuding Facelets. So i only included JSF-api.jar and JSF-impl.jar to my Java build path. But if i try to use Facelet tags, they don't work. Do i need to configure Facelets anywhere or must i include any further libraries? THX. 回答1: It should works fine. More information and working example you can find in IBM developer works article and following articles in this series. 回答2: How to configure/use Facelets is outlined the Java EE 6 tutorial: Developing a

Can't use classes from different Maven modules

核能气质少年 提交于 2019-12-12 08:53:54
问题 Need to create a multi module maven project which consist of a registration module and main project. The problem is that it's impossible to use classes declared in different modules. e.g.: I have a ParentClaz in my parent's src/main/java dir and ChildClaz in child's src/main/java dir. Right now it's not possible to use neither ParentClaz in ChildClaz nor vice versa. The project's structure looks like this: +-- AdminPortal <- parent root +-- registration <- child root -- pom.xml <- child pom -

Should I use Security Manager in Java web applications?

我是研究僧i 提交于 2019-12-12 08:44:43
问题 Is it sufficient to secure a Java web application with the rights of the user that is running the application server process or is it reasonable also to use SecurityManager with a suitable policy file? I have used to do the former and not the latter, but some customers would like us to also use SecurityManager that would explicitly give permissions to every third-party component to be sure there isn't any evil code lurking there. I've seen some Servlet containers, like Resin to propose not

Jersey LoggingFilter with log4j

戏子无情 提交于 2019-12-12 08:41:52
问题 I have a rest service developed with jersey, I have a ContainerRequestFilters for print the request, as follows: <init-param> <param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name> <param-value>com.sun.jersey.api.container.filter.LoggingFilter</param-value> </init-param> and I have logger in the post methods using log4j. But the LoggingFilter print in the log different log4j. Is there any way that LogginFilter use the log4j's configuration? I tried this in the log4j.xml

How to sign a jar to never expire?

邮差的信 提交于 2019-12-12 08:38:28
问题 I used jarsigner to sign my jar file. But I got a warning: Warning: This jar contains entries whose signer certificate will expire within six months. How can I make it never expire or expire in a longer time? 回答1: Specify the required number of days in the -validity parameter to keytool. Addendum: -validity is an option to keytool. keytool -genkey -alias sawyer -validity 1234 -dname "…" After you create the new key, use its unique alias with jarsigner to sign your JAR. 来源: https:/

How to name repository and service interfaces?

徘徊边缘 提交于 2019-12-12 08:27:55
问题 How do you name repository and service interfaces and their implementing classes? For example I have a model with the name Question . What would you name the repository (interface and implementation) and the service (interface/implementation). After reading these posts: Java Interfaces/Implementation naming convention and Interface naming in Java I reconsidered what I already had done :) 回答1: I think that there are roughly two approaches to naming in DDD: 1) Stereotype based. This is where

EJB Factory Class

对着背影说爱祢 提交于 2019-12-12 08:17:40
问题 I'm trying to create an EJB factory class, which works like this: You have a method which takes as argument a class of an EJB, then it checks whether the EJB has a remote interface (if not throw an exception) and if it does, it returns the concerning EJB. The code below does exactly this. However the object it returns is of the type of the remote interface of the concerning bean and not of the bean itself. How can I change this? Is there a way to tell Java that the generic type T is of the

Java EE architecture with Play Framework

♀尐吖头ヾ 提交于 2019-12-12 08:14:49
问题 Is it possible to reproduce a Java EE architecture with Play? By Java EE I mean these 4 layers: view, controller, service, model. I know play use a better architecture only based on MVC, and I love this one, but I must use a Java EE architecture for a specific project and I'd like to use Play considering it's the best Java framework from my point of view. 回答1: You can use spring module to integrates spring with play and use it for the service/model layers : http://www.playframework.org