servlets

Connect to a HTTPS secure website and ping the latency

萝らか妹 提交于 2019-12-25 03:28:09
问题 My code currently tries to ping a URL the user provide. It works fine with non-HTTPS websites. But if I try with something like: https://www.httpsnow.org/ I get an exception: Could not establish connection. Error is: 'sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target' Code below: try { long startTime = DateProvider.getCurrentTimeMillis(); huc =

Connect to a HTTPS secure website and ping the latency

為{幸葍}努か 提交于 2019-12-25 03:28:08
问题 My code currently tries to ping a URL the user provide. It works fine with non-HTTPS websites. But if I try with something like: https://www.httpsnow.org/ I get an exception: Could not establish connection. Error is: 'sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target' Code below: try { long startTime = DateProvider.getCurrentTimeMillis(); huc =

Parameters cannot be resolved in servlets

女生的网名这么多〃 提交于 2019-12-25 03:14:29
问题 I am tryin to get the credentials from jsp page-index.jsp In my servlet-LoginServletwhen under package dao i use String userName = request.getParameter(usrnm_gtalk); String password = request.getParameter(password_gtalk); it says usrnm_gtalk and password_gtalk cannot be resolved. in my jsp <form name="LoginForm" method="post" action="/dao/LoginServlet> <input type="text" name="usrnm_gtalk"/> <input type="password" name="password_gtalk" /> web.xml <welcome-file-list> <welcome-file>index.jsp<

how to get data from servlet to ajax success [duplicate]

徘徊边缘 提交于 2019-12-25 02:57:47
问题 This question already has answers here : How to use Servlets and Ajax? (7 answers) Closed 3 years ago . I am trying to get data from servlet to ajax in post but it always go to error part that saying like "undefined" am new to ajax kinldy help on this. Insert part working good but am trying to fetch value to go error part?? servlet package Servlet; import java.io.IOException; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException

tomcat 8 jsp javax.servlet.ServletException

偶尔善良 提交于 2019-12-25 02:55:29
问题 I dont understand this error 500 and cookie problem, hoping someone can inlight me. When i run my requestDispatcher i get an internal erro 500 that i cant figure out. The ressource is /WEB-INF/jsp/index.jsp but in the error message it says /WEB-INF/jsp/cookie??? The error message HTTP Status 500 - javax.servlet.ServletException: javax.servlet.jsp.JspException: java.io.FileNotFoundException: The requested resource (/MyNewRandomBlog1.0/WEB-INF/jsp/{cookie=JSESSIONID

http status 500- null pointer Exception only on google chrome

微笑、不失礼 提交于 2019-12-25 02:19:53
问题 I am using tomcat 7 and net beans IDE 7.3.1 for my project. My servlet program is working fine on Mozilla Firefox and Internet Explorer.but when i m running it on Google chrome it shows following error. HTTP Status 500 - type Exception report message description The server encountered an internal error that prevented it from fulfilling this request. exception java.lang.NullPointerException Controller.CreateQuestion.doPost(CreateQuestion.java:200) javax.servlet.http.HttpServlet.service

generate a chart from a controller

折月煮酒 提交于 2019-12-25 02:17:02
问题 i use spring 3.0, in a jsp, i try to display data and a chart... @Controller @RequestMapping("/user.htm") public class UserController { @Autowired private IUserService userService; @RequestMapping(method = RequestMethod.GET) public ModelAndView user(HttpServletRequest request, HttpServletResponse response) { ModelAndView modelAndView = new ModelAndView("user"); modelAndView.addObject("statUser", userService.getStatUser()); return modelAndView; } public void generateChart(HttpServletRequest

Servlet .jar Dependency Null Pointer

纵然是瞬间 提交于 2019-12-25 02:16:31
问题 I am getting a seemingly inexplicable nullPointerException from a .jar file that is listed in the classpath as an export dependency. The jar file consists of a database bean that works flawlessly when it is called inside of a normal main method POJO, but when I called the same jar file in a servlet, I get null pointers from the con.prepareStatement of whatever I call. I thought that it might be a SQLException from the pool causing it, so I moved it to our VM server where it can talk directly

unable to retrieve the passed value from jsp to controller using url via a button

北城余情 提交于 2019-12-25 02:13:30
问题 I am assigning href to a button and passing a value to the controller JSP page <td><a href="viewController?book_id=<%=vo.getBookId()%>"><input type="button" name="remove" value="DELETE"/></a> </td> In controller, I am trying to get the value when the button is clicked using: if(request.getParameter("remove") !=null) { int cart_id=(Integer)request.getSession(false).getAttribute("cartid"); b_id = (String) request.getParameter("book_id"); int bid=Integer.parseInt(b_id); System.out.println(bid);

Transferring data from servlet to jsp page

耗尽温柔 提交于 2019-12-25 02:13:29
问题 I would like to get rid of the printWriter code in the servlet. Basically I want to output the current customers and their respective cities with the id which is a hidden field on the index page. From there I would like to be able to edit the customer name or city and then have it sent back to the index page where the information would be updated. How do I do this? Servlet package edu.witc.Assignment02.controller; import java.io.IOException; import java.io.PrintWriter; import java.util