• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Minification and Componentize multiple CSS and JS files

 
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I was curious if anyone in the class knew of any tools, libraries, frameworks within Java EE that will minify and componentize (if thats a word) multiple css and js files.

For example: lets say you have a login.css and a index.css. You want to keep these separate to make them more modularized/componentized. The minification will remove any white space and try to compile everything to as less lines as possible for faster transmission of files. For example jquery.min.js is a minified version of jquery.

I get this idea from Angular.js. Angular is a very component based framework. Example, you would have a login component and the login component would have its own html, css and js files. The components are combined to build a single page which could be the main page of your website. I like this design as for large web applications it makes it easier to maintain different components of a web application. Plus it is also loosely coupled as its very easy to remove and add components throughout the web application. Component based web applications are becoming very much the future.

This approach is good if you have several components within an application. Login is just an example but you could very well have a slider or carousel component. The amount of components is completely dependent on the web application needs but its provides a more robust solution for web applications.

CSS Tricks intro to web components
https://css-tricks.com/modular-future-web-components/


In jsp you can include multiple html segments into specific jsp files using include.

Includes at compile time for dynamic data


Includes at runtime


I am curious on how to separate the css and js files in Java EE. Minify not necessary a requirement because you can always do this manually for the production environment but would be a plus if the tool, library or framework was able to do this.
 
Charles Sexton
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
does spring MVC or GWT allow you for example create a component such as


directory structure example
 
Charles Sexton
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic