servlets

Context Param Values in web.xml get ignored

痞子三分冷 提交于 2021-02-08 06:50:37
问题 I was always wondering why no primefaces theme gets applied and could never fix it. Today I found out that when I add a Bean "ServletContextInitializer" to my Application with the same stuff like in the web.xml it works. I read something that app.properties maybe overrides the settings? I got a application.properties but just for the database and jpa/hibernate. Application: @EnableAutoConfiguration @ComponentScan({ "de.develop.telefonbuch" }) public class Application extends

Servlet class org.restlet.ext.servlet.ServerServlet is not a jakarta.servlet.Servlet

非 Y 不嫁゛ 提交于 2021-02-08 05:47:42
问题 What could be causing this error? Caused by: jakarta.servlet.UnavailableException: Servlet class org.restlet.ext.servlet.ServerServlet is not a jakarta.servlet.Servlet at org.eclipse.jetty.servlet.ServletHolder.checkServletType (ServletHolder.java:499) at org.eclipse.jetty.servlet.ServletHolder.doStart (ServletHolder.java:377) at org.eclipse.jetty.util.component.AbstractLifeCycle.start (AbstractLifeCycle.java:96) at org.eclipse.jetty.servlet.ServletHandler.lambda$initialize$2 (ServletHandler

setCharacterEncoding problems

时光总嘲笑我的痴心妄想 提交于 2021-02-08 04:52:34
问题 I have this line of code: response.setCharacterEncoding("UTF-8"); I'm getting this error: The method setCharacterEncoding(String) is undefined for the type HttpServletResponse Eclipse suggests to cast the response to request which is some thing I don't want to. Can any one help me fix this, please? 回答1: See the javadoc. This method exists since servlet 2.4. Either your server supports this version (or later) of the servlet spec, and the jar in your buildpath is too old, or it doesn't support

Set servlet as default home page in web.xml [duplicate]

痴心易碎 提交于 2021-02-07 18:20:05
问题 This question already has answers here : Change default homepage in root path to servlet with doGet (2 answers) Closed 5 years ago . I've a servlet registered in web.xml as below. <servlet> <servlet-name>Manager</servlet-name> <servlet-class>Manager</servlet-class> </servlet> <servlet-mapping> <servlet-name>Manager</servlet-name> <url-pattern>/RequestManager</url-pattern> </servlet-mapping> Basically I want to call this servlet as my default home page when I open http://localhost:8080/appname

Set servlet as default home page in web.xml [duplicate]

£可爱£侵袭症+ 提交于 2021-02-07 18:19:48
问题 This question already has answers here : Change default homepage in root path to servlet with doGet (2 answers) Closed 5 years ago . I've a servlet registered in web.xml as below. <servlet> <servlet-name>Manager</servlet-name> <servlet-class>Manager</servlet-class> </servlet> <servlet-mapping> <servlet-name>Manager</servlet-name> <url-pattern>/RequestManager</url-pattern> </servlet-mapping> Basically I want to call this servlet as my default home page when I open http://localhost:8080/appname

Java file uploading painfully slow

淺唱寂寞╮ 提交于 2021-02-07 18:10:20
问题 I've built a small service which receives images from an Android device and saves them to a Amazon S3 Bucket. The code is pretty simple but is painfully slow. It goes like this: public synchronized static Response postCommentPicture(Response response, Request request){ JsonObject ret = new JsonObject(); OutputStream outputStream; String meepId = request.params(":id"); System.out.println("1"); if(meepId == null){ ret.addProperty("Error", "Missing meep id"); response.body(ret.getAsString());

Java file uploading painfully slow

不问归期 提交于 2021-02-07 18:07:17
问题 I've built a small service which receives images from an Android device and saves them to a Amazon S3 Bucket. The code is pretty simple but is painfully slow. It goes like this: public synchronized static Response postCommentPicture(Response response, Request request){ JsonObject ret = new JsonObject(); OutputStream outputStream; String meepId = request.params(":id"); System.out.println("1"); if(meepId == null){ ret.addProperty("Error", "Missing meep id"); response.body(ret.getAsString());

Java file uploading painfully slow

若如初见. 提交于 2021-02-07 18:06:33
问题 I've built a small service which receives images from an Android device and saves them to a Amazon S3 Bucket. The code is pretty simple but is painfully slow. It goes like this: public synchronized static Response postCommentPicture(Response response, Request request){ JsonObject ret = new JsonObject(); OutputStream outputStream; String meepId = request.params(":id"); System.out.println("1"); if(meepId == null){ ret.addProperty("Error", "Missing meep id"); response.body(ret.getAsString());

java.lang.ClassNotFoundException: javax.ws.rs.client.RxInvokerProvider

匆匆过客 提交于 2021-02-07 09:43:28
问题 Im trying to login from a jsp page, using a loginServlet. It redirects to the servlet, but it doesn't make the authentication and throws an error. Here is the code: JSP file: <div class="container"> <div class="row"> <div class="box"> <div class="col-md-6 col-md-offset-4"> <h2 class="intro-text">Welcome! Login here:</h2> <form class="form-horizontal" action="LoginServlet" method="POST"> <div class="form-group"> <label class="control-label col-sm-2" for="username">Username:</label> <div class=

Prevent form resubmit after pressing back button

元气小坏坏 提交于 2021-02-07 07:26:19
问题 I am in bit of a delicate situation here. In my organization we design stock management systems and it is a web application based on JSP pages and servlets which handles them. I have been asked to fix a specific problem. We have a JSP page with an HTML form table where there are stock details. When user enters the details manually and submit the form, stock details updated in the database and it works fine. Problem is this : When the user press the browser's back button, user can come to the