genericservletクラスを継承してservletを実現するプログラム

javaコード下記:

package com.startnews24.servlet;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.GenericServlet;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

@SuppressWarnings(“serial")
public class Startnews24GenericServlet extends GenericServlet {

@Override
public void service(ServletRequest request, ServletResponse response)
throws ServletException, IOException {
// TODO Auto-generated method stub
try{
PrintWriter printWriter=response.getWriter();
printWriter.println(“<h1>東京 成功 .!!!</h1>");
}catch(Exception e){
e.printStackTrace();
}
}

}

Java

Posted by arkgame