How to display a favicon for web app using Tomcat? [duplicate] - apache

This question already has answers here:
How to add a browser tab icon (favicon) for a website?
(13 answers)
Closed 6 years ago.
Does anyone know how to implement a favicon icon for a particular application using Tomcat? This icon file would not be for all webpapps, just this one on the server in question.

Just add the following code in the <head> to your index.html in you webapp/projectName/
<link rel="shortcut icon"
href="http://example.com/myicon.ico" />

I like to add that the original tag type for the link was "shortcut icon", but that didn't
conform to the standard so it was sort of switched to "icon".
So I recomend add both to your head block:
<link rel="icon" href="http://www.example.com/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="http://www.example.com/favicon.ico" type="image/x-icon">
Also some browsers don't support sizes other than 16px X 16px.

Delete or rename tomcat/webapps/ROOT/favicon.ico and Tomcat will look for a favicon.ico in the root of each web app that it serves. You don't need to put a into the head section of each page.

<link rel="shortcut icon" href="http://example.com/myicon.ico" />
add that within the <head> of your page - where the .ico file is an icon - there are several websites (use google) that generate .ico files from pictures (gif / jpeg etc)

Related

bootstrap.min.css loading is very slow if internet is disabled

I just noticed this weird behavior in my Codeigniter 3 site. This is my HTML head from the home page (CI view), of a site I have on a PC wamp server on my local network.
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width">
<title>Login</title>
<link rel="shortcut icon" href="assets/images/favicon.ico">
<link rel="stylesheet" type="text/css" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="assets/css/login_style.css">
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/dimmscreen.js"></script>
</head>
I access the site on my local network. When I have an internet connection the site loads instantly. When I unplug the internet from the router, the site is slow and takes about one minute to load.
If I don't try to load the bootstrap.min.css resource and disable internet, the site is also fast. As you can see, all of the resources i use are stored in a local assets folder. I don't need anything from the internet.
So why is bootstrap.min.css causing the slowdown? Is it something connected with the path of the resource?
found the problem, bootstrap.min.css was trying to access some fonts on the web
https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,700italic,400,300,700

ASP.NET page is not loading CSS styles on my local iis web server

I have a local ASP.NET web site written in VB.NET runing on W7.
The default web page contains a simple style sheet which is loaded as follows
<link rel="stylesheet" href="dchs.css" type="text/css" media="screen" runat="server"></link>
The page is displayed without the above styling. The style sheet does exist as I can display it via the web browers as
file:///c:/inetpub/wwwroot/c1/dchs.css
but I cannot display it via the brower using
http://localhost/c1/dchs.css
This leads me to believe that IIS has some form of access problem to the C1 directory. It a similar way I can display a jpeg image via file://c1 bit not via localhost which gives an error message
The image "http://localhost/c1/menu.jpeg" cannot be displayed, because it contains errors.
How you attached the .css file to your html project? where is it located?
Options:
1. Drag and drop your .css file to your html page.(Inside)
like this:
<link rel="Shortcut Icon" href="images/fil.ico" />
Make sure all folders and files are include when project deployed And a correct calling of id or class in your css of course.

MVC 4 razor actionlink address route adds pound char in between

the reason of this question is because I am having troubles with a route address in MVC 4 application, what is happening here is that I have an action link in this way in a view:
<li>#Html.ActionLink("Description", "Action", "Controller")</li>
And when I run the app in the HTML in the web browser appear the link generated correct
<li>description</li>
but when I click on the link in the web address bar the destination route appears as follows:
http://localhost:port/#/Controller
Is inserting a "#" char in between, is doing this for all of the links in my different views, it do the same when I deploy the App in a web server too no only in my local and this makes that the destination page don't appear correct, I don't know the reason of this, I have been searching but without success, hope you can help me, thanks in advance.
I found the reason for that behavior, it was because I have the script load for jquery mobile on the head section in the _Layout_cshtml file like this
<head>
<meta charset="utf-8" />
<title>#ViewBag.Title</title>
<meta name="viewport" content="width=device-width" />
#Scripts.Render("~/bundles/jquery")
#Styles.Render("~/Content/mobilecss", "~/Content/css")
#Scripts.Render("~/bundles/modernizr")
#Scripts.Render("~/bundles/jquerymobile")
</head>
What I do was change the location of jquerymobile script to the end of the _Layout.cshtml
#Scripts.Render("~/bundles/jquerymobile")
#RenderSection("scripts", required: false)
</body>
With this change the web route was created correctly, I hope this helps to somebody.

replace favicon in mvc4

I have provided <link rel="shortcut icon" href="~/Images/logo.gif" /> in my layout but i wish to replace the favicon on all the pages, even where layout is not used.
I replaced the favicon file with my favicon (present in the root folder) still it loads the default favicon on pages without layout.
What more needs to be changed in order to get my favicon.
a similar but slightly different question has already been asked but isnt answered by anyone.link
It's better to convert your .gif to .ico, you can do this online
It's a convention to rename the icon to 'favicon.ico'
You can find more information on Wikipedia - look at the section 'How to use'
Your html should look like:
<link rel="shortcut icon" type="image/ico" href="~/Images/favicon.ico">
Check Mark Gravell's solution here

Sniff and modify URL requests coming from UIWebViewController

I have one html page open inside UiWebViewController with cordova. While index.html loading inside the Uiwebviewcontroller can we sniff the requests that is originating from index.html?
for example I have following html that is getting opened in UiWebviewcontroller:
<html>
<head>
<link rel="stylesheet" type="text/css" href="theme.css">
<script src="app.js"></script>
</head>
<body>
<img src="img.jpg"/>
</body>
</html>
Can I sniff and modify the url that is getting requested inside Uiwebviewcontroller ie. img.jpg,theme.css,app.js to something like content/img.jpg, css/theme.css, js/app.js using Objective-C.
Yes, that’s possible using NSURLProtocol, see this blog post by NSHipster and this related Stack Overflow thread.