Page History
Web Clients are one of the ways to deploy Solutions to end users.
Web Client is a browser-based application of which the UI is rendered in the browser using pure HTML, CSS and a bit of JavaScript for event handling and communication with the Servoy Application Server. The business logic of the Solution that is running in the Web Client is executed on the Application Server for security reasons: the code of the business logic is not exposed in the webpage markup.
Stoc |
---|
Supported Browsers
The Servoy Web Client runs in the last few versions of all modern browsers, like Mozilla FireFox, Safari, Google Chrome and Internet Explorer.
See Web Client Settings for more info on enabling/disabling anchors.
Starting Servoy Web Clients
Servoy Web Clients run in a browser and can be started by accessing a URL on the Servoy Application Server.
...
title | Solution Select page |
---|
...
Web Client Start URL | What is does | Comments |
---|---|---|
{serverURL}/servoy-webclient |
...
title | Deeplink into specific solution |
---|
...
Opens the 'Select Solution' webpage | The 'Select Solution' webpage will not list any solutions if solution browsing is disabled, see Solution browsing. |
{serverURL}/servoy-webclient/ss/s/{mySolutionName} |
...
title | Specify the method to execute on startup |
---|
Opens the specified solution | |
{serverURL}/servoy- |
...
webclient/ss/s/{mySolutionName}/ |
...
a/ |
...
title | Specify startup argument |
---|
...
{value} | Opens the specified solution. The argument value is passed into the Solutions onOpen event handler. | |
{serverURL}/servoy- |
...
webclient/ss/s/{mySolutionName}/a/{value |
...
title | Specify the method to execute & startup argument |
---|
...
}/{name1}/{value1}/{name1}/{value2} | The same as the previous scenario, but with additional custom keys for additional arguments | |
{serverURL}/servoy-webclient/ss/s/{mySolutionName}/m/{myMethodName |
...
title | Specify the startup argument & named arguments |
---|
...
} | Opens the specified solution and executed the specified method after the solution is opened | |
{serverURL}/servoy-webclient/ss/s/{mySolutionName}/m/{myMethodName}/a/ |
...
title | Specify the method to execute, the startup argument & named arguments |
---|
...
{value} | The same as the previous scenario, but specifying a single value to be passed as an argument into the onOpen event handler and deeplink method | |
{serverURL}/servoy-webclient/ss/s/{mySolutionName}/m/{myMethodName}/a/{value}/{name1}/{value1}/{name2}/{value2} | The same as the previous scenario, but with additional custom keys for additional arguments |
Include Page |
---|
...
|
...
|
...
Running Servoy Web Client inside a Frame or IFrame
...
When running a Servoy Web Client inside an Frame or IFrame (here onwards just called frame) and the domain of the page into which the frame is embedded does not equal the domain from which the Web Client is hosted, there is a possible issue with the ability of storing HTTP Cookies.
Internet Explorer, by default, disallows the storage of Cookies from within frames if the domains of the page hosting the frame and the page inside the frame do not match.
The Servoy Web Client uses HTTP Cookies to save the position and location of dialogs. Also the functions application.setUserProperty(...) and application.getUserProperty(...) utilize Cookies in the Web Client.
If no dialogs are used in the application and User Properties are not used, there is no issue. Also when the page hosting the frame (for example: http://www.mycompany.com/pagewithframes.html) and the page inside the frame are hosted from the same domain (for example http://www.mycompany.com:8080/servoy-webclient/ss/s/solutionName) there is also no issue.
However, if dialogs or User Properties are used and are deemed important and the domains do not match, extra steps are required to make use that the application will function properly.
Option 1: Altering the Security level in Internet Explorer on every client machine
By default the privacy level setting of Internet Explorer is set to Medium. This setting can be found under Tools > Internet Options > Privacy tab.
When the level is set to Medium, third party cookies without a Compact Priviledges Policy will be blocked. By altering the privacy level to the lowest level "Accept All Cookies" the third party Cookies will get accepted. Although this works, it means that in order to be able to use the Solution properly the setting needs to be altered in the browser of all users. It can be that corporate IT departments restrict the user from altering this setting.
Third party Cookies: these are Cookies from a different domain as the domain from the main page displayed in the browser.
Cookies without Compact Privicy Policy: These are Cookies from pages that do not include a so-called P3P header in the HTTP Response
Option 2: Adding a "Compact Privacy Policy" to the Web Client
http://forum.developers.facebook.com/viewtopic.php?pid=204805
Code Block | ||
---|---|---|
| ||
...
</servlet-mapping>
<filter>
<filter-name>P3PHeaderFilter</filter-name>
<filter-class>com.servoy.extensions.tomcat.filter.P3PHeaderFilter</filter-class>
<init-param>
<param-name>P3P-value</param-name>
<param-value>CP="CAO PSA OUR"</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>P3PHeaderFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
|
http://www.alphaworks.ibm.com/tech/p3peditor http://www.w3.org/P3P/implementations.html
Note | ||
---|---|---|
| ||
In all examples above, the specification of the key and value can also be done through query parameters, for example:
|
Browser Sessions
As browsers share session information between all their tabs and windows, it's not possible the run multiple Web Clients hosted from the same application server within the same browser.
By default, browser sessions will not timeout in web client if you keep the browser tab open and it can continue to communicate with the server - no matter what the value of the container's/tomcat's session timeout is., This is because we have a data broadcast notifier that polls the server every 5 seconds (by default) to see if there is something to report. It can be configured via the "servoy.webclient.datanotify.frequency" option in the admin page.
Embedding a Web Client in an IFrame
A Web Client solution can be embedded inside another webpage, by utilizing the IFrame HTML tags. Check out the Running Web Clients inside an IFrame tutorial for more details on embedding a Web Client inside an IFrame.
Web Client Configuration Settings
Through the Servoy Admin page, several settings are exposed related to Web Clients. These settings can be found on the Servoy Server Home > Web Client Settings. For more information on the specific settings see Web Client Settings
Basic Authentication Support for WebClient Login
If a solution running in the Web Client does not define a specific form as login form, Servoy will serve a standard SignIn page to the user (a basic html page with a username and password field).
Instead of showing the default SignIn HTML page, it's also possible to show the default browser basic authentication dialog, using one of the two following approaches:
- Append '/sv_auth_type/basic' to the Web Client URL. For example:
{serverURL}/servoy-webclient/ss/s/{mySolutionName}/sv_auth_type/basic
- Or enable it for all Web Clients (or in the developer for testing purposes) by setting the admin page property
servoy.webclient.basic.authentication
to true