hai i created java class for adobe cq , but its showing some jar missing error, i dont know what jar i need to add for that import, i have attached snapshot of page,please refer it and provide your suggestion, thanks in advance[img]Capture.PNG[/img]
Solved! Go to Solution.
Views
Replies
Total Likes
Looks like you are trying to package the CQ app that posts data to a custom Sling Servet as talked about here:
http://helpx.adobe.com/experience-manager/using/custom-sling-servlets.html
@Override
protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response) throws ServerException, IOException {
try
{
//Get the submitted form data that is sent from the
//CQ web page
String id = UUID.randomUUID().toString();
String firstName = request.getParameter("firstName");
String lastName = request.getParameter("lastName");
String address = request.getParameter("address");
String cat = request.getParameter("cat");
String state = request.getParameter("state");
String details = request.getParameter("details");
String date = request.getParameter("date");
String city = request.getParameter("city");
//Encode the submitted form data to JSON
JSONObject obj=new JSONObject();
obj.put("id",id);
obj.put("firstname",firstName);
obj.put("lastname",lastName);
obj.put("address",address);
obj.put("cat",cat);
obj.put("state",state);
obj.put("details",details);
obj.put("date",date);
obj.put("city",city);
//Get the JSON formatted data
String jsonData = obj.toJSONString();
//Return the JSON formatted data
response.getWriter().write(jsonData);
}
When you package an AEM app- you need to know all pieces of it - including the content located under /content, and the backend OSGi bundles. We have a community article that talks about how to place a CQ app that includes an OSGi bundle into a package here:
Packaging Adobe CQ applications that contain an OSGi bundle @ http://helpx.adobe.com/experience-manager/using/packaging-cq-applications-contain-osgi.html
Make sure that you include the OSGi bundle - and the bundle fragments.
1 - the main OSGi bundle contains the main SLing Servlet
2 - the bundle fragment wraps the simple JSON JAR.
Therefore you need these 2 OSGi bundles in your package. The other import statements shown in your pic are part of the OSGi bundle when you built it.
Views
Replies
Total Likes
Looks like you are trying to package the CQ app that posts data to a custom Sling Servet as talked about here:
http://helpx.adobe.com/experience-manager/using/custom-sling-servlets.html
@Override
protected void doPost(SlingHttpServletRequest request, SlingHttpServletResponse response) throws ServerException, IOException {
try
{
//Get the submitted form data that is sent from the
//CQ web page
String id = UUID.randomUUID().toString();
String firstName = request.getParameter("firstName");
String lastName = request.getParameter("lastName");
String address = request.getParameter("address");
String cat = request.getParameter("cat");
String state = request.getParameter("state");
String details = request.getParameter("details");
String date = request.getParameter("date");
String city = request.getParameter("city");
//Encode the submitted form data to JSON
JSONObject obj=new JSONObject();
obj.put("id",id);
obj.put("firstname",firstName);
obj.put("lastname",lastName);
obj.put("address",address);
obj.put("cat",cat);
obj.put("state",state);
obj.put("details",details);
obj.put("date",date);
obj.put("city",city);
//Get the JSON formatted data
String jsonData = obj.toJSONString();
//Return the JSON formatted data
response.getWriter().write(jsonData);
}
When you package an AEM app- you need to know all pieces of it - including the content located under /content, and the backend OSGi bundles. We have a community article that talks about how to place a CQ app that includes an OSGi bundle into a package here:
Packaging Adobe CQ applications that contain an OSGi bundle @ http://helpx.adobe.com/experience-manager/using/packaging-cq-applications-contain-osgi.html
Make sure that you include the OSGi bundle - and the bundle fragments.
1 - the main OSGi bundle contains the main SLing Servlet
2 - the bundle fragment wraps the simple JSON JAR.
Therefore you need these 2 OSGi bundles in your package. The other import statements shown in your pic are part of the OSGi bundle when you built it.
Views
Replies
Total Likes
The key to getting the custom Sling Servlet app placed into a package is to place the 2 OSGi bundles under /apps - as discussed in the package article. See this section:
[img]appOSGi2.png[/img]
To get the OSGi bundles under /apps - you will have to get the 2 JAR files (the OSGi bundles) from your desktop to the JCR under /apps (as talked about in the package article). You can use the webdev tool to do that:
http://docs.adobe.com/docs/en/crx/2-3/how_to/webdav_access.html
Views
Replies
Total Likes
I personally like using a custom Java APP that posts files from the desktop to the AEM JCR. Once you get that developed - its very fast and easy to use.
See this article to learn how to code this tool:
http://helpx.adobe.com/experience-manager/using/post_files.html
Views
Replies
Total Likes
Views
Likes
Replies