Server Technology PPNT Instrukcja Użytkownika Strona 60

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 95
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 59
Java Servlets: Hello World(1/5)
Example: Hello World!
...
public void doGet(HttpServletRequest re ques t, HttpServletResponse response)
throws ServletException, IOException{
String hello = "Hello World";
response.setContentType("text/html");
PrintWriter writer = response.getWriter ();
writer.println("<html>");
writer.println("\t<head>");
writer.println(
"\t\t<link rel = \"stylesheet\" typ e = \"text/css\" href = \"style.css\ ">");
writer.println("\t\t<title>" + hello + "</title>");
writer.println("\t</head>");
writer.println("\t<body>");
writer.println(hello + " (" + ( new Date()) + ")");
writer.println("\t</body>");
writer.println("</html>");
}
...
(60/95)
Przeglądanie stron 59
1 2 ... 55 56 57 58 59 60 61 62 63 64 65 ... 94 95

Komentarze do niniejszej Instrukcji

Brak uwag