Expand my Community achievements bar.

SOLVED

Getting value in Java

Avatar

Level 2

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

1 Accepted Solution

Avatar

Correct answer by
Level 10
11 Replies

Avatar

Correct answer by
Level 10

Avatar

Employee

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

Avatar

Level 2

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.

Avatar

Level 10

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/

Avatar

Employee

Not sure if that article still works with AEM6

Avatar

Level 2

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.

Avatar

Level 10

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.

Avatar

Level 2

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