0

How can I add a favicon to my zul page

asked 2011-04-13 17:31:19 +0800

paula gravatar image 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="*"?>
<?link rel="shortcut icon" type="image/x-icon" href="/myFavicon.ico"?>
<?link rel="icon" type="image/x-icon" href="/myFavicon.ico"?>
<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 flag offensive retag edit

10 Replies

Sort by ยป oldest newest

answered 2011-04-13 17:33:36 +0800

robertpic71 gravatar image robertpic71
1275 1

Check this.

link publish delete flag offensive edit

answered 2011-04-13 17:43:53 +0800

paula gravatar image paula
74 2

Yes I've checked this thread.
I actually used your solution by adding following 2 lines:

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

But it is not working

link publish delete flag offensive edit

answered 2011-04-14 05:52:12 +0800

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

what do you mean not working?

link publish delete flag offensive edit

answered 2011-04-14 09:57:40 +0800

paula gravatar image paula
74 2

It means the favicon does not show up at all

link publish delete flag offensive edit

answered 2011-04-14 10:31:16 +0800

matthewgo gravatar image matthewgo
375

updated 2011-04-14 11:06:12 +0800

Hi
Could you test a simple zul like:

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

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

/Matthew

link publish delete flag offensive edit

answered 2011-04-14 19:47:38 +0800

dennis gravatar image 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

link publish delete flag offensive edit

answered 2011-04-15 09:42:41 +0800

twiegand gravatar image 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"?>
<?link rel="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

link publish delete flag offensive edit

answered 2011-04-15 11:29:15 +0800

dennis gravatar image 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

link publish delete flag offensive edit

answered 2011-04-15 13:08:56 +0800

twiegand gravatar image 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

link publish delete flag offensive edit

answered 2011-04-15 15:18:24 +0800

paula gravatar image paula
74 2

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

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2011-04-13 17:31:19 +0800

Seen: 952 times

Last updated: Apr 15 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More