jsr

Jetty WebSocket api vs the standard JSR 356 API

荒凉一梦 提交于 2019-11-30 09:04:44
Jetty 9 supports both it's own Jetty Websocket API as well as the standard JSR 356 API, for what I assume are historical reasons (Jetty's API precedes the final JSR 356 ). I've looked over the basic documentation of both APIs, as well as some examples. Both APIs seem fairly complete and rather similar. However, I need to choose one over the other for a new project I'm writing, and I'd like to avoid using an API that might be deprecated in the future or might turn out to be less feature-rich. So are there any important differences between the two except for the obvious fact that one is

Hibernate validations on save (insert) only

混江龙づ霸主 提交于 2019-11-29 14:31:25
We encountered a problem with legacy code. There is a validation set for a "username" field, validating its length and making sure it contains at least one letter: @Column(name = "username") @Size(min = 4, max = 40) @Pattern(regexp = "^.*[a-zA-Z]+.*$") private String username; The problem we have is that some existing legacy data do not fit these validations, and I'm trying to find a way to make these validations to be ignored for legacy data (old users), while still be applied to newly created users. I was thinking about moving the validations to setUsername(...) method (so value will be

JAX-RS in relation to Jersey and JSRs

孤者浪人 提交于 2019-11-29 06:21:19
I'm trying to get my head around some concepts in Java: JSR(s): describe specifications, but carry no actual implementations. E.g. http://jsr311.java.net/ is the "home" for "Java™ API for RESTful Web Services". It serves as a common reference for all implementations of JSR-311. One can download the interfaces (?) of JSR-311 from http://mvnrepository.com/artifact/javax.ws.rs/jsr311-api , however, unless you are implementing JSR-311 by yourself these have no particular value? JSR(s) will usually/always have a reference implementation. To find it you'll have to google "JSR XXX reference

jaxrs-api VS jsr311-api VS javax.ws.rs-api VS jersey-core VS jaxrs-ri

会有一股神秘感。 提交于 2019-11-28 17:32:04
I have googled around quite a bit still am confused as to what each of the above exactly mean. Here is my understanding of it: jaxrs-api : contains only api. No implementation. But how is it different from JSR311 jsr311-api : JSR311 it is a specification request. Which means it is supposed to be a document. Why then is it a jar? javax.ws.rs-api : Is it an implementation? jersey-core (/jersey client): Is an implementation of JSR311. I downloaded each jar and tried to decompile and see what is inside it, but I am only able to find interfaces in all of them and not the implementation. I am facing

JSR 256 battery events

一个人想着一个人 提交于 2019-11-28 13:04:44
How can I detect whenever the power cord is unplugged from electrical socket using JSR 256? You would add javax.microedition.io.Connector.sensor to the API Permissions tab of the Application Descriptor of the project properties. michael aubert From a quick look at the specifications of the JSR: (you might want to look for code examples, starting with Appendix D of the spec itself, the latest JavaME SDK, Sony Ericsson developer website, then google) As always, I would be worried about fragmentation in the diverse implementations of the JSR, but here's my first idea: import javax.microedition

JSR 303: How to Validate a Collection of annotated objects?

ぐ巨炮叔叔 提交于 2019-11-27 13:25:24
问题 Is it possible to validate a collection of objects in JSR 303 - Jave Bean Validation where the collection itself does not have any annotations but the elements contained within do? For example, is it possible for this to result in a constraint violation due to a null name on the second person: List<Person> people = new ArrayList<Person>(); people.add(new Person("dave")); people.add(new Person(null)); Validator validator = Validation.buildDefaultValidatorFactory().getValidator(); Set

How to find the jar of java.rmi package

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-27 12:15:36
I am developing an Android application which needs some rmi stuff since Android doesn't support rmi by default i found this project can be used to bundle the rmi package with my Android application but i couldn't find a jar which includes java.rmi package. can anybody suggest where to find it? or any other way to use java.rmi with Android Thanks !!! It is unlikely that you will be able to use RMI on Android. Even if you took the code for RMI from Apache Harmony or some other source, Android does not like projects attempting to load java.* classes other than those that ship with the OS, and so

JSR 256 battery events

删除回忆录丶 提交于 2019-11-27 07:28:35
问题 How can I detect whenever the power cord is unplugged from electrical socket using JSR 256? 回答1: You would add javax.microedition.io.Connector.sensor to the API Permissions tab of the Application Descriptor of the project properties. 回答2: From a quick look at the specifications of the JSR: (you might want to look for code examples, starting with Appendix D of the spec itself, the latest JavaME SDK, Sony Ericsson developer website, then google) As always, I would be worried about fragmentation

jaxrs-api VS jsr311-api VS javax.ws.rs-api VS jersey-core VS jaxrs-ri

元气小坏坏 提交于 2019-11-27 00:29:45
问题 I have googled around quite a bit still am confused as to what each of the above exactly mean. Here is my understanding of it: jaxrs-api : contains only api. No implementation. But how is it different from JSR311 jsr311-api : JSR311 it is a specification request. Which means it is supposed to be a document. Why then is it a jar? javax.ws.rs-api : Is it an implementation? jersey-core (/jersey client): Is an implementation of JSR311. I downloaded each jar and tried to decompile and see what is

JSR-303 @Valid annotation not working for list of child objects

风流意气都作罢 提交于 2019-11-26 20:25:39
My main classes is public class UserAddressesForm { @NotEmpty private String firstName; @NotEmpty private String lastName; private List<AddressForm> addresses; ... setters and getters public class AddressForm { @NotEmpty private String customName; @NotEmpty private String city; @NotEmpty private String streetAn; @NotEmpty private String streetHn; @NotEmpty private String addressCountry; @NotEmpty private String postCode; ... setters and getters A Controller @RequestMapping(value = "/up", method = RequestMethod.POST) public String completeForm(@Valid @ModelAttribute("userAddressesForm")