Add css file to resources but can not read it in Spring MVC 3.1 - spring

I download source code from this link
https://www.onlinetutorialspoint.com/spring/spring-mvc-login-form-example.html
https://www.onlinetutorialspoint.com/wp-content/plugins/download-attachments/includes/download.php?id=206
I can run it well and I want to include bootstrap css to project.
In this project they setup config:
<resources mapping="/resources/**" location="/resources/" />
I tried to add bootstrap.css to resources folder and include it in head tag of jsp file.
But it can not read css file.
<link href="<c:url value="/resources/bootstrap.min.css" />" rel="stylesheet">
I added css to /webapp/resources folder.
Here are my project file structure.
What is problem in my source code?

<mvc:resources mapping="/resources/**" location="/resources/" />
this resources folder is placed under the main (main/resources) folder by default. hence, please move bootstrap.min.css file into main/resources.

Finally, I changed spring mvc from 3.x to version 4, it worked.

Related

where should static media (pictures, html, pdf...) reside in Sphinx source project [duplicate]

Using Sphinx, one can include static files in the _static folder of the build output. How could I copy a static file to the root of the build folder?
Background: I'm hosting the output of a Sphinx project in Azure App Services, and because of a mp4 video in a few pages, I need a "web.config" file with the following entry:
<staticContent>
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
</staticContent>
I need Sphinx to include the web.config in the root of the build folder.
Use html_extra_path. This is a configuration option that will copy the list of files given to the html build directory:
html_extra_path = ['path/to/web.config']

IntelliJ: Invalid .iml location and content when I choose "create new project" over "open existing project"

I have several question about how the project structure is created and stored. Here is the context: I have a git repository containing some groovy files which I use for a Jenkins library. So what is interesting us here is the "src" folder, which contains groovy classes, and the "vars" folder, which contains groovy scripts (DSL).
There's no existing IntelliJ project, no .idea folder, no .iml, no pom.xml ...
Let's say that the repository is located under:
C:\Toto\JenkinsLibrary
- .git
- src
- vars
My objective is to create a Maven project from scratch.
First Method:
Initially, I open IntelliJ and choose "Create new project". Select "Maven", no archetype, then I enter the following information:
Project name: I leave the project corresponding to the artifactID: JenkinsBuildLibrary
Project location: C:\Toto\JenkinsLibrary
More settings: Module name = JenkinsLibrary, Content root = Module file location = C:\Toto\JenkinsLibrary, Project format = .idea
Then click finish
Here, the .iml file is generated OUTSIDE the .idea folder, looking like this:
C:\Toto\JenkinsLibrary
- .git
- .idea
- src
- vars
- JenkinsLibrary.iml
- pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
Then soon after the content of the iml goes to:
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4" />
Also, I have been trying to reproduce this several times and it is extremely complex to get a consistent behavior, sometimes I have the iml file with no generated pom, sometimes I have the pom with no iml .... so I guess there's a huge bug here.
Finally, if I change the project structure by adding other sources folder or other modules, nothing changes in my .iml file. Then I can close IntelliJ, remove ALL .idea, .iml and pom.xml files ... to get everything back once I reopen IntelliJ, leaving me to wonder: where is that configuration actually stored ?!
Second method:
This time, I choose "Open existing project". I select the folder: C:\Toto\JenkinsLibrary
There's no existing project but it still works and create a new project.
The .iml file is now under the .idea project !!
C:\Toto\JenkinsLibrary
- .git
- .idea
- JenkinsLibrary.iml
- src
- vars
- pom.xml
Right click the module, select "Add Framework Support", Maven, and I get a pom file.
When I change the project structure, the .iml is correctly updated. Exemple:
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$" />
<content url="file://$MODULE_DIR$/../../tools/ToolJenkins/src">
<sourceFolder url="file://$MODULE_DIR$/../../tools/ToolJenkins/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
Now If I close IntelliJ, remove ALL .idea, .iml and pom.xml files ... I don't get anything back once I reopen the project (only the files and folder located under the module), which seems a far better behavior !
SHORT SUMMARY:
When creating a new Maven project, the .iml is located at the root of the project instead of under the .idea folder and is invalid. The project structure seems to be stored elsewhere. I have no way to ship a valid project to my teammates.
When opening a new project, the .iml is located under the .idea folder and is valid. The project structure is stored under it (with warnings that project are defined by a pom file and changes performed under the Project structure menu could be wiped). I can ship a valid project to my teammates.
I need to understand those differences and how IntelliJ works. I hope for a quick answer since this is not the first time we struggle with project structures and may well move back to another, more stable IDE is necessary.
Thanks !
IntelliJ IDEA stores generated project files externally for Maven or Gradle based projects. You should never edit them manually or adjust any content roots and source roots via the interface as they are managed by the build system configuration (pom.xml) in your case.
To change or add additional source roots you need to modify pom.xml directly.
It looks like your directory layout doesn't follow the standard Maven convention. You may need to override it or add additional directories.

How to output a custom static file in Sphinx?

Using Sphinx, one can include static files in the _static folder of the build output. How could I copy a static file to the root of the build folder?
Background: I'm hosting the output of a Sphinx project in Azure App Services, and because of a mp4 video in a few pages, I need a "web.config" file with the following entry:
<staticContent>
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
</staticContent>
I need Sphinx to include the web.config in the root of the build folder.
Use html_extra_path. This is a configuration option that will copy the list of files given to the html build directory:
html_extra_path = ['path/to/web.config']

Creating and populating subfolders Joomla manifest XML

I've become fairly confused when I'm trying to create a subfolder and populate it with things in my plugin manifest XML.
If I want to create a subfolder and at the same time add files to it, how would that be done? Read comments in the code draft (all names are of course more distinct than used here).
<?xml version="1.0" encoding="utf-8"?>
<extension type="plugin" version="2.5.0" group="group" method="upgrade">
<name>Handelsbanken Finans Delbetalning</name>
<!-- The following elements are optional and free of formatting conttraints -->
<creationDate>July 2013</creationDate>
<author>Emil Carlsson</author>
<authorUrl>http://valid.url</authorUrl>
<copyright>Copyright (C) 2013</copyright>
<version status="BETA">0.0.1</version>
<!-- The description is optional and defaults to the name -->
<description>Plugin description.</description>
<update> <!-- Runs on update; New in 1.6 -->
<schemas>
<schemapath type="mysql">sql/updates/mysql</schemapath>
</schemas>
</update>
<!-- Site Main File Copy Section -->
<!-- Note the folder attribute: This attribute describes the folder
to copy FROM in the package to install therefore files copied
in this section are copied from /site/ in the package -->
<files folder="site">
<filename>plgName.xml</filename>
<filename>plgName.php</filename>
<folder>helpers</folder>
</files>
</extension>
This gives me nothing really. I can't find the folder I shouldhave been created from what I gathered from the documentation. It also doesn't specifies how I populate these folder :(. I am assuming that it is possible to more or less just package all files I want and then it will create the subfolders where I want/need them. But that it is a question of how to write the manifest file. If anyone have a good tutorial about this I would be very thankful :). I've googled until my fingers are almost at the Point of bleeding :(. I guess I could put all the files in the same folder, but I want to have some sort of structure to visualize for other developers what's part of the core of the plugin and what's not part of the plugin core.
Problem is solved. In my not installation script I linked in the files for what I thought only was used by the configuration XML (a field to configurate the plugin). In this file I had the node "files" as well, in this node I'd not linked in the helpers directory. When this was done all the subdirectories was added as well. So in short - Don't forget to link in the folder in all places where you have a files-node.

How i can use yeoman to work with Sass files?

I try to use yeoman to compile a styles.sass file founded in app/styles directory.
In my index.html i write :
<!-- build:css(.tmp/styles) styles/styles.css -->
<link rel="stylesheet" href="styles/style.sass" />
<!-- endbuild -->
When i launch grunt server
Sass file is watched and compiled into
.tmp/styles/
But in my dist/styles directory, nothing is written in my xxxxxxx.styles.css
may i miss something?
Your Sass is compiled into .tmp/styles when running grunt server, since it's only temporary. This is done so not to create a mess of compiled CSS files in your app directory. When you run grunt it will compile it to the dist/styles folder.

Resources