error:Could not open ServletContext resource [/WEB-INF/spring-servlet.xml the spring-servlet.xml file is create under web-inf/lib folder<context:component-scan base-package="com.dz.hrportal.controller" />
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basename" value="classpath:messages"/>
<property name="defaultEncoding" value="UTF-8"/>
</bean>
<bean id="localeChangeInterceptor"
class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
<property name="paramName" value="lang" />
</bean>
<bean id="localeResolver"
class="org.springframework.web.servlet.i18n.CookieLocaleResolver">
<property name="defaultLocale" value="en"/>
</bean>
<bean id="handlerMapping"
class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
<property name="interceptors">
<ref bean="localeChangeInterceptor" />
</property>
</bean>*/
我已經經歷了這個代碼10次仍然面臨同樣的錯誤。 spring-servlet.xml文件的名稱與映射時的spring中web.xml文件中提到的名稱相同。ServletContext文件未找到服務器
檢查這個http://stackoverflow.com/questions/6035464/could-not-open-servletcontext-resource – Rohan
其實性文件在SRC folder.I那上述代碼符合一個問題。 – Datts
現在servlet拋出load()異常,我認爲這個錯誤是因爲spring version3.0和我使用的是MyEclipse 5.1,這是一個問題嗎?schemalocation是:http://www.springframework.org/schema/beans/ spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd「> – Datts