Commit bc20ceb6 authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Favicons are now loaded from a servlet to speed up page loading. JM-495

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3646 b35dd754-fafc-0310-a699-88a17e54d16e
parent 1d1680bb
...@@ -73,6 +73,12 @@ ...@@ -73,6 +73,12 @@
<load-on-startup>1</load-on-startup> <load-on-startup>1</load-on-startup>
</servlet> </servlet>
<servlet>
<servlet-name>FaviconServlet</servlet-name>
<servlet-class>org.jivesoftware.util.FaviconServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<listener> <listener>
<listener-class>org.jivesoftware.wildfire.XMPPContextListener</listener-class> <listener-class>org.jivesoftware.wildfire.XMPPContextListener</listener-class>
</listener> </listener>
...@@ -84,6 +90,11 @@ ...@@ -84,6 +90,11 @@
<url-pattern>/plugins/*</url-pattern> <url-pattern>/plugins/*</url-pattern>
</servlet-mapping> </servlet-mapping>
<servlet-mapping>
<servlet-name>FaviconServlet</servlet-name>
<url-pattern>/getFavicon</url-pattern>
</servlet-mapping>
<jsp-config> <jsp-config>
<taglib> <taglib>
<taglib-uri>admin</taglib-uri> <taglib-uri>admin</taglib-uri>
......
...@@ -3,21 +3,19 @@ ...@@ -3,21 +3,19 @@
- $Date$ - $Date$
--%> --%>
<%@ page import="java.net.URLEncoder, <%@ page import="org.jivesoftware.util.JiveGlobals,
org.jivesoftware.util.JiveGlobals, org.jivesoftware.wildfire.server.IncomingServerSession,
java.util.Date, java.net.URLEncoder,
java.util.Calendar, java.util.Calendar,
javax.swing.*, java.util.Date"%>
java.net.URL"%>
<%@ page import="org.jivesoftware.wildfire.server.IncomingServerSession"%>
<%-- <%--
- This page is meant to be included in other pages. It assumes 4 variables: - This page is meant to be included in other pages. It assumes 4 variables:
- * 'host', the name of the remote server - * 'host', the name of the remote server
- * 'inSession', an IncomingServerSession object - * 'inSession', an IncomingServerSession object
- * 'outSession', an OutgoingServerSession object - * 'outSession', an OutgoingServerSession object
- * 'count', an int representing the row number we're on. - * 'count', an int representing the row number we're on.
--%> --%>
<% // Show the secured icon only if ALL sessions are secure <% // Show the secured icon only if ALL sessions are secure
boolean isSecured = true; boolean isSecured = true;
...@@ -38,16 +36,7 @@ ...@@ -38,16 +36,7 @@
<td width="47%" nowrap> <td width="47%" nowrap>
<table cellpadding="0" cellspacing="0" border="0"> <table cellpadding="0" cellspacing="0" border="0">
<tr> <tr>
<% Object content = null; <td width="1%" ><img src="getFavicon?host=<%=host%>" width="16" height="16"></td>
try {
content = new URL("http://"+host+"/favicon.ico").openConnection().getContent();
}
catch (Exception e) {}
if (content != null) { %>
<td width="1%" ><img src="http://<%=host%>/favicon.ico" width="16" height="16"></td>
<% } else { %>
<td width="1%" ><img src="images/server_16x16.gif" width="16" height="16"></td>
<% } %>
<td><a href="server-session-details.jsp?hostname=<%= URLEncoder.encode(host, "UTF-8") %>" title="<fmt:message key="session.row.cliked" />"><%= host %></a></td> <td><a href="server-session-details.jsp?hostname=<%= URLEncoder.encode(host, "UTF-8") %>" title="<fmt:message key="session.row.cliked" />"><%= host %></a></td>
</tr> </tr>
</table> </table>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment