Getting value in Java | Community
Skip to main content
Level 2
October 16, 2015
Solved

Getting value in Java

  • October 16, 2015
  • 11 replies
  • 2578 views

Hi am new to CQ

I am trying to write java class for dialog.

Can any one please share any document to refer.

My idea : from dialog, i need to get properties and need to store in Crx.

 

Thanks,

Seetha

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

11 replies

edubey
edubeyAccepted solution
Level 10
October 16, 2015
Feike_Visser1
Adobe Employee
Adobe Employee
October 16, 2015

Normally when you click ok on the dialog the values are persisted into crx.

seethananAuthor
Level 2
October 16, 2015

Thank you for the reply.

Instead of doing logical thing in Jsp, i need to do in java.

Is there any way to achieve that.

seethananAuthor
Level 2
October 16, 2015

Thanks all for the help.

edubey
Level 10
October 16, 2015

Could you be more clear on what you are trying to achieve. As @feike mentioned, When you click "Ok" button on dialog box, values filled in dialog box gets automatically stored in crx. This is an default functionality of CQ5. There is no need to write JSP or JAVA code to save dialog values to properties.

[or]

If you are trying to retrieve those already saved properties, this is the article you should read: https://cqwemblog.wordpress.com/2013/12/19/how-to-read-properties-from-a-node-in-cq5/

Adobe Employee
October 16, 2015

Not sure if that article still works with AEM6

seethananAuthor
Level 2
October 16, 2015

Thanks Edubey for the reply.

Example : 

Navigation component:

Navigation logical we can do directly in Jsp 

But my idea is to do logical like list of children and other things in java, only i need to pass value to jsp.

how i can create link between jsp and java?

Help me to understand that.

edubey
Level 10
October 16, 2015

I hope you have setup your project in Eclipse IDE, If not Check here.

Create java classes in your IDE, once you project setup is done. 

Refer here a  Hello World Example.

seethananAuthor
Level 2
October 16, 2015

Thanks for the example.

Here we are passing static value from Java to Jsp using sling service.

Example :

Am passing one textfield value.

In jsp i can retrive <%=properties.get("textfieldName",String.class)%>

or in JSTL ${properties.textfieldName}

How i can get in java?

 

Thanks in advance

seethananAuthor
Level 2
October 16, 2015

Thanks for the example.