java-ee-7

What are the available Java EE Websockets implementations?

笑着哭i 提交于 2019-12-23 22:36:39
问题 For the JSR 356 - Java API for WebSocket i know the reference implementation is Tyrus. Are there any others? If not, then i guess Tyrus is the implementation in all Application Servers (Glassfish, JBossAS/Wildfly etc...) 回答1: As far as I know, there are a few JSR 356 Java API for WebSocket implementations besides Tyrus (the reference implementation): Apache Tomcat Jetty Undertow used by WildFly Glassfish is the Java EE reference implementation and uses Tyrus. According to my researches: IBM

Should we always use Asynchronous JAX-RS resources For mobile backend?

强颜欢笑 提交于 2019-12-23 05:25:27
问题 I am building Mobile backend API using Java EE - JAX-RS 2.0 technology. Since most of mobile client consumes are asynchronous http calls so my question is: Should I use asynchronous feature for all JAX-RS resources ? And the reason if not? The below is the template Mobile Async API @Path("/async_api") public class AsyncResource { @GET @Path("/loadUsers") @Produces(MediaType.APPLICATION_JSON) public void loadUsers(@Suspended AsyncResponse asyncResponse) { //TODO: ManagedExecutorService new

overriding equals and hashcode methods in java?

ぐ巨炮叔叔 提交于 2019-12-23 03:09:23
问题 I have below class. Request.java public class Request implements Serializable { private String id; private String name; private String hid; // getters and setters // This class does not override any equals() and hashCode() methods } public class EmpRequest implements Serializable { private Request request; //Now here in this class I need override equals() and hashCode() methods based on **request** } In EmpRequest class, I need to override equals() and hashCode() based on properties of

Custom Security mechanism in Java EE 6/7 application

故事扮演 提交于 2019-12-22 10:10:02
问题 I would like to create (implement by my own) authentication mechanism which will be plugged into my Java EE application. As far as I know I have to implement LoginModule and connect this implementation with container mechanisms somehow. But the problem is that I don't know how to do it. Maybe You know where I can find sample code or tutorial about it? In other words I would like to force container to call my classes whenever methods: authenticate, login, and logout are called. Sample

How to start JBoss AS 7.1.1 on Windows?

冷暖自知 提交于 2019-12-22 08:34:10
问题 I am new to JBOSS .I downloaded jboss-as-7.1.1.Final.zip and unzip this zip file. Then I go to bin folder and double click on standalone.bat but new cmd window open and close within 2 -3 sec. I tried to start server throught cmd.I open cmd in 2 ways 1.normally mode Run as Admin (Admin Mode). In 2 ways I get: Calling "P:\Software\JBOSS\jboss-as-7.1.1.Final\bin\standalone.conf.bat" 'findstr' is not recognized as an internal or external command, operable program or batch file. then it stops. So

Java EE7 REST server no longer returning List<String> as JSON

◇◆丶佛笑我妖孽 提交于 2019-12-22 06:56:21
问题 The following example works in a Java EE6 (Glassfish3) project of mine but failed after I switched to Java EE7 (Glassfish4). The HTTP request returns "500 Internal Error" without any message in the Glassfish server log. The project was setup using NetBeans8 as Maven Web Project and has no special dependencies, beans.xml or other configuration. @RequestScoped @Path("generic") public class GenericResource { @GET @Path("ping") @Produces(APPLICATION_JSON) public List<String> debugPing() { return

What is the difference between class and styleClass attributes in JSF?

久未见 提交于 2019-12-22 01:33:55
问题 I see, that in JSF most of the standard components that mapped to HTML tags, e.g. <h:commandButton/> , have attributes class and styleClass . But no matter, which one I use, both is rendered as class attributes in markup. So why there are two attributes with the same purpose? 回答1: There is simply no class attribute in JSF components. From the doc, attribute styleClass : Space-separated list of CSS style class(es) to be applied when this element is rendered. This value must be passed through

Warning: JACC: For the URL pattern xxx, all but the following methods were uncovered: POST, GET

限于喜欢 提交于 2019-12-21 12:41:19
问题 In javax.faces.webapp.FacesServlet docs, it is mentioned, Allowable HTTP Methods The JSF specification only requires the use of the GET and POST http methods. If your web application does not require any other http methods, such as PUT and DELETE, please consider restricting the allowable http methods using the <http-method> and <http-method-omission> elements. Please see the Security of the Java Servlet Specification for more information the use of these elements. My application indeed does

Overriding hashcode and equals method in java?

旧街凉风 提交于 2019-12-21 06:17:51
问题 I have the classes below: public class Sample implements java.io.Serializable{ //POJO with two fields and getters/setters private String name; private Integer id; //This POJO does not override equals() and hashCode() } public class B{ private Sample sample; //here i need override hashcode and equals() based on **sample** property. } When i tried overriding equals() and hashCode() in the B class I got the error below in Eclipse. The field type com.mypackage.Sample does not implement hashCode()

injectionPoint.getBean() returns null if bean is an EJB bean in Java EE 7 (CDI 1.1)

久未见 提交于 2019-12-21 02:36:08
问题 I want to get bean from producer method in order to read its properties. In some scenarios the bean is a EJB Singleton bean. I've simplified my code to focus on the problem. My simple qualifier: @Qualifier @Retention(RUNTIME) @Target({TYPE, METHOD, FIELD, PARAMETER}) public @interface InjectMe {} Simple producer: @Dependent public class SimpleProducer { @Produces @InjectMe public String getInjectMe(InjectionPoint ip) { // ip.getBean() returns null for some reason return "ip=" + ip + ", bean="