Specifya target parameter for a servlet application
<p>I just starting learning about servlets yersterday so I'm a newbie. I read a tutorial and made the following program to track the use of a link:</p>

<pre><code>package red;

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

@WebServlet("/Redirection")
public class Redirection extends HttpServlet {
    private static final long serialVersionUID = 1L;
    private String referrer;
    private String target;

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        try {
            getURLs(request);
        }
        catch(Exception e)
        {
            response.sendError(500, "Target parameter not specified");
            return;
        }
        response.sendRedirect(target);
    }

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        this.doGet(request, response);
    }

    public void getURLs(HttpServletRequest request)
    {
        referrer = request.getParameter("referrer");
        if(referrer == null || 0 == referrer.length())
        {
            referrer = new String("");
        }

        target = request.getParameter("target");
        if(target == null || target.equals(""))
        {
            throw new IllegalArgumentException();
        }
    }
}
</code></pre>

<p>But when I teste it(Eclipse with Tomcat) i get this:</p>

<pre><code>HTTP Status 500 - Target parameter not specified
</code></pre>

<p>How do I specify a target parameter in eclipse so I can run this program ?  </p>

<p>Sorry for the beginner question.</p>
