Menu

AEM Sling Model injection and annotation

In this article, we will understand what all are the ways to reading authored values of AEM component using sling model in AEM

Using ValueMapValue annotation of package org.apache.sling.models.annotations.injectorspecific

@ValueMapValue(injectionStrategy = InjectionStrategy.OPTIONAL)
private String classStartDateLabel;

Using Inject annotation of package javax.inject


@Inject
@Via("resource")
@Optional
private String classStartDateLabel;


Getter method for this injection


public String getClassStartDateLabel() {
return classStartDateLabel;
}

sun.misc - cannot be resolved | AEM Bundle

sun.misc -- Cannot be resolved but is not required and overwritten by Boot Delegation

Resolution

This error we see sometimes while installing bundle in Adobe Experience Manager(AEM). If you are seeing this error just after the installation of the package then wait for a few minutes to resolve the dependencies. Most of the time it will resolve automatically as soon as the dependent library or service will available. After a few minutes if this is not getting resolved then check your POM and ensure you are adding the correct dependency which is available in the system.

Cursor in PLSQL

 The cursor is a private work area for an SQL statement, when the SQL statement is executed in PL/SQL block, the Oracle engine assigns a private work area for that statement. The cursor stores the statement and result after execution.

There are two types of Cursor implicit cursor and explicit cursor.

Example of Implicit Cursor

DECLARE

    var datatype

BEGIN

    select * from table; // Your SQL statement

END;


Example of Explicit Cursor

DECLARE

             CURSOR cursor_name is

                select * from table;    // Your SQL statement 

BEGIN

    OPEN cursor_name; 

        FETCH cursor_name  // Your SQL statement

            CLOSE cursor_name; 

END;


Reference

 Cursor overview | Oracle Doc

AEM Dispatcher RewriteRule Flags

While working with the AEM dispatcher there are too many configurations and rules we have to handle to deliver the right content and hide the secure data of the system. 


The behavior of RewriteRule can be modified by RewriteRule flags. There are ample flags available that help us to modify the behavior of the rewrite rule, those flags get added in the form of an Array object at the end of the rewrite rule line. Below is the syntax with an example.

Syntax of AEM Dispatcher RewriteRule

RewriteRule pattern target [Flag1,Flag2,Flag3]

e.g.

    


References

1. Apache RewriteRule Flags

2. Apache Module mod_rewrite