Hi all,
I'm trying to make the controller servlet mapping work in Model 2
architecture,to get the Action class from a hashtable.

Here is what I have done.

In a JSP file:
<form name="shoppingForm"
   action="/musicshop/servlet/ShoppingServlet/MainJSP.do"
   method="POST">

In web.xml of the application (using Tomcat):

   <servlet-mapping>
        <servlet-name>ShoppingServlet</servlet-name>
        <url-pattern>*.do</url-pattern>
    </servlet-mapping>


In the controller servlet:

        String matchPart = req.getServletPath();
        System.out.print("Value before truncating: ");
        System.out.println(matchPart);
        int extension = matchPart.indexOf(".");
        if (extension >= 0)
           matchPart=matchPart.substring(0, extension);


What I get in getServletPath() is /servlet/ShoppingServlet.
What am I doing wrong here?
Thanks,
Sanjay

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at
http://profiles.msn.com.

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to