web.xml

How to specify the default error page in web.xml?

不羁岁月 提交于 2019-12-16 21:19:21
问题 I am using <error-page> element in web.xml to specify the friendly error page when user encounters a certain error such as error with code of 404: <error-page> <error-code>404</error-code> <location>/Error404.html</location> </error-page> However, I want that if the user does not meet any error code specified in <error-page> , he or she should see a default error page. How can I do that using the element in the web.xml ? 回答1: On Servlet 3.0 or newer you could just specify <web-app ...> <error

EL expressions not evaluated in JSP

三世轮回 提交于 2019-12-14 03:21:51
问题 There's a small problem with my servlets/jsp web application. I'm trying to use jstl in jsp page. When I use any tag for example: <c:out value="${command}"/> it shows me ${command} in my browser instead of parameter 'command' value. I'm using maven (and I guess the problem is here). Here is pom xml dependencies: <dependency> <groupId>javax.servlet</groupId> <artifactId>javax.servlet-api</artifactId> <version>3.0.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>jstl<

Cannot get REST response (with Postman). Java, IntelliJ, Tomcat 9, Maven

跟風遠走 提交于 2019-12-13 21:23:34
问题 I'm only a beginner. I have this project that I was working on a training course. It was set up on Eclipse and it was working. I'm now trying to get this same code working using IntelliJ Ultimate and I cannot any rest response. I'm probably doing something wrong but I have no clue what it could be as I do not understand much when it comes setting things up. I tried both browser and Postman and I get error 404. I also tried to set a breakpoint to the code and it does not get activated. I

Servlet not being mapped, java web.xml not being overridden in target folder

╄→гoц情女王★ 提交于 2019-12-13 21:07:48
问题 I have 2 servlets in a web project (Maven) : ServletA created in a earlier version of my project (Maven project), works just fine. ServletB that I've just created after I add (in the properties /Project Facets/Dynamic Web Module 2.4 so it can be recognized as a web project in eclipse)I'm choosing 2.4 beacuse of application server restrictions. However when I create my servlet I can see the web.xml being mapped with it, but when I execute mvn clean compile package the web.xml in the target

Eclipse throwing error - “file name references to ”main.html“ that does not exist in web content” 404 error for web.xml

∥☆過路亽.° 提交于 2019-12-13 04:28:50
问题 I am facing an issue in while running simple web project in Eclipse. I will first demonstrate the steps of creating my project :- 1) New Spring Template Project. 2) Select Spring MVC Project. 3) Click Finish. 4) Now I create a new file name "login.html" in "webapps" folder under "src" 5) Now I tried to add welcome-file tag in the web.xml. 6) When I do that I get the above Warning inside web.xml from Eclipse. 7) If I run the application I get 404 error This is my web.xml <?xml version="1.0"

404 error for tomcat 6 for spring application

狂风中的少年 提交于 2019-12-13 04:26:13
问题 My app is deployed properly but getting 404 error. Unable to find what is happening. In this deployed means pointing my webapp folder to location in computer. URL used : localhost:8080/studentspringmvc/ web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java

Using webapp's web.xml to redirect to SSL for login page

戏子无情 提交于 2019-12-13 04:09:08
问题 I have a web app running on Tomcat 7, and I've successfully gotten SSL and form-based authentication to work by using https and the appropriate port directly. However I'd like to require SSL for the login page and can't seem to get this to work if I navigate to the root of my web app. E.g. if I go to http://localhost:8080/ProjectManagementSystem/login.html it redirects to SSL, but not if I go to http://localhost:8080/ProjectManagementSystem The latter does redirect to the login page but doesn

How to get a request on controller for endpoint which is defined as default servlet-mapping on web.xml?

浪尽此生 提交于 2019-12-13 03:41:19
问题 I am working on a server where we are using a third party API provider for a particular service. The third party send a image endpoint. Eg. "/media/image/image.jpg" . The image is available on the third party base URL. I need to make the image available on our base url. For that I have a controller. @RequestMapping(value = "/media/movie/{imageName}", method = RequestMethod.GET) public void getMovieImage(@PathVariable("imageName") String imageName, HttpServletResponse response) throws

** not working in web.xml security-contraints

Deadly 提交于 2019-12-13 02:13:16
问题 I want to have unrestricted access for /gadgets/{any directory}/css/*. I tried to mention like this <security-constraint> <web-resource-collection> <web-resource-name>UnProtected Area</web-resource-name> <url-pattern>/gadgets/**/css/*</url-pattern> </web-resource-collection> </security-constraint> <security-constraint> <web-resource-collection> <web-resource-name>Protected Area</web-resource-name> <url-pattern>/gadgets/*</url-pattern> </web-resource-collection> <auth-constraint> <role-name

redirect through web.xml in google-app-engine

梦想与她 提交于 2019-12-13 00:55:55
问题 After migrating to the new HRD store, I want to redirect requests to my old application to the new HRD application. I know I should let the Google migration tool make an alias, but since I migrate an intermediate copy of my app (because of the nightmares that migrating the database causes) that is not an option. My plan was to use a servlet that does a HTTP 301 (HttpServletResponse.SC_MOVED_PERMANENTLY) redirect, and use a servlet-mapping with /* in web.xml. This works locally, but on the