Using the Jersey client to do a POST operation

Not done this yet myself, but a quick bit of Google-Fu reveals a tech tip on blogs.oracle.com with examples of exactly what you ask for. Example taken from the blog post: MultivaluedMap formData = new MultivaluedMapImpl(); formData.add(“name1”, “val1”); formData.add(“name2”, “val2”); ClientResponse response = webResource .type(MediaType.APPLICATION_FORM_URLENCODED_TYPE) .post(ClientResponse.class, formData); That any help?

Is package by feature approach good? [closed]

Take a look at uncle Bob’s Package Design Principles. He explains reasons and motivations behind those principles, which I have elaborated on below: Classes that get reused together should be packaged together so that the package can be treated as a sort of complete product available for you. And those which are reused together should … Read more

What does WEB-INF stand for in a Java EE web application? [closed]

As far as I know, “INF” stands for “Information”, as you said. It probably was named WEB-INF for similarity with the META-INF directory in JAR files. Sometimes the meaning of a directory changes so much over time that it no longer makes sense. For example, bin directories in Unix/Linux often contain non-binary “executable” files, such … Read more

Could not serialize object cause of HibernateProxy

You can do without manually unproxying everything by using a custom TypeAdapter. Something along these lines: /** * This TypeAdapter unproxies Hibernate proxied objects, and serializes them * through the registered (or default) TypeAdapter of the base class. */ public class HibernateProxyTypeAdapter extends TypeAdapter<HibernateProxy> { public static final TypeAdapterFactory FACTORY = new TypeAdapterFactory() { @Override … Read more

Where can I find a list of all the reference implementations for Java EE 6? [closed]

Here’s an overview of all RI’s (and alternatives). Java Platform, Enterprise Edition 6 (Java EE 6) – JSR 316 Oracle Glassfish 3.x (RI) JBoss AS 6.x and 7.x IBM WebSphere 8.0 Java Architecture for XML Binding (JAXB) 2.2 – JSR 222 Oracle JAXB (RI, used in Glassfish 3) Oracle Metro Java API for XML-Based Web … Read more

How to exclude one url from authorization

Omit the <auth-constraint> element in <security-constraint> for resources for which you don’t need authentication like: <security-constraint> <web-resource-collection> <web-resource-name>app</web-resource-name> <url-pattern>/info</url-pattern> </web-resource-collection> <!– OMIT auth-constraint –> </security-constraint> <security-constraint> <web-resource-collection> <web-resource-name>app</web-resource-name> <url-pattern>/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name>Role</role-name> </auth-constraint> </security-constraint>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)