0

I am working for java web application and I am using login.jsp file to login into the application, here we are using <link> tag to display icon at the browser tab.
The following is the link tag.

<html>
<head>
<link rel="icon" href="/images/favicon.ico">
</head>
</html>

Here in href I want to use the absolute path to render icon which will be helpful in rendering icon image in IE.
Since we are using the jsp file, we can get the request object, So how to form the absolute url from the request and place it into the href of link tag

Mr Lister
  • 45,515
  • 15
  • 108
  • 150
M.S.Naidu
  • 2,239
  • 5
  • 32
  • 56

1 Answers1

0

for getting request path use request.getRequestURI()

for getting absolute path of images folder , use application.getRealPath("/images") (not recommended to be used in a web page.)

For rendering image/icon you can use a dedicated Servlet whose response type is image/ico.

Arun Xavier
  • 763
  • 8
  • 47