In this article, I'll share the CQ component for URL redirect that I did. How it works is that, the component provide content author additional functionality to set redirect message. If redirect message is set, the component will redirect user to a new location via JavaScript (the JavaScript function has an interval/delay).

Read more: CQ Component for URL redirect

In this article, I'll address a simple solution of how I generalized and optimized my JSP codes for fetching current logged in user by creating a Java Bean/Class and import on my global.jsp file.

Steps

  1. Create a Java class: AuthenticatedUser.java with a package name com.myproject.util in my library (see sample codes in Code 1 below).
  2. Import my Java Class in my CQ global.jsp: <%@page import="com.myproject.util.AuthenticatedUser"%> and declare a local variable for my JSP/CQ component(s): AuthenticatedUser authedUser = new AuthenticatedUser(resourceResolver);.
  3. In my component, I include the gobal.jsp (i.e. <%@include file="/apps/myproject/components/global.jsp"%>). I can simply invoke the methods that I created in my AuthenticatedUser, for instance, authedUser.isAuthed() to check if the user is a guest or a logged in user.

Read more: AuthenticatedUser Java Bean for CQ Component

Here's how to detect an AJAX request with your Java application/class:

public class MyClass
{

....

private boolean isAJAX()
{
String xRequestWith = request.getHeader("X-Requested-With");
return xRequestWith != null ? xRequestWith.equals("XMLHttpRequest") : false;
}
}

In this article, I will be addressing 2 issues: how to efficiently handle form submission map data in Java and how the AdapterFactory get implemented in Adobe CQ (AEM).

Read more: Handle form submission using AdapterFactory in Adobe CQ (AEM) OSGi Component

In this article, I'm going to discuss on how I integrated and implemented jQuery Form Validator and jQuery Form for handling form validation and submission with Adobe CQ5 (AEM).

Read more: Client side custom form validation and submission with CQ