Should I choose == or eq for comparing string in EL?
They’re both the same. I use eq in EL as it is more readable like a sentence.
They’re both the same. I use eq in EL as it is more readable like a sentence.
Extend HttpServletRequestWrapper, override the header getters to return the parameters as well: public class AddParamsToHeader extends HttpServletRequestWrapper { public AddParamsToHeader(HttpServletRequest request) { super(request); } public String getHeader(String name) { String header = super.getHeader(name); return (header != null) ? header : super.getParameter(name); // Note: you can’t use getParameterValues() here. } public Enumeration getHeaderNames() { List<String> names … Read more
Same probleme here, there the solution I fix it Open the .project file with your prefered text editor. delete the node that is about “org.eclipse.wst.validation” Close your project Open your project Launch Maven Update… Should be good. Another way to fix it, if you don’t want to change your .project config (or if you had … Read more
Not sure this will solve your problem but GlassFish Embedded provides a Java EE 6 implementation. Add this to your pom.xml: <project> … <repositories> <repository> <id>glassfish-extras-repository</id> <url>http://download.java.net/maven/glassfish/org/glassfish/extras</url> </repository> </repositories> … <dependencies> <dependency> <groupId>org.glassfish.extras</groupId> <artifactId>glassfish-embedded-all</artifactId> <version>3.0.1</version> <scope>test</scope> </dependency> <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> <version>6.0</version> <scope>provided</scope> </dependency> … </dependencies> … </project> It’s important to declare the glassfish-embedded-all artifact before … Read more
Instead of using a ServletContextListener, use a HttpSessionListener. In the sessionCreated() method, you can set the session timeout programmatically: public class MyHttpSessionListener implements HttpSessionListener { public void sessionCreated(HttpSessionEvent event){ event.getSession().setMaxInactiveInterval(15 * 60); // in seconds } public void sessionDestroyed(HttpSessionEvent event) {} } And don’t forget to define the listener in the deployment descriptor: <webapp> … … Read more
As @Korgen mentioned in comments hibernate-validator-5.x.x isn’t compatible with validation-api-1.0.x. This is because of moving to new specification JSR-303 -> JSR-349. There are two ways to solve this issue: 1. Downgrade hibernate validator version (which is implements JSR-303): <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>4.3.1.Final</version> </dependency> 2. If you don’t want to move back from hibernate validator 5 … Read more
The general principle behind the design of JpaRepositoryFactory and the according Spring integration JpaRepositoryFactory bean is the following: We’re assuming you run your application inside a managed JPA runtime environment, not caring about which one. That’s the reason we rely on injected EntityManager rather than an EntityManagerFactory. By definition the EntityManager is not thread safe. … Read more
I don’t think any RESTful client would expect to look at the reason phrase to figure out what went wrong; most RESTful services I’ve seen/used will send the standard status info and an expanded message in the body of the response. sendError(int, String) is ideal for that situation.
The solution is simple: don’t put configuration in your context.xml. Here is a solution that we use (which works well for a number of diverse external customers): We have a single war which will be used in multiple environments, webapp.war. We have three environments, development, integration and production. Integration and production are at the customer … Read more
First of all, “J2EE” is an obsolete abbreviation, it is now simply called “Java Enterprise Edition” or Java EE. Contrary to the servlet container (e.g. Tomcat), “full” Java EE application servers contain also an EJB container. EJB are Enterprise Java Beans and you can read a lot about them for example here (chapter IV). EJBs … Read more