mardi 27 janvier 2015

Befuddled Servlet

Is the code not correct? ( This is a test method for the begging of a new build. ) I have been debugging for a while and do not see why this servlet code is not being deployed to the jsp page. The console pulls form the DB just fine. The Business Logic Method, getData, ought to be coming through the servlet to the JSP.



public class WireServlet extends HttpServlet {



@Override
protected void doGet(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {
// processRequest(request, response);

getData(request);

request.getRequestDispatcher("./index.jsp").forward(request, response);
}


@Override
protected void doPost(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {
// processRequest(request, response);

getData(request);

request.getRequestDispatcher("./index.jsp").forward(request, response);
}


@Override
public String getServletInfo() {
return "Short description";
}// </editor-fold>

public void getData(HttpServletRequest request){


WireBLL wire = new WireBLL();
String to_Screen = wire.getData();

StringBuilder aloha = new StringBuilder(100);
aloha.append("<p>").append(to_Screen).append("</p>");

request.setAttribute("aloha", aloha );

}

}//END Servlet




Aucun commentaire:

Enregistrer un commentaire