how to set directories js for javascript files, ui for interfaces and css directory for style in web.xml - apache

I want to set web.xml for my first project. For managing project easily i want to arrange files in folders according to their extension in Web Content folder.

Anything wrong with just putting them in exactly those folders?
someapp/js/myscript.js
someapp/css/mystyles.css

Related

Shopify Use Subdirectory in Asset Folder

Instead of putting all files in a place in the asset folder, I want to use CSS files in CSS folder, JS files in js folder and images in images folder. Then Include them in the asset folder, so that I can maintain the files easily.
I know Shopify doesn't support any sub-directories within the asset folder. But is there any trick to do that?
According to a Shopify employee. This is currently not possible and the reason is due to a limitation of the CDN they use. See that post here.
Regardless, it's not good practice to have source files in the assets folder. Look into the Shopify Slate tool. It's a theme scaffold and command line interface that helps keep your project structure organized.
You can organize your assets (both CSS and JavaScript) as source files with directory structures in a manner similar to this:
styles/
global/
modules/
settings
tools/
vendor/
The command line tool takes care of compiling all the source files into one CSS/JS file! As a consequence, you don't need to worry about including the respective files with <link> or <script> tags because it's all taken care of already!
Unfortunately, this is not something currently supported by Shopify (As of 14/Sept/2017)
I tried making sub-folders both at the root of my dev theme and in the asset folder of my dev theme in a few different ways, including through Shopify's ThemeKit editor, but Shopify did not let me create the folder.
Attempting to create sub-folders in the normal theme editor in the store (by naming an asset subfolder/filename) generates the error message: Theme files may not be stored in subfolders
Shopify's normal theme editor groups files by types so that they appear close together, and apparently that's as much as Shopify is giving us right now.

What's the difference between static and templates folder under resources in a springboot & thymeleaf project?

I'm new to thymeleaf and springboot.
I create a springboot project with thymeleaf in IntelliJ IDEA with "New Project"->"Spring Initalizr".
Then I get a project whose structure looks like below.
demo
|+-src/main
| +-java
| +-resources
| static
| templates
| application.properties
|-pom.xml
The question is what should I put in static and templates under resources? What's the difference between them?
I guess the .html files that have thymeleaf attributes should be put in templates. How about static html, css and js?
Thanks.
templates folder is a place where you put all the thymeleaf templates. It is a default directory (by default spring will look inside for any templates).
static folder is used for serving web static content, all the css, js, html etc. (also default folder search by spring)
http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-developing-web-applications.html#boot-features-spring-mvc-static-content
These folders are a way of organizing your files. These static and templates folders have special meaning in a case that it know has become common understanding for organizing your frontend files such as css, js, html etc among developers. In my understanding we should place files like css, js, images that supports your web pages which are not going to change through out your application at runtime. For eg: your design is not going to change which is done in your css file. In templates we should place html files. If you add both html and other files together, it becomes hard to organize your files.

Combine all my custom JS into one single file with dojo build

I'm having a hard time trying to set up dojo build in my project.
Basically, I have my js folder with all my custom widgets and components. I simply want to combine all javascript files form js folder into one single file.
dojo sources are located outside this folder. The structure looks similar to this:
/public
/prod
/dojo-1.9
/dijit
/dojo
/dojox
/js
myScript1.js
myScript2.js
Do you have any idea on how should I configure the package.json and profile.js? The documentation doesn't seem to help since all I am getting is an output folder with the same contents as the js folder (no javascript is merged).
You can start by reading this article:
https://dojotoolkit.org/reference-guide/1.10/build/simpleExample.html
It provides a simplified overview of dojo build system.
Additional there is dojo boilerplate with a sample of folder structure and profile.js configuration for quick start here:
https://github.com/csnover/dojo-boilerplate
I definitely suggest you to use the boilerplate as start for your project as it simplify a lot initial configurations.

Changing Inside Assets Folder In Yii Framework

I came to notice that there is one folder called assets in the root folder.To know more about it,I went through this link.Now I want to know adding some css in these files is good or shall I add css to to the main.css file inside css folder.
The asset folder is automatically generated by Yii based upon your environment so best avoid putting your CSS, images etc inside here. It also best to not commit these folders and files into SVN as they are automatically generated and folder names will differ from your qa/staging/live site to your local site.
There are some good reasons to use Yii's assets.
it prevents naming conflicts in css and js files
it allows you to keep CSS and JS files under your document-root but outside of your web-root (for easier version control)
it allows to easily switch between sets of CSS & JS files, rather than having to deal with each file individually (suppose the system admin needs to revert back to a previous version).
it allows you to publish assets (images, JS & CS) to several websites hosted on the same server.
Please check here or there for more details.
Well, when i started my first Yii project, i also put my CSS and JS files in assets. It works but then i found that its not just the right way. Its better to make a separate directory for your CSS file(s). Also there are some auto generated files in assets, so to avoid mix-up with those and your i prefer to make it separate. Hope you got the point.

how to configure apache tiles to read jsps from inside jar files?

The architecture of my web application is highly modular. I am using apache tiles as the templating framework. The app modules are bundled as different jar files and put inside WEB-INF/lib folder. So each jar file will contain its own tiles configuration files (containing tiles definitions) and related jsp templates.
I am using CompleteAutoloadTilesListener which is a part of tiles-extras package to read the tiles config files from the jar files. But the jsp files aren't picked up by tiles. When I access any definition, it couldn't find the jsp template file.
A configuration change will solve this problem? or should I subclass any tiles base class to let tiles load jsps from the jar?
Someone else ran into this problem before and even wrote a blog about it
It mentions this issue that is fixed, so you should be able to use the same setup and load your tiles definitions from the classpath.
I haven't tested it, but it looks like a sensible solution.