wood burning stoves*
The moose likes Servlets and the fly likes Trying to place an Icon Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Trying to place an Icon" Watch "Trying to place an Icon" New topic
Author

Trying to place an Icon

Swapnonil Mukherjee
Greenhorn

Joined: Jul 12, 2001
Posts: 6
Hello,
I was trying to this to my web.xml file
<icon>
<small-icon>icon.gif</small-icon>
</icon>
Tomcat 3.2.2 gave an error of unable to find method setIcon null (null,null)
Has anybody tinkered with this before.
The whole point is to have specific icon to my web page in my address bar like msn.com and www.jspin.com.

------------------
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12803
    
    5
You are on the wrong track - the icon tags are for use in servlet administration tools, not for web page display. You will hve to use conventional HTML <img> tags to put your icon on the page. When creating a page with a servlet, you must use either absolute URL addresses to point to image files or use the <base> tag to establish a base for relative urls.
Bill

------------------
author of:
timothy zimmerman
Ranch Hand

Joined: Jun 26, 2001
Posts: 149
I don't really have an answer for you but I did find this product
Homepage: http://radar.sourceforge.net/
Tar/GZ: http://radar.sourceforge.net/download.html
It is a webapp that you deploy into Tomcat which then lets you administer tomcat via web browser. It does have entries for setting the icons. Maybe it's worth giving a shot?
Swapnonil Mukherjee
Greenhorn

Joined: Jul 12, 2001
Posts: 6
Originally posted by William Brogden:
You are on the wrong track - the icon tags are for use in servlet administration tools, not for web page display. You will hve to use conventional HTML <img> tags to put your icon on the page. When creating a page with a servlet, you must use either absolute URL addresses to point to image files or use the <base> tag to establish a base for relative urls.
Bill


Dear Sir,
I would like to re-iterate my point. I was trying to place an image on the address bar and not on my webpage.(In fact I have 6 months+ exp as web designer).
Please Sir, go to www.jspin.com .You will see an image on the address bar before the url http://www.jspin.com
Thank You for Your Reply
Swapnonil Mukherjee
Java Programmer AG Software, Calcutta , India
Swapnonil Mukherjee
Greenhorn

Joined: Jul 12, 2001
Posts: 6
Originally posted by timothy zimmerman:
I don't really have an answer for you but I did find this product
Homepage: http://radar.sourceforge.net/
Tar/GZ: http://radar.sourceforge.net/download.html
It is a webapp that you deploy into Tomcat which then lets you administer tomcat via web browser. It does have entries for setting the icons. Maybe it's worth giving a shot?

Hello Tim,
Thanx Man I downloaded the stuff called Radar.I did use it. You know for someone who sees server.xml,build.xml and web.xml in his dreams , this is nothing smart.
But yes A VERY VERY GOOD tool for beginers and System Administrators. May God Bless the company.
It didnot solve my problem.Anyway it was quite quirky idea to begin with.
With Regards
Swapnonil Mukherjee
[This message has been edited by Swapnonil Mukherjee (edited July 18, 2001).]
Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1913
    
    6
I think that you just need to put a file called "favicon.ico" in the root of your website.
Take a look at http://www.jspin.com/favicon.ico or http://java.sun.com/favicon.ico
I think it's a Windows Bitmap file saved with a .ico extension.
Try this and let us know how you get on!
Regards
Simon
------------------
Simon Brown
Co-author of Professional JSP 2nd Edition
Subbu Aswathanarayan
Ranch Hand

Joined: Jun 22, 2001
Posts: 73
Hi Simon,
I am using JRun with IIS.I have created a web application called mywebapp whose root directory is c:\project\mywebapp.i tried placing the favico.ico file in that directory as well as in c:\inetpub\wwwroot.but when i try to access a jsp file in my webapps root directory the icon doesn't show up.
any idea where should i place the file.
thanks in advance.
Subbu
Originally posted by Simon Brown:
I think that you just need to put a file called "favicon.ico" in the root of your website.
Take a look at http://www.jspin.com/favicon.ico or http://java.sun.com/favicon.ico
I think it's a Windows Bitmap file saved with a .ico extension.
Try this and let us know how you get on!
Regards
Simon


[This message has been edited by Subbu Aswathanarayan (edited July 18, 2001).]


Subbu
timothy zimmerman
Ranch Hand

Joined: Jun 26, 2001
Posts: 149
I have one question. What exactly should I be seeing and where should I be looking for it? When I go to http://www.jspin.com ? The only image I see in the address bar is the little 'e' I always see when using Internet Explorer.
Glad you found Radar useful, it really does make getting through some of the config stuff a little easier.
Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1913
    
    6
I see the little icons on my PC at home, but not at work ... strange!
Simon
------------------
Simon Brown
Co-author of Professional JSP 2nd Edition
Swapnonil Mukherjee
Greenhorn

Joined: Jul 12, 2001
Posts: 6
while(icon.makeConnection())
{
It's working It's working It's working It's working It's working
It's working It's working It's working It's working It's working
It's working It's working It's working It's working It's working
It's working It's working It's working It's working It's working
It's working It's working It's working It's working It's working
Thanx Very Much Thanx Very Much Thanx Very Much Thanx Very Much
}
icon.takeDown();
Originally posted by Simon Brown:
I think that you just need to put a file called "favicon.ico" in the root of your website.
Take a look at http://www.jspin.com/favicon.ico or http://java.sun.com/favicon.ico
I think it's a Windows Bitmap file saved with a .ico extension.
Try this and let us know how you get on!
Regards
Simon


William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12803
    
    5
This seems to be a very browser specific result. I don't see it at java.sun.com with Netscape 4.6 or IE 5.50 - which browsers are people using to see the custom icon?
Bill
timothy zimmerman
Ranch Hand

Joined: Jun 26, 2001
Posts: 149
I have both IE 5 and NN 4.77 and I cannot recall seeing any icons in the address bar. I went to the jspin site but did not see anything special there. Can someone point me to a place where I can see an example of this? I am curious.
Swapnonil Mukherjee
Greenhorn

Joined: Jul 12, 2001
Posts: 6
To William Brodgen, Simon Brown , Timothy Zimmerman
I have been using IE 5.0 during this whole quirky experiment.I took Simon Brown's advice and made a icon from a gif file. I named it "favicon.ico" and placed it inside the root folder of our under construction website. Now since the website's context is already added to Tomcat3.2.2 I guessed that I would not face any problems . I then changed web.xml and put the tags
<icon>
<small-icon>favicon.ico</small-icon>
</icon>
And Voila it showed up when I called the home page of the our site.
But I have made important discoveries during this experiment
1.The display of the icon is totally dependent upon the browser.
For example The icon which I made doesnot show up any other linked page other than the home page.
2.It is also like "Now you see Now you don't"
3.Sites like www.java.sun.com www.jspin.com all use favicon.ico as the filename of the icon . So therefore If visit my site after browsing sun.com and jspin.com , the other two simply get de-iconified as all icons have the same name and you see they overwrite each other.
4.This is a good ploy. If you add a website having an address bar icon to your favorities folder of your browser and after doing that once you drop down on favorities you will see the icon almost evertime.
With Regards
Swapnonil Mukherjee
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Trying to place an Icon