Page 1 of 1
Security with Headless Client
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Wed Jan 12, 2005 4:37 am
by Westy
How does Servoy security work with the Headless Client?
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Wed Jan 12, 2005 7:37 pm
by IT2Be
as far as I know exactly the same where applicable. If security is set you log in with a user. The rest is up to you!
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Thu Jan 13, 2005 1:43 am
by Westy
I tried that last night but setting Servoy security settings appeared to break the Headless Client. After I removed the require password setting, which I assumed was causing the problem, Servoy would hang when I opened the head (browser) and then closed it. Servoy did not appear to be aware that the browser was closed.
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Thu Jan 13, 2005 10:17 am
by IT2Be
Hmm, there must be something wrong but I can't imagine it is the security system because this works for me without any issues... Do you have a logging or something like that?
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Thu Jan 13, 2005 11:10 pm
by jcompagner
you dit suplly the username/password when intializing the headless client?
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Fri Jan 28, 2005 9:54 am
by idoctor
Previously posted in the wrong place:
Example of a simple contact management database fit for a PDA browser can be viewed at 149.142.139.141:8080/1.
Headless client is very cool.
John McCann
I have security set on the above example and it does not request that I log in when I go to the URL. Is thier some way to force log in?
John McCann
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Fri Jan 28, 2005 5:09 pm
by jcompagner
Are you saying that you have a solution where you checked the require login box.
And that you can access them without username/password specified when creating a headless client?
You should get an can't login error when initation..
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Fri Jan 28, 2005 10:50 pm
by Westy
Can we see the code for the simplelistview.jsp file? Other steps required to make it work? He asks excitedly.
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Fri Jan 28, 2005 11:52 pm
by bcusick
Here you go:
- Code: Select all
<%@ 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_01");
session.setAttribute("servoy",servoy_hc);
}
boolean ok = servoy_hc.setMainForm("customers");
if (!ok)
{
servoy_hc = HeadlessClientFactory.createSessionBean(request,"example_headless_client_01");
session.setAttribute("servoy",servoy_hc);
}
String custid = request.getParameter("custid");
String pageid = request.getParameter("pageid");
if (null==pageid) pageid = "1";
String filter = request.getParameter("filter");
String showOrders = request.getParameter("showOrders");
%>
<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 test</title>
</head>
<body onload="javascript:document.searchform.filter.focus()">
<%
String theTable = "";
if(null==custid || null != filter)
{
theTable= (String)servoy_hc.executeMethod(null,"getList",new Object[]{pageid,filter});
}
else if(null==showOrders)
{
theTable = (String)servoy_hc.executeMethod(null,"getDetails",new Object[]{custid,pageid});
}
else
{
theTable = (String)servoy_hc.executeMethod(null,"getOrders",new Object[]{custid,pageid});
}
out.println(theTable);
%>
<br><font class="small">Company, Name or City:</font><form action="" method="post" name="searchform"><input name="filter" type="text" class="lg" id="filter" size="20" maxlength="10" onBlur="javascript:if (this.value.length>0) document.searchform.submit()"></form>
</body>
</html>
Most of the "hard" work is done in the solution itself - it returns the HTML to display from methods that run in the solution.
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Sat Jan 29, 2005 12:19 am
by bcusick
I've put together the simplelistview.jsp sample and solution. You can download from here:
http://developer.servoy.com/downloads/headless_client_examples.zip
Hope this helps.
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Sat Jan 29, 2005 12:50 am
by Westy
Great. Thank you very much!
![Very Happy :D](./images/smilies/icon_biggrin.gif)
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Sat Jan 29, 2005 5:27 am
by idoctor
Are you saying that you have a solution where you checked the require login box.
And that you can access them without username/password specified when creating a headless client?
You should get an can't login error when initation..
Johan,
I went back and looked at it more closely. I made the the little headless client application a module. I did not realize one needs to set secuirty in a module seperate from the main application. When I flip the flag for log on required in the module I am no longer allowed to log on to the headless client. This is very cool for playing with but without security I cannot use it for what I need over the WWW. So how, or when will I be able to get the log on screeen using the headless client? Come on. You guys came up with this idea over a week ago. It should be completely polished by now.
John McCann
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Mon Jan 31, 2005 12:04 am
by jcompagner
if youre users must login before opening the solution. Then you have to make youre login dialog yourself. So create a jsp page before making the sessionclient and with the input of the first login page you make the session client with the user/password you got.
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Sun Feb 20, 2005 6:13 pm
by Westy
jcompagner wrote:if youre users must login before opening the solution. Then you have to make youre login dialog yourself. So create a jsp page before making the sessionclient and with the input of the first login page you make the session client with the user/password you got.
What is the proper syntax in order to include the username and password when making the session? A sample of what you describe would be really helpful.
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Mon Feb 21, 2005 10:47 am
by IT2Be
All documented here:
http://developer.servoy.com/docs/headle ... index.html
take a look at 'HeadlessClientFactory'...