import javax.servlet.*; import javax.servlet.http.*; import java.util.StringTokenizer; import java.io.*; public class ServletGet1 extends HttpServlet{ public void doGet(HttpServletRequest kysimus, HttpServletResponse vastus) throws IOException, ServletException{ vastus.setContentType("text/html"); PrintWriter valja=new PrintWriter(vastus.getWriter()); valja.println( "Edastati info: "+kysimus.getQueryString()+"
\n"+ "Ühendus tuli masinast "+kysimus.getRemoteHost()+"
\n"+ "Selle masina number on "+kysimus.getRemoteAddr()+"

\n" ); StringTokenizer stk=new StringTokenizer(kysimus.getQueryString(), "&"); while(stk.hasMoreTokens()){ valja.println(stk.nextToken()+"
\n"); } } }