i have
project folder name: website_test
package name: hello_servet
testing_01.java
web.xml
index.html

i need help with servlet name. i think iam names wrong. for ex is servlet-name the class name or project folder name??
web.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">

  <servlet>
    <servlet-name>website_test</servlet-name>
    <servlet-class>hello_servet.testing_01</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>website_test</servlet-name>
    <url-pattern>/website_test</url-pattern>
  </servlet-mapping>

</web-app>
Member Avatar for LastMitch

@hwoarang69

i need help with servlet name. i think iam names wrong. for ex is servlet-name the class name or project folder name??

This is your code:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" 
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"id="WebApp_ID" version="3.0">

<servlet>
<servlet-name>website_test</servlet-name>
<servlet-class>hello_servet.testing_01</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>website_test</servlet-name>
<url-pattern>/website_test</url-pattern>
</servlet-mapping>

You're missing some info here. How does the package controller looks like?

I mean you wrote this code.

In order to write it you have to look at your package controller code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.