Passing Parameter from servlet to html | Community
Skip to main content
sakshi_rawat
New Participant
July 15, 2016
Solved

Passing Parameter from servlet to html

  • July 15, 2016
  • 2 replies
  • 2999 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by kautuk_sahni

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

2 replies

kautuk_sahni
kautuk_sahniAccepted solution
Employee
July 18, 2016

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
New Participant
July 16, 2016