# How can I add a favicon to my zul page

paula
74 2

Hi,

I tried to add a favicon to my web app by using the solution provided by robertpic71 in thread http://www.zkoss.org/forum/listComment/7518
So my zul page looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<?page id="xxx" title="xxx" automaticTimeout="false"?>
<?import src="/xx/xxx/sample.zul" directives="*"?>
<zk>
<zscript><![CDATA[
import com.tcs.gla.ui.Console;
Console.logout();
]]>
</zscript>
......
</zk>

It is not working no matter what browser I use. However when I tried to access favico directly through URL, the favicon shows up.

Can anyone help? I can't see what could be wrong.

Thank you

delete retag edit

## 10 Replies

robertpic71
1275 1

Check this.

paula
74 2

But it is not working

dennis
3669 1 6
http://www.javaworld.com....

what do you mean not working?

paula
74 2

It means the favicon does not show up at all

matthewgo
375

Hi
Could you test a simple zul like:

<zk>
</zk>

if it works , you can add back your content (maybe line by line ), maybe you can find what cause the problem.

/Matthew

dennis
3669 1 6
http://www.javaworld.com....

work for me, maybe you should describe more about your setting, where is myFavicon.ico? I guess you have a wrong or wrong placed myFavicon.ico

twiegand
1807 3

Paula,

If you are running jBoss, you might also consider placing a "~" character at the front of the URL like this:

<?link rel="shortcut icon" type="image/x-icon" href="~/myFavicon.ico"?>


Although I don't have to do this in Tomcat, it seems jBoss needs it.

Just a thought...

Todd

dennis
3669 1 6
http://www.javaworld.com....

hi, Todd,
Why need to add ~/ in JBoss,
I think it is just http and html protocol isn't it?
Maybe paula need to describe more about the 'not work' not just two words.

/Dennis

twiegand
1807 3

Dennis,

I never could figure it out either but it seems necessary in our environment. Maybe it is a configuration issue on our side?

I could have one of our teams investigate but it seems to work in production so it doesn't seem worth it.

Sorry if I confused things...

Todd

paula
74 2

Thank guys. The favicon show up correctly. And I am using Weblogic

[hide preview]