The report shows:
1. Need the source for java.net.URLEncoder.encode and
java.net.URLEncoder.encode(Unknown Source)
2. Need this to work:
net.tanesha.recaptcha.ReCaptchaImpl.checkAnswer(ReCaptchaImpl.java:63)
3. The captcha method is added in this servlet:
com.Controllers.AddNewServlet.processRequest(AddNewServlet.java:52)
4. doPost is connected to the processRequest method in the servlet:
com.Controllers.AddNewServlet.doPost(AddNewServlet.java:72)
5. Related errors: javax.servlet.http.HttpServlet.service(HttpServlet.java:646),
javax.servlet.http.HttpServlet.service(HttpServlet.java:727),
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
I pasted the code for reCaptcha on a method in my servlet like this:
AddNewServlet.java,
protected void processRequest(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {
Employee emp = new Employee();
emp.setEmpId(Integer.parseInt(request.getParameter("empId")));
emp.setName(request.getParameter("empName"));
emp.setPhone(request.getParameter("phone"));
emp.setEmail(request.getParameter("email"));
emp.setSalary(Float.parseFloat(request.getParameter("salary")));
emp.setDesignation(request.getParameter("designation"));
EmployeeBean eb = new EmployeeBean();
eb.addNew(emp);
// response.sendRedirect("empView.jsp");
// create recaptcha without <noscript> tags
ReCaptcha captcha = ReCaptchaFactory.newReCaptcha("6Lct4AETAAAAAEli1aSo3ywkzorqd2Trm-expILj", "6Lct4AETAAAAAPW4aGJ7HioFcbA_kxwOqEK9L8v6", false);
String captchaScript = captcha.createRecaptchaHtml(request.getParameter("error"), null);
System.out.print(captchaScript);
ReCaptchaResponse RspCap = captcha.checkAnswer(request.getRemoteAddr(), request.getParameter("/empAddNew.jsp"), request.getParameter("/empView.jsp"));
if (RspCap.isValid()) {
response.sendRedirect("empView.jsp");
}
else {
System.out.println("You're out of my machine!");
}
}
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
Original issue reported on code.google.com by kitade96...@gmail.com on 12 Feb 2015 at 11:15
Original issue reported on code.google.com by
kitade96...@gmail.com
on 12 Feb 2015 at 11:15