Posts

Showing posts with the label servlets

How do i get input value to jquery in JSP?

Image
Clash Royale CLAN TAG #URR8PPP How do i get input value to jquery in JSP? I am doing a calendar where users are required to select multiple dates which are checkboxes. As they check each box, the counter will increase. For them to select the values on the next month, they would have to go through a submit button and the counter will be stored in a session in the servlet and it will bring them back to the same JSP page (if they did not select the maximum number of dates) retrieved using session as well. However, my problem is whenever they go onto the next month, the counter will be set back to 0 but the value does show the number of checked boxes previously when I <%System.out.println("class taken="+session.getAttribute("selectedClass")); %> <%System.out.println("class taken="+session.getAttribute("selectedClass")); %> Input value (JSP): No of Classes selected: <b><input type="text" id="count-class" name=...

Setting Up Fine Uploader using Java

Image
Clash Royale CLAN TAG #URR8PPP Setting Up Fine Uploader using Java how to set up an endpoint in Fine Uploader using java and servlet? how to set up an endpoint in Fine Uploader using java and servlet? – Christophe Resurreccion 18 mins ago 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.

Java ee api rest error: java.lang.IllegalArgumentException

Image
Clash Royale CLAN TAG #URR8PPP Java ee api rest error: java.lang.IllegalArgumentException I'm creating a api rest with Tomcat 7.0 + Maven + Java EE + JDK 10.0.2 in eclipse and I got this error: Error: HTTP Status 500 - Servlet.init() for servlet api threw exception type Exception report message Servlet.init() for servlet api threw exception description The server encountered an internal error that prevented it from fulfilling this request. exception javax.servlet.ServletException: Servlet.init() for servlet api threw exception org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1041) org.apache.coyote.AbstractP...

Tomcat Apache ServiceMix integration issue

Image
Clash Royale CLAN TAG #URR8PPP Tomcat Apache ServiceMix integration issue We are trying to integrate a web application running on Apache Tomcat 8.5.3 with Apache ServiceMix 7.0.1 using Apache Felix bridge (org.apache.felix.http.bridge-4.0.0.jar). All the steps listed here are done http://felix.apache.org/documentation/subprojects/apache-felix-http-service.html But we are now getting a 503 Service unavailable error. On debugging, we identified that this error is thrown via org.apache.felix.http.proxy.ProxyServlet (org.apache.felix.http.proxy-3.0.2.jar) final HttpServlet dispatcher = this.tracker.getDispatcher(); if (dispatcher != null) { final HttpServletRequest r = (this.servletContext == null ? req : new BridgeHttpServletRequest(req, this.servletContext)); dispatcher.service(r, res); } else { res.sendError(HttpServletResponse.SC_SERVICE_UNAVAILABLE); } Now the reason 'dispatcher' is null because in tracker (org.apache.felix.http.proxy.DispatcherTracker), it is not ...

How do i store getParameterValues(“”) into an Array List using for loop in Servlet?

Image
Clash Royale CLAN TAG #URR8PPP How do i store getParameterValues(“”) into an Array List using for loop in Servlet? There is a for loop to display the days on my "calendar" and users are able to select multiple days, as there will be a checkbox beside each day as shown below. JSP: <td class="day_cell"> <%=days[i][j]%> <input type="checkbox" value="<%=days[i][j]%>/<%=monthName%>/<%=intYear%>" name="date"> </td> The following are the codes in my Servlet. I get the dates from multiple check boxes. How can I save the dates into an arraylist? Servlet: Calendar cal = new Calendar(); cal.setDate(request.getParameterValues("date")); String results = request.getParameterValues("date"); for (int i = 0; i < results.length; i++) { System.out.print(results[i]); } try { DBAO myDatabase = new DBAO(); myDatabase.updateDate(cal, results); request.getRequestDispatc...

How to convert a HttpServletRequest to a cURL command line?

How to convert a HttpServletRequest to a cURL command line? I want to convert a HttpServletRequest to a cURL command line for debugging. How to do this? 1 Answer 1 The most common information are: getRequestURL getHeaders getMethods You will find all information in documentation: https://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html https://curl.haxx.se/docs/manpage.html 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.