<commit_before>	
package gluewine.servlets;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.Date;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.gluewine.jetty.GluewineServlet;

public class TestServlets2 extends GluewineServlet {

		@Override
		public String getContextPath() {
			return "TestServlet2";
		}
		public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException
		{
			final long now = new Date().getTime();
	        resp.setDateHeader("Date", now);
	        resp.setDateHeader("Expires", now);

	        resp.setContentType("text/html");
	        StringBuilder b = new StringBuilder("<HTML><HEAD>");
	        b.append("<TITLE>Gluewine framework</TITLE>");
	        b.append("</HEAD>");
	        //
	        b.append("<H1>Welcome to the Gluewine framework.</H1>");
	        b.append("<p>Please fill in your credentials in the form below: </p>");
	        b.append("<form action='TestServlet2' method='POST'>");
	        b.append("<label for='firstname'>FirstName:</label>");
	        b.append("<input type='text' name='firstname'/>");
	        b.append("</br><label for='lastname'>LastName:</label>");
	        b.append("<input type='text' name='lastname'/>");
	        b.append("</br><input type='submit' value='submit' name='submit'/>");
	        b.append("</form>");

	        b.append("</HEAD>");
	        resp.setContentLength(b.length());
	        try
	        {
	            resp.getWriter().println(b.toString());
	        }<commit_msg>Added comments to servlet example<commit_after>	
package gluewine.servlets;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.Date;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.gluewine.jetty.GluewineServlet;

public class TestServlets2 extends GluewineServlet {

	/*
	 * (non-Javadoc)
	 * @see org.gluewine.jetty.GluewineServlet#getContextPath()
	 * 
	 * To use this method in the browser, we will need to address the following link:
	 * 
	 * http://localhost:portnumber/TestServlet
	 * 
	 * We define this link in the method getContextPath()
	 */
		@Override
		public String getContextPath() {
			return "TestServlet2";
		}
		public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException
		{
			final long now = new Date().getTime();
	        resp.setDateHeader("Date", now);
	        resp.setDateHeader("Expires", now);

	        resp.setContentType("text/html");
	        StringBuilder b = new StringBuilder("<HTML><HEAD>");
	        b.append("<TITLE>Gluewine framework</TITLE>");
	        b.append("</HEAD>");
	        //
	        b.append("<H1>Welcome to the Gluewine framework.</H1>");
	        b.append("<p>Please fill in your credentials in the form below: </p>");
	        b.append("<form action='TestServlet2' method='POST'>");
	        b.append("<label for='firstname'>FirstName:</label>");
	        b.append("<input type='text' name='firstname'/>");
	        b.append("</br><label for='lastname'>LastName:</label>");
	        b.append("<input type='text' name='lastname'/>");
	        b.append("</br><input type='submit' value='submit' name='submit'/>");
	        b.append("</form>");

	        b.append("</HEAD>");
	        resp.setContentLength(b.length());
	        try
	        {
	            resp.getWriter().println(b.toString());
	        }
{'fraction_non_alphanumeric': 0.15924308588064046, 'fraction_numerical': 0.002911208151382824, 'mean_word_length': 3.164848484848485, 'pattern_counts': {'":': 0, '<': 45, '<?xml version=': 0, '>': 45, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4507581', 'n_tokens_mistral': 1091, 'n_tokens_neox': 995, 'n_words': 207}