HC compile class error in 8.1.1

The forum to discuss the Headless version of Servoy. Web, Java and Servlet development questions can all be posted here.

HC compile class error in 8.1.1

Postby david » Tue Feb 28, 2017 5:19 am

What's the HC boilerplate for Servoy 8+? Boilerplate from Servoy 6 is throwing errors:

Code: Select all
<%@ page import = "java.util.*" %>
<%@ page import = "com.servoy.j2db.server.headlessclient.*" %>
<%@ page import = "com.servoy.j2db.util.*" %>

<%
   // grab params
   String solution = request.getParameter("s");
   String form    = "blank";
   String method    = request.getParameter("m");
   Object[] args    = new Object[]{session, request};

   // start servoy headless client
   ISessionBean servoy_hc = (ISessionBean)application.getAttribute("servoy");
   if (servoy_hc == null || !servoy_hc.setMainForm(form)) {
      servoy_hc = HeadlessClientFactory.createSessionBean(request, solution);
      application.setAttribute("servoy_cms",servoy_hc);
   }

   // set form
   boolean ok = servoy_hc.setMainForm(form);
   if (!ok) {
      out.print("Error cannot work on required form");
      return;
   }

   // call servoy method
   String results = (String)servoy_hc.executeMethod(null, method, args);

   // print out results
   out.print(results);
   
%>


Errors:

Code: Select all
org.apache.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 13 in the jsp file: /endpoint_example2.jsp
ISessionBean cannot be resolved to a type
10:    Object[] args    = new Object[]{session, request};
11:
12:    // start servoy headless client
13:    ISessionBean servoy_hc = (ISessionBean)application.getAttribute("servoy");
14:    if (servoy_hc == null || !servoy_hc.setMainForm(form)) {
15:       servoy_hc = HeadlessClientFactory.createSessionBean(request, solution);
16:       application.setAttribute("servoy_cms",servoy_hc);


An error occurred at line: 13 in the jsp file: /endpoint_example2.jsp
ISessionBean cannot be resolved to a type
10:    Object[] args    = new Object[]{session, request};
11:
12:    // start servoy headless client
13:    ISessionBean servoy_hc = (ISessionBean)application.getAttribute("servoy");
14:    if (servoy_hc == null || !servoy_hc.setMainForm(form)) {
15:       servoy_hc = HeadlessClientFactory.createSessionBean(request, solution);
16:       application.setAttribute("servoy_cms",servoy_hc);


An error occurred at line: 15 in the jsp file: /endpoint_example2.jsp
HeadlessClientFactory cannot be resolved
12:    // start servoy headless client
13:    ISessionBean servoy_hc = (ISessionBean)application.getAttribute("servoy");
14:    if (servoy_hc == null || !servoy_hc.setMainForm(form)) {
15:       servoy_hc = HeadlessClientFactory.createSessionBean(request, solution);
16:       application.setAttribute("servoy_cms",servoy_hc);
17:    }
18:
David Workman, Kabootit

Image
Everything you need to build great apps with Servoy
User avatar
david
 
Posts: 1727
Joined: Thu Apr 24, 2003 4:18 pm
Location: Washington, D.C.

Return to Servoy Headless Client

Who is online

Users browsing this forum: No registered users and 3 guests