Child pages
  • Web Client

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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.

...

titleSolution Select page

...

Web Client Start URL

What is does

Comments

{serverURL}/servoy-webclient

...

titleDeeplink 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}

...

titleSpecify the method to execute on startup

Opens the specified solution


{serverURL}/servoy-

...

webclient/ss/s/{mySolutionName}/

...

a/

...

titleSpecify 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

...

titleSpecify 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

...

titleSpecify 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/

...

titleSpecify 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

...

shortHandLinkSyntax

...

shortHandLinkSyntax

Running Servoy Web Client inside a Frame or IFrame

By default, a Servoy Web Client runs in the main browser window, but it is possible to run the Web Client inside a Frame/IFrame embedded in another webpage.

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 (for example: http://www.mycompany.com/pagewithframes.html) does not equal the domain from which the Web Client is hosted (for example http://mycompany.hostingcompany.com), there is a possible issue with the ability of storing HTTP Cookies.

Based on the settings of the browser, these so-called Third Party Cookies are blocked from storage. Internet Explorer does this by default, most other browsers allow it by default, but this can be turned off by the user.

The Web Client uses HTTP Cookies to save the position and location of dialogs and the functions application.setUserProperty(...) and application.getUserProperty(...) utilize Cookies in the Web Client. If the cookies cannot be stored, the Web client will continue to operate, but the position and sized of the dialogs and the value of user Properties will not be remembered.

The only remedy to the issue is configuring the browser to accept Third Party Cookies and this needs to be done by the user. As Internet Explorer does not allow Third Party Cookies by default, this browser is usually the one that causes Problems. Luckily, for Internet Explorer there is something that can be done by the developer of the webpage that is being displayed in the frame.

Adding a "Compact Privacy Policy" header to the Web Client pages
A Compact Privicy policy header is a specific header in the HTTP Response of a Web Client page, with a compact description of a Platform for Privacy Preferences (P3P) policy.

P3P is a standard for websites to provide the users of the website with information about the usage and possible storage of privacy related data. See http://www.w3.org/P3P/ for more information. Although the standard never really took off and isn't widely supported, it will come in handy in this scenario as Internet Explorer does implement it.

A P3P policy can be created online using http://p3pedit.com/ or with a downloadable tool provided by IBM here. When generated, it will also produce the Compact Privacy Policy string required for the configuration below.

Having said all of the above, many sites skip the generation of a full P3P policy and just take a appropriate value from the many websites that discuss the use of third party cookies in Internet Explorer and move on. The description of the required configuration below uses such a value, but we encourage developers/admins to set it up properly.

The P3P Compact Privacy Policy header can be added to all Web Client pages served by the Application Server, by adding and configuring a Filter in the webserver used by the Servoy Application Server.

The Filter is a small Java library and can be downloaded here: FilterP3P.jar. Place the downloaded jar file in <serverUrl>/application_server/server/webapps/ROOT/WEB-INF/lib (create the lib directory iif it doesn't yet exist).

Secondly, open <serverUrl>/application_server/server/webapps/ROOT/WEB-INF/web.xml and add the filter configuration shown below between the "</servlet-mapping>" and "</web-app>" tags.

Replace the value of the param-value with the generated Compact Privacy Policy string.

Code Block
titleweb.xml
...
  <filter>
  	<filter-name>P3PHeaderFilter</filter-name>
  	<filter-class>com.servoy.extensions.server.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>
...

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 Privicy 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 individual users. It can be that corporate IT departments restrict the user from altering this setting.

Cookies without Compact Privicy Policy: These are cookies from pages that do not include a so-called P3P header in the HTTP Response
Note
titleThe other option: Altering the Security level in Internet Explorer on every client machine
Note
titleUsing Query parameters instead of ...

In all examples above, the specification of the key and value can also be done through query parameters, for example:

Code Block
{serverUrl}/servoy-webclient/ss?s={solutionName}&m={methodName}&a={value}&{param1}={value1}&{param2}={value2}


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:

  1. Append '/sv_auth_type/basic' to the Web Client URL. For example:  {serverURL}/servoy-webclient/ss/s/{mySolutionName}/sv_auth_type/basic
  2. 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