Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Divya-021 authored Dec 26, 2023
1 parent 916543c commit 6c5c9fe
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
Binary file added Servlet/Servlet_Demo/build/classes/MyServlet.class
Binary file not shown.
20 changes: 20 additions & 0 deletions Servlet/Servlet_Demo/src/main/java/MyServlet.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class MyServlet extends HttpServlet {

@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
// TODO Auto-generated method stub
PrintWriter out= resp.getWriter();
out.print("servlet in doGet()");
System.out.println("Servlet in doGet method");
}

}
3 changes: 3 additions & 0 deletions Servlet/Servlet_Demo/src/main/webapp/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Class-Path:

20 changes: 20 additions & 0 deletions Servlet/Servlet_Demo/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" id="WebApp_ID" version="4.0">
<display-name>Servlet_Demo</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.jsp</welcome-file>
<welcome-file>default.htm</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name> myservlet</servlet-name>
<servlet-class> MyServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name> myservlet</servlet-name>
<url-pattern>/aaa</url-pattern>
</servlet-mapping>
</web-app>

0 comments on commit 6c5c9fe

Please sign in to comment.