I am new to Maven. Now, in my POM, I declared I need Spring 3.0.5.RELEASE. After I started my server and tried to access a page, the server threw a java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.Config error.
Now after researching online, I found that I need to include a JSTL dependency like so:
<dependency>
<groupId>jstl</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
I have faced this question multiple times. How do I know which version of jstl is comptabile with Spring 3.0.5.RELEASE
I know this might be a basic question but it will help everyone
You could also try generating a Spring Boot Maven project via http://start.spring.io/ rather then manually setting one up.
Related
In the Kotlin Spring Boot tutorial it asks you to include the web dependency, like this:
but in the actual Spring Boot initializr, I don't see that:
What's the web dependency that's required? Is it Spring Web Starter? Is this tutorial out of date and/or obsolete?
spring web starter is the one you need to select it's what they refer to in the tutorial.
its the full name for it.
if you look in the tutorial they later show the pom.xml There you can see that they have declared the:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
and the tuturial still seems okey so go for it.
Which's the difference between
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-mongodb</artifactId>
</dependency>
and,
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-mongodb</artifactId>
</dependency>
I'm developing an spring boot service.
spring-boot-starter-data-mongodb contains configuration classes for Spring Boot. It also includes the spring-data-mongodb library so you would only need to include the start in your boot app:
https://search.maven.org/artifact/org.springframework.boot/spring-boot-starter-data-mongodb/2.0.5.RELEASE/jar
spring-boot-starter-data-mongodb is a spring boot starter pom. For more information on starters:
spring-boot-starters
Dependency management is a critical aspects of any complex project. And doing this manually is less than ideal; the more time you spent on it the less time you have on the other important aspects of the project.
Spring Boot starters were built to address exactly this problem. Starter POMs are a set of convenient dependency descriptors that you can include in your application. You get a one-stop-shop for all the Spring and related technology that you need, without having to hunt through sample code and copy paste loads of dependency descriptors.
ive tried the spring REST tutorial and i also got a simple JSF application (running on glassfish), both projects are maven based and i would like to "combine" them.
Meaning, putting the REST project jar into the JSF project.
Does that make sense?
The JSF page should send a request to the microservice REST project when it starts and display the result.
the REST project uses spring-boot and therefore tomcat.
this pom.xml is supposed to use glassfish instead of tomcat, at least thats what the author tells on a spring blog.
Theres a part in it:
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
That says to "exclude" tomcat - which is fine, but how does maven or spring know to use glassfish instead?
Is there maybe a better way to combine these two projects?
I would like to keep the projects seperate because of the dependencys in the pom.xml.
Answer #1 in this question solves the confusion:
Using JSF as view technology of Spring MVC
spring mvc and jsf are rivals.
Using IntelliJ IDEA 13.1.4 to create a new project with Spring MVC and "Create project from template" checked, I get the error message below in the project structure.
Anyone know why, and whether I should worry about it?
Module 'Test': invalid item 'Maven: org.springframework:spring-test-mvc:1.0.0.M2' in the dependencies list
Hmm... What version of Spring is the template project using?
From Spring 3.2 and onwards the spring-test-mvc dependency was merged into spring-test dependency.
So for anything using Spring 3.2 onwards you only need:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
Also, It might be worth looking at the Spring platform-bom
I have the following maven dependecy in my project.
<dependency>
<groupId>org.jvnet.jax-ws-commons.spring</groupId>
<artifactId>jaxws-spring</artifactId>
<version>1.8</version>
</dependency>
Question:
Is this Spring Webservices project?
If not what this dependency is for?
Thanks for your help.
It's a project combining JAX-WS and Spring. Basically it gives you the wss namespace that you might be using in your application context to expose JAX-WS providers as web services. It isn't mandatory but it can be a convenience as it allows you to easily have dependency injection in your servlets although there are other ways to get this. Unfortunately, the last time I was using it I noticed that it was depending on some pretty old spring libraries (pre 3.x) and didn't seem to be updated in some time.