I've put together the headless client demos (2 of them) with 2 solutions. You can download from here:
http://developer.servoy.com/downloads/headless_client_examples.zip
Hope this helps inspire you to work with the headless client.
Access is denied or Error occurred
Westy wrote:I have the two sample solutions up and running. Very impressive. More powerful than I expected and extremely easy for the end user.
Westy wrote:One possible bug is that when I go to exit the solution, a dialog appears that states "Application server will be shutdown, please close within 3 minutes." Then Servoy appears to hang with the following message in the status bar at lower left of screen: "Informing clients about shutdown." However, all browser clients are already closed and no Servoy Clients are open.
Westy wrote:I am still not sure how to make the Headless Client work with Servoy's built-in security.
Westy wrote:I have one coding question. In the Contacts detail what would be the syntax for including a list of phone numbers from a related file?
freecolours wrote:I get
- Code: Select all
Access is denied or Error occurred
at http://localhost:8080/jsp_files/headless_client_formtest.jsp.
Could it be that this does not work on OS X?
var noPass = "<font color='#990000'><b>Invalid Login.</b> Try again.</font><br>"
var isOK = "<font color='#009900'><b>VALID LOGIN!</b> Contratulations.</font><br>"
var isEmpty = "<font color='#990000'><b>No criteria entered.</b> Try again.</font><br>"
var name = arguments[0]
var pass = arguments[1]
if(name == null || name == '' || pass == null || pass == '')
{
//something is blank - return false
return isEmpty
}
var userId = security.getUserId(name)
if(security.checkPassword(userId, pass))
{
//they were ok
return isOK
}
else
{
//no match
return noPass
}
<%@ page import = "java.util.*" %>
<%@ page import = "com.servoy.j2db.server.headlessclient.*" %>
<%@ page import = "com.servoy.j2db.dataprocessing.IDataSet" %>
<%@ page errorPage="errorpage.jsp" %>
<%
ISessionBean servoy_hc = (ISessionBean)session.getAttribute("servoy");
if (servoy_hc == null)
{
servoy_hc = HeadlessClientFactory.createSessionBean(request,"example_headless_client_03");
session.setAttribute("servoy",servoy_hc);
}
boolean ok = servoy_hc.setMainForm("login");
if (!ok)
{
servoy_hc = HeadlessClientFactory.createSessionBean(request,"example_headless_client_03");
session.setAttribute("servoy",servoy_hc);
}
String theTable = null;
String isSubmit = request.getParameter("isSubmit");
if (null!=isSubmit)
{
theTable = (String)servoy_hc.executeMethod(null,"login",new Object[]{request.getParameter("username"),request.getParameter("password")});
}
%>
<html>
<head>
<style type="text/css">
<!--
body {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 24px;
color: #333333;
}
a{
text-decoration: none;
font-size: 11px;
font-family: verdana, sans-serif;
}
A:link
{
color: #036;
}
A:visited
{
color: #036;
}
A:active
{
text-decoration: underline;
color: #F90;
}
A:hover
{
text-decoration: underline;
color: #F90;
}
td
{
font-size: 11px;
border-color: #CCCCCC;
border-width: 1;
border-style: solid;
}
td.sub
{
background-color: #003366;
color: #FFFFFF;
}
td.red
{
background-color: #990000;
color: #FFFFFF;
}
table
{
border-color: #CCCCCC;
border-width: 1;
border-style: solid;
}
td.lg
{
color: #FFFFFF;
background-color: #999999;
}
.small
{
font-size: 10px;
}
.x-small
{
font-size: 8px;
}
-->
</style>
<title>Servoy Headless Client Login Example</title>
</head>
<body onload="javascript:document.loginform.username.focus()">
<%
if (theTable!=null) out.println(theTable);
%>
<form name="loginform" method="post" action="simplelogin.jsp">
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td colspan="2" class="sub"> <b>Login</b></td>
</tr>
<tr>
<td>Username</td>
<td><input name="username" type="text" id="username" size="15" maxlength="30"></td>
</tr>
<tr>
<td>Password</td>
<td><input name="password" type="password" id="password" size="15" maxlength="30"></td>
</tr>
<tr>
<td colspan="2" align="right">
<input name="Submit" type="submit" value="Submit">
<input type="hidden" name="isSubmit" value="1">
</td>
</tr>
</table>
</form>
</body>
</html>
garry.mack wrote:Hey Bob,
I was wondering if you have a unbroken link to these headless client solutions mentioned above?
Users browsing this forum: No registered users and 1 guest