Τρίτη 7 Μαΐου 2013

Embedding CSS in .jsp pages

Plain CSS is nice, easy, applicable, but for static pages only. When you want something more, embedding a CSS stylesheet into a .jsp page can work as an amazing taste choice. One of the first things you have to do, is to add the following code snippet to the .jsp code. This will allow direct access to the c: url command, which brings the path you need directly to your plate. (Caution: You need to save the CSS hosting folder under the web subfolder of your project *NetBeans users*)

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

Then, you can easily apply the all time classic technique of calling a CSS stylesheet in your good 'old HTML (jsp :p) document.

<head>
<link type="text/css" rel="stylesheet" href="<c:url value="/extra_folder_name(if_any)/default.css" />" />
</head>

Δεν υπάρχουν σχόλια:

Δημοσίευση σχολίου