I've seen a lot of examples which use
http://www.springframework.org/schem...-beans-3.2.xsd
as their namespace for beans. I can't access this location though so my question is : how to update to use the new directives ?
Mike
I've seen a lot of examples which use
http://www.springframework.org/schem...-beans-3.2.xsd
as their namespace for beans. I can't access this location though so my question is : how to update to use the new directives ?
Mike
I doubt thatas Spring 3.2 isn't final yet so t here isn't an xsd for it (yet)...
Also when you have the correct spring jars spring will load the xsd from jar files so if you use Spring 3.2 RC1 it will be loaded for you (still might be that IDE's give you some trouble).
Marten Deinum
Java Consultant / Pragmatist / Open Source Enthousiast / Author
Pro Spring MVC: With Web Flow
Conspect
Have you read the reference guide.
Use the [ code ] tags, young padawan
No... You can simply use the 3.2 xsd... (It is adviced to use the versionless xsd btw which should always point to the most recent version which is on your classpath).You suggest that, provided I have the spring jars on the cp (I do), that I can use new 3.2 directives with the 3.1 schema set in the namespace ?
Marten Deinum
Java Consultant / Pragmatist / Open Source Enthousiast / Author
Pro Spring MVC: With Web Flow
Conspect
Have you read the reference guide.
Use the [ code ] tags, young padawan
Ah ok.
So you suggest
Should work, butCode:<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd">
Is preferred. Is there some configuration needed to make this work correctly in STS ? Starting with the first option will cause runtime errorsCode:<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
Sorry I dont mean to turn this into a debug session, so if you can point me to the relevant documentation in code that would also be fine.Code:Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.
Cheers,
Mike.
It depends on your STS version... The newest version should detect the xsd files in the jar files (if the correct tooling files are in the spring jar files that is). IN older versions you would need to add them to the catalog yourselves.
If you get runtime errors there is something wrong with your deployment/build. Check the jars that get packaged with your application make sure that you don't mix spring versions. Also be aware that 3.2 isn't final it is still in development!
Marten Deinum
Java Consultant / Pragmatist / Open Source Enthousiast / Author
Pro Spring MVC: With Web Flow
Conspect
Have you read the reference guide.
Use the [ code ] tags, young padawan