Monday, September 9, 2013

main.scala.html fails to load with end tags

I encountered very interesting issues today when I was adding twitter bootstrap to our project. I downloaded the bootstap and added the files into my public directory. Subsequently I added below lines into our main template since I need the styles on all the pages.


href="@routes.Assets.at("bootstrap/css/bootstrap.min.css")" rel="stylesheet" media="screen">
<script src="@routes.Assets.at("bootstrap/js/bootstrap.min.js")" type="text/javascript" />

After adding I refreshed my page and it was getting rendered as blank. None of the contents were getting displayed on the page though I could see them using view source. 

I started playing around and replaced the "/>" with proper ending tag. i.e.

<link href="@routes.Assets.at("bootstrap/css/bootstrap.min.css")" rel="stylesheet" media="screen">

<script src="@routes.Assets.at("bootstrap/js/bootstrap.min.js")" type="text/javascript"></script>

Everything started working as expected. So not sure why it did not work without proper end tag. I will debug the playframwork code soon when I will have some time.

Cheers!
Manisha