Why do I need the prefix "batch:" in my spring beans
batch is an alias in your XML file for the http://www.springframework.org/schema/batch namespace. You will have something similar at the beginning of your XML:
xmlns:batch="http://www.springframework.org/schema/batch" This means that whenever you prefix an element with batch: you indicate that this element is the one that defines Spring. This is necessary to eliminate possible ambiguities (there may be other structures around the definition of the <job> element).
You can define a default namespace for all elements in the XML document, so if the namespace does not have prefixes, it will be the one the ad refers to. This default namespace is defined by the xmlns="..." attribute and is usually assigned to the http://www.springframework.org/schema/beans namespace (where the <beans> element and many other basic types are located).
You can:
1) Change batch to something shorter, like b if you want to clear
<beans ... xmlns:b="http://www.springframework.org/schema/batch"> ... <b:job></b:job> ... </beans> 2) Make the batch default namespace (with xmlns="http://www.springframework.org/schema/batch" ) and use the beans namespace and others, if necessary. You can even declare all your package elements in a separate XML file with this default namespace, and <beans:import> in the main applicationContext.xml .
<beans:beans xmlns="http://www.springframework.org/schema/batch" xmlns:beans="http://www.springframework.org/schema/beans"> <job>...</job> <job>...</job> </beans:beans>