Taking CSS code out of a JSP file -
friends in jsp have following code format
<%@page iselignored="false" trimdirectivewhitespaces="true" contenttype="text/html;charset=utf-8"%> <%@ taglib prefix="bs" tagdir="/web-inf/tags"%> <%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%> <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%> <bs:main title="status"> <bs:content> <bs:infoline /> <div class="menubar"> <bs:menu /> </bs:content> </bs:main> <script type="text/javascript"> $( document ).ready(function() { $('.save,.close').hide(); }); $(document).ready(function () { var seconds = 5000; // time in milliseconds var reload = function() { $.ajax({ url: 'editstatus.jsp', cache: false, success: function(data) { $('#refreshdiv').html(data); } }); }; setinterval(reload,seconds); }); var textvalue = ""; $('.pencil').on('click', function(){ textvalue = $(this).siblings('.textval').text(); $(this).siblings('.textval').html("<input type='text' id='textval' value='" + textvalue + "' />"); $(this).hide(); $(this).siblings('.save, .close').show(); }); $('.save').on('click', function(){ $(this).siblings('.textval').html($(this).siblings('.textval').find(':text').val()); $(this).hide(); $(this).siblings('.close').hide(); $(this).siblings('.pencil').show(); }); $('.close').on('click', function(){ $(this).siblings('.textval').html(textvalue) $(this).hide(); $(this).siblings('.save').hide(); $(this).siblings('.pencil').show(); }); </script> <style type="text/css"> .textbox { height: 24px; width: 65px; line-height: 22px; padding: 3px } #textval { width: 22px; margin-right: 4px } .icons { float: left; width: 20px; height: 20px; } .save,.close { display: none; width: 20px; height: 20px; float: left } .textval { float: left; width: 35px; height: 20px; margin-right: 5px } .pencil { display: block } .red { color: red } </style>
now simplicity , want include code starts in separate css file , include css file in above jsp . please suggest best way thanks
move contents of tag file called "style.css" (or whatever like). add tag jsp:
<link rel="stylesheet" type="text/css" href="style.css" />
Comments
Post a Comment