D
D
DrFreez2013-08-31 17:01:17
Java
DrFreez, 2013-08-31 17:01:17

Spring MVC, JSP, including css/js packages?

Yii has the ability to include css/js in batches.

We specify in the config which packages, what they contain and what they depend on.

'main' => array(<br>
  'baseUrl' => '/templates/',<br>
  'css' => array('css/s/main.css', 'css/s/main-responsive.css'),<br>
  'js' => array('js/s/main.js'),<br>
  'depends' => array('jquery', 'bootstrap'),<br>
),<br>
'bootstrap' => array(<br>
  'baseUrl' => '/templates/',<br>
  'js' => array('js/bootstrap.min.js'),<br>
  'css' => array('css/bootstrap.min.css','css/bootstrap.fix.css'),<br>
  'depends' => array('jquery'),<br>
),<br>
'font-awesome' => array(<br>
  'baseUrl' => '/templates/',<br>
  'css' => array('css/fontawesome/fontawesome.css'),<br>
),<br>
'jquery' => array(<br>
  'baseUrl' => '/templates/',<br>
  'js' => array('js/jquery-1.8.3.min.js'),<br>
);<br>

Next in the template we call
Yii::app()->getClientScript()->registerPackage('main');<br>

And as a result, in the layout we get only the necessary and in the right order css / js connected.

Is there something similar in Spring?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim, 2013-08-31
@mgramin

tiles.apache.org/
?

V
valkiriy, 2013-08-31
@valkiriy

include another jsp?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question