@TarunKumar Check if any of the below two methods works.
context.currentResource("/content/...").adaptTo(FragmentTemplate.class);
context.request().adaptTo(FragmentTemplate.class);
If the servlet is called from author, then will have current logged-in user permissions.If it called from publish(live site), then will only have read access to /content
@Preethi1234 I see there is no need of creating dialog field on fly. Instead have the textfield hidden by default and show/hide based on you dropdown change listener.
@SaiM In case if your pages are deleted in author and not on publish, then you can delete them from publish instance using Distribution.
Tools > Deployment > Distribution > publish > Distribute Tab
Action: Delete
Path: <page path needs to be deleted from publish)
Submit.
Repeat for the set of...
If you upload image from device, image will be saved as a local copy to that component as a child node.
As image is a child resource (not a property with DAM reference as value), need to write login to get child image and render.