context:component-scan is not bound

context:component-scan is not bound ,, hmmmm what what ,, kan mau pindah ke spring annotaion kq gtu

Bismillah

q> gogling bentar , ketemu soal xmlns, xmlns:context=”http://www.springframework.org/schema/context”

tambahkan deklarasi xmlns:context=”http://www.springframework.org/schema/context” pada tag beans (lihat konfigurasi spring untuk annotation di bawah)

q> pada spring annotation baris ini harus disertakan (pada file applicationContext.xml)

<context:component-scan base-package="com.ipi.zk652" />

yang berfungsi untuk melakukan scanning / register bean atau component pada aplikasi kepada spring.

q> applicationContext.xml untuk spring xml ( bukan annotation)


<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-2.5.xsd">

</beans>

q> applicationContext.xml untuk spring annotation


<beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:context="http://www.springframework.org/schema/context"
 xsi:schemaLocation="http://www.springframework.org/schema/beans
 http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
 http://www.springframework.org/schema/context
 http://www.springframework.org/schema/context/spring-context-2.5.xsd">

 <context:component-scan base-package="com.ipi.zk652" />

</beans>

 

Alhamdulillah

 

Published by

saifiahmada

Begin a big Process with a bit trying

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s