0

I'm trying to create basic spring web dynamic project.
Given below is spring libraries list.
enter image description here

And this is my HelloWeb-servlet.xml code.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_4.0.xsd"
       bean-discovery-mode="annotated">
    <context:component-scan base-package = "com.tutorialspoint" />
    <bean class = "org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name = "prefix" value = "/WEB-INF/jsp/" />
        <property name = "suffix" value = ".jsp" />
    </bean>
</beans>


And here is my project structure. enter image description here

Please help me. Thank you.

Dil.
  • 1,996
  • 7
  • 41
  • 68
  • the xmlns looks strange, usually it's something different see https://stackoverflow.com/questions/17822466/spring-beans-dtd-and-xmlns for example –  Oct 19 '17 at 05:54
  • @RC WHAT should I change there – Dil. Oct 19 '17 at 05:54

1 Answers1

0

I have modified HelloWeb-servlet.xml to this.

<beans xmlns = "http://www.springframework.org/schema/beans"
   xmlns:context = "http://www.springframework.org/schema/context"
   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-4.0.xsd
   http://www.springframework.org/schema/context 
   http://www.springframework.org/schema/context/spring-context-4.0.xsd">

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

   <bean class = "org.springframework.web.servlet.view.InternalResourceViewResolver">
      <property name = "prefix" value = "/WEB-INF/jsp/" />
      <property name = "suffix" value = ".jsp" />
   </bean>

</beans>

Its working now.

Dil.
  • 1,996
  • 7
  • 41
  • 68