Expand my Community achievements bar.

SOLVED

Passing Parameter from servlet to html

Avatar

Level 1

I need to create two components fro registration. On first component I should enter email address in textbox. If this email is already registered, I have to give already exists message. Otherwise it should go to second component and let the user fill his complete detail and the value of email should be taken from first component. Can anyone please help me on this.

1 Accepted Solution

Avatar

Correct answer by
Administrator

Hi, 

You can pass the data from servlet to JSP/Sightly (not HTML). 

OSGI as Service

Link:- https://helpx.adobe.com/experience-manager/using/first-osgi.html

// Here we are calling the function on OSGI Service from JSP

    <% 
    com.adobe.cq.KeyService keyService = sling.getService(com.adobe.cq.KeyService.class);
    keyService.setKey(10) ; 
    String ff = keyService.getKey();  
    %>

Link:- https://helpx.adobe.com/experience-manager/using/sightly_multifield.html

//Sightly fetching information from the OSGI

    <div data-sly-use.mbeanObj="com.aem.core.services.TouchMultiComponent">
        <p>
 
            <div data-sly-test="${!mbeanObj.mBean}">Add values in Dialog</div>
            <div data-sly-test="${mbeanObj.mBean}" data-sly-list.items="${mbeanObj.mBean}">
                <h3>${items.dashboard}</h3>
                <div data-sly-list.itemsList="${items.items}">
                    <p><b>page:</b> ${itemsList.page}</p>
                    <p><b>path:</b> ${itemsList.path}</p>
                </div>
              </div>
 
        </p>
    </div>

 

Link:- https://helpx.adobe.com/experience-manager/using/using-ajax-requests-display-cq.html

//Ajex

 

How can we achieve it:-

1. Calling OSGi fucntion directally.

2. AJEX call (doGet/doPost)

3.Using JS to get value.

Can you exactly tell us what would you like to do ?

I hope this would be of some help to you.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

View solution in original post

2 Replies

Avatar

Correct answer by
Administrator

Hi, 

You can pass the data from servlet to JSP/Sightly (not HTML). 

OSGI as Service

Link:- https://helpx.adobe.com/experience-manager/using/first-osgi.html

// Here we are calling the function on OSGI Service from JSP

    <% 
    com.adobe.cq.KeyService keyService = sling.getService(com.adobe.cq.KeyService.class);
    keyService.setKey(10) ; 
    String ff = keyService.getKey();  
    %>

Link:- https://helpx.adobe.com/experience-manager/using/sightly_multifield.html

//Sightly fetching information from the OSGI

    <div data-sly-use.mbeanObj="com.aem.core.services.TouchMultiComponent">
        <p>
 
            <div data-sly-test="${!mbeanObj.mBean}">Add values in Dialog</div>
            <div data-sly-test="${mbeanObj.mBean}" data-sly-list.items="${mbeanObj.mBean}">
                <h3>${items.dashboard}</h3>
                <div data-sly-list.itemsList="${items.items}">
                    <p><b>page:</b> ${itemsList.page}</p>
                    <p><b>path:</b> ${itemsList.path}</p>
                </div>
              </div>
 
        </p>
    </div>

 

Link:- https://helpx.adobe.com/experience-manager/using/using-ajax-requests-display-cq.html

//Ajex

 

How can we achieve it:-

1. Calling OSGi fucntion directally.

2. AJEX call (doGet/doPost)

3.Using JS to get value.

Can you exactly tell us what would you like to do ?

I hope this would be of some help to you.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni