reset password
Author Message
hibbol
Posts: 20
Posted 14:34 Oct 13, 2010 |

In Servlet and JSP Code examples,

when you run this project, there is a link for GuestBook (MVC). My question is how can you access to this servlet page even though "GuestBookMVC" doesn't exist. It seems like it goes to "GuestBook.java" servlet first when I click the link.

Phobe
Posts: 40
Posted 21:10 Oct 13, 2010 |

You can map any servlet to any path by editing the web.xml file. If you have a look at it you'll see these lines... I think it will be apparent when you have a look at it.

  <servlet>
    <description></description>
    <display-name>GuestBookMVC</display-name>
    <servlet-name>GuestBookMVC</servlet-name>
    <servlet-class>cs520.review.controller.GuestBook</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>GuestBookMVC</servlet-name>
    <url-pattern>/GuestBookMVC</url-pattern>
  </servlet-mapping>