The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. Error when starting app

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



The origin server did not find a current representation for the target resource or is not willing to disclose that one exists. Error when starting app




package controller;

import domain.PersonService;
import domain.ProductService;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

@WebServlet("/Controller")
public class Controller extends HttpServlet
private static final long serialVersionUID = 1L;

private PersonService model = new PersonService();
private ProductService productModel = new ProductService();
private ControllerFactory controllerFactory = new ControllerFactory();
private BlogServer server = new BlogServer(model);

public Controller()
super();


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


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


protected void processRequest(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException
RequestHandler handler = null;
String action = request.getParameter("action");
String destination = "index.jsp";
if (action != null)
try
handler = controllerFactory.getController(action, model, productModel, server);
destination = handler.handleRequest(request, response);

catch (NotAuthorizedException exc)
List<String> errors = new ArrayList<String>();
errors.add(exc.getMessage());
request.setAttribute("errors", errors);
destination="index.jsp";


if(handler != null && handler instanceof ASyncRequestHandler)

response.setContentType("application/JSON");
response.getWriter().write(destination);
else
RequestDispatcher view = request.getRequestDispatcher(destination);
view.forward(request, response);




When i run my application i get the error:



The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.



My welcome file is set on the Controller.



Controller





Controller





Can somebody help me? I think that there is something going wrong in the Controller class but i don't know what.





You will have to provide some code as well as compile/debug errors, this is vague and leaves those that would help you guessing.
– Wookies-Will-Code
Aug 10 at 15:56





What parts of the code?
– Tilou
Aug 10 at 16:07





The controller is already posted, i think the problem is there
– Tilou
Aug 10 at 16:09





Post code as text, not as images.
– JB Nizet
Aug 10 at 16:13





Somebody has an answer?
– Tilou
Aug 10 at 17:29









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

How to determine optimal route across keyboard