SHARE
TWEET

Untitled

a guest Jun 26th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @Controller
  2. public class AddController {
  3. @RequestMapping("/add")
  4. public void add()
  5. {
  6.   System.out.println( "I am here");
  7. }
  8.      
  9. <ctx:annotation-config/>
  10. <ctx:component-scan base-package="com.hp.demomvc.*">
  11. </ctx:component- scan>
  12. <bean id = "viewResolver"
  13. class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  14.  
  15. <property name = "prefix" value = "/WEB-INF/views/"/>
  16. <property name = "suffix" value = ".jsp"/>
  17.  
  18. </bean>
  19. <mvc:default-servlet-handler/>
  20.      
  21. <dependency>
  22.     <groupId>junit</groupId>
  23.     <artifactId>junit</artifactId>
  24.     <version>3.8.1</version>
  25.     <scope>test</scope>
  26. </dependency>
  27. <dependency>
  28.      <groupId>org.springframework</groupId>
  29.      <artifactId>spring-context</artifactId>
  30.      <version>4.1.8.RELEASE</version>
  31. </dependency>
  32.  
  33. <dependency>
  34.     <groupId>org.springframework</groupId>
  35.     <artifactId>spring-webmvc</artifactId>
  36.     <version>4.1.8.RELEASE</version>
  37. </dependency>
  38. <dependency>
  39.     <groupId>mysql</groupId>
  40.     <artifactId>mysql-connector-java</artifactId>
  41.     <version>5.1.36</version>
  42. </dependency>
  43. <dependency>
  44.     <groupId>javax.servlet</groupId>
  45.     <artifactId>jstl</artifactId>
  46.     <version>1.2</version>
  47. </dependency>
  48.      
  49. <web-app>
  50. <display-name>Archetype Created Web Application</display-name>
  51. <servlet>
  52.     <servlet-name>hp</servlet-name>
  53.     <servlet-class>
  54.         org.springframework.web.servlet.DispatcherServlet
  55.     </servlet-class>
  56. </servlet>
  57. <servlet-mapping>
  58.     <servlet-name>hp</servlet-name>
  59.     <url-pattern>/</url-pattern>
  60. </servlet-mapping>
  61. </web-app>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top