i haven’t coded J2EE since 2000, things have certainly changed. i have a project that is mostly JSP’s, yet i need to have a servlet so that its Init() method can be used to instanciate several static variables that will be used throughout the JSPs.
my simplest example is a Web Project where i’ve added a servlet (into /src). i see the entry in my web.xml….
<web-app version=”2.5″
xmlns=”http://java.sun.com/xml/ns/javaee”
xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”
xsi:schemaLocation=”http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd”>
<servlet>
<description>yyyyyyyy</description>
<display-name>xxxxxxx</display-name>
<servlet-name>myServlet</servlet-name>
<servlet-class>testweb.myServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>myServlet</servlet-name>
<url-pattern>/servlet/myServlet</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
when i either run or debug the app, i get the default JSP (index.jsp) displayed, but my breakpoints in “myServlet” are never reached. i’m sure this is configurable, but i cannot find an example.
can anyone point me to the right way to do this??? thanks in advance…..