Author |
Message |
08/01/2015 13:13:51
|
katsarova
Joined: 12/12/2014 08:32:05
Messages: 3
Offline
|
How can we set the title of the browser tab when running the application as an applet (s. attached file)?
At the moment the URL is shown in the tab. I tried the t:clientconfig component (property title), but this works fine only when using webstart.
|
Filename |
CC_BrowserTitle.png |
Download
|
Description |
|
Filesize |
31 Kbytes
|
Downloaded: |
348 time(s) |
|
|
|
08/01/2015 13:30:20
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5525
Offline
|
Hi,
the title is coming from the HTML page around the applet.
By default it is the "ugly URL" or it is expliclty defined in the title of the HTML page:
Code:
...
<head>
<title>Some nice title.</title>
...
</head>
...
Now, the HTML page is created by the servlet behind ".ccapplet".
By default the servlet (name: "AppeltStarter") uses the following template from the serverside webapp-classloader: "org/eclnt/jsfserver/starter/applettemplate.html". But you may define some own template via "<webcontent>/eclntjsfserver/config/system.xml":
Code:
<starttemplates
...
ccapplet="org/eclnt/jsfserver/starter/applettemplate.html"
...
/>
So, the steps are:
1. Create copy of "org/eclnt/jsfserver/starter/applettemplate.html" and place it inside your server side code. (e.g. in "aaa/bbb/applettemplate.html"). In the copy define the HTML-title as desired.
2. Define the page in start.xml:
Code:
<starttemplates
ccapplet="aaa/bbb/applettemplate.html"
/>
3. Reload the server
Regards, Björn
|
Björn Müller, CaptainCasa GmbH |
|
|
08/01/2015 14:25:25
|
katsarova
Joined: 12/12/2014 08:32:05
Messages: 3
Offline
|
Thanks for your quick reply!
In my understanding, the servlet AppeltStarter returns this path to the html as default.
Unfortunately, I cannot find this path to copy the html:
"org/eclnt/jsfserver/starter/applettemplate.html"
And I suppose, you mean system.xml, not start.xml?
Is there any possibility to bind the title to a value expression? Some of our customers want to see here a special title defined by the customer itself which is usually provided by an external system (e. g. SAP).
Thx!
|
|
|
08/01/2015 15:00:02
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5525
Offline
|
Hi,
"org/eclnt/jsfserver/starter/applettemplate.html" is part of eclntjsfserver.jar
The loading of the template is done through the class loader. That's why you have to place your copy of the template into your Java classes/packages as well.
@"Is there any possibility to bind the title to a value expression?"
Well, so far not. But...: we could open up. And just say that you may e.g. pass "?title=Hello Kitty" to the ".ccapplet". (In this case you would not have to create any template on your own.) Would this be an option for you?
Regards, Björn
|
Björn Müller, CaptainCasa GmbH |
|
|
09/01/2015 12:01:39
|
katsarova
Joined: 12/12/2014 08:32:05
Messages: 3
Offline
|
Hi!
Worked well with the html so far, many thanks!
But it's not exactly what we are looking for because the title is still "hard coded".
Using a parameter ?title=Hello Kitty isn't that nice (we use the url in e-mail notifications and don't want to set the title this way). Apart from that, it's not quite clear which steps we need, to make only the title to appear in the tab.
Actually, we need something like this in the html:
<title>@@title@@</title>
We tried the following workaround: we extended the AppletStarter-Servlet, referred to our new servlet class in the web.xml and tried to identify our own parameter @@title@@, but this didn't work as expected.
So, maybe we can get access to the sources of the AppletStarter class or you could provide us a way how to use own parameters in the html in the same way as you do for parameters like @@pagename@@ etc. Then we can implement a servlet which comunicates with some other system, get all the information we need and map it to our own parameter(s).
What do you think about that?
|
|
|
26/01/2015 12:02:24
|
CaptainCasa
Power User
Joined: 21/11/2007 12:23:06
Messages: 5525
Offline
|
...took some time to respons, sorry!
Because of the AppletServlet-servlet => I did send you some mail...
Regards, Björn
|
Björn Müller, CaptainCasa GmbH |
|
|
|