Home > J2EE

J2EE

CORS Filter for J2EE Application

j2ee

CORS (Cross-origin resource sharing) helps in making Javascript based AJAX request from one domain to another, requesting domain is different from the domain where the request is made. This type of request is by default forbidden at the browser level and if this type of requet is made without proper settings, they will result in some origin security policy error. ... Read More »

Some useful JSP Expression Language hacks in JSP

j2ee

Some useful JSP Expression Language hacks in JSP If you have JSTL in your classpath(by including JSTL.jar and standard.jar in your classpath), then you need to write below taglib directive so that you can use JSTL tags. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%/> 1. Redirecting to other resource in application where, hello.html is another resource. 2. Looping model data in JSP and ... Read More »

How to configure sessioncookie at Tomcat server level OR at Application level (web.xml)

How to configure session cookie at Tomcat server level or at Application level (web.xml) In this post we will see how to configure session cookie at Tomcat server level or at application level using web.xml You can use either way to set a cookie. Tomcat server Go to -> conf directory -> open context.xml -> add below lines:- <Context sessionCookieName="<yourCookieName>" ... Read More »

Create a J2EE Web Application project with Apache Maven

apache

In this tutorial, we will learn how to create a J2EE Web Application project with Apache Maven, imports it into the Eclipse IDE, and package the Java project into a war file. Tools used : Maven 3.2.5 (For how to install, click here) Eclipse (Kepler Release) JDK 7 A. Create a Java Project from Maven Template In a terminal (*uix ... Read More »

Java HttpServletRequest get current URL in browsers URL bar

j2ee

If your current request is coming from an “inside the app-server” forward or include, the app-server is expected to preserve request information as request attributes. The specific attributes, and what they contain, depends on whether you’re doing a forward or an include. For, the original parent URL will be returned by request.getRequestURL(), and information about the included page will be ... Read More »