Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Any Java API - access for Form Manager forms

Avatar

Former Community Member
Hi All,



I have designed the forms using Adobe designer. Then I have deployed the forms in Form Server.



I want open/view that forms in separate jsp/java application instead using Form Manager.



Any Java API is available for viewing forms?



Please help me.



Thanks,

Sara
2 Replies

Avatar

Level 9
Hi Sara

If you want to view the forms in your own application, you will need to write the application yourself, and use the Forms apis to render your forms.

Read the developer_guide.pdf document that is installed with your Forms installation.

Howard

http://www.avoka.com

Avatar

Former Community Member
Hi Howard,



Thanks for your reply. As per developer_guide, I have creatd one jsp and tested in jboss application. I have faced one problem.



Please help me....



my jsp code:

String sFormQuery = "LeaveRequestForm.xdp";

String sFormPreference = "MSDHTML";

String sContentRootURI = "http://localhost:8080/LeaveRequest/forms";

String sTargetURL = "http://localhost:8080/LeaveRequest/LeaveRequestForm";

String sApplicationWebRoot = "http://localhost:8080/LeaveRequest";



try

{

EJBClient formServer = new EJBClient();

Hashtable props = new Hashtable();

props.put("INITIAL_CONTEXT_FACTORY","org.jnp.interfaces.NamingContextFactory");

props.put("URL_PKG_PREFIXES","org.jboss.naming");

props.put("PROVIDER_URL", "localhost:8080");

InitialContext initialContext = new InitialContext(props);

formServer.setInitialContext(initialContext);

com.adobe.formServer.interfaces.IOutputContext myOutputContext = (com.adobe.formServer.interfaces.IOutputContext)formServer.renderForm(sFormQuery,sFormPreference, null, "CacheEnabled=false",

null, sApplicationWebRoot, sTargetURL, sContentRootURI, null );

ServletOutputStream oOutput = response.getOutputStream();

response.setContentType(myOutputContext.getContentType());

byte[] cContent = myOutputContext.getOutputContent();

oOutput.write(cContent);

}

catch(Exception e)

{

out.println(e);

}



Error Message:

com.adobe.formServer.interfaces.RenderFormException: java.lang.ClassCastException