web.xml

How can I make welcome-file-list work with Spring Servlet?

让人想犯罪 __ 提交于 2019-12-12 05:59:28
问题 This is the code I have: public class Bootstrap implements WebApplicationInitializer { @Override public void onStartup(ServletContext container) throws ServletException { container.getServletRegistration("default").addMapping("/resources/*"); AnnotationConfigWebApplicationContext servletContext = new AnnotationConfigWebApplicationContext(); servletContext.register(ServletContextConfiguration.class); ServletRegistration.Dynamic dispatcher = container.addServlet("springDispatcher", new

How to enable webapp as distributable in grails 3+

我只是一个虾纸丫 提交于 2019-12-12 04:38:45
问题 How do i enable webapp to be distributable in grails 3+ since there is no web.xml? 回答1: step 1: go to src\main\webapp\WEB-INF location. (if not, create the path) step 2: create a folder WEB-INF step 3: create a file web.xml and paste the following code <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" metadata-complete="true" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http:/

Magnolia CMS internationalization of 404 pages?

送分小仙女□ 提交于 2019-12-12 04:24:39
问题 I have setup a custom 404 page, as described on "How to change the default 404 error page with custom page from pages app". Like the rest of my pages created with Magnolia CMS' "page app", that custom 404 error page is multilingual. However, when redirected to my custom 404 error page, I am always shown the default language. Even if the page I am trying to reach was expected to be in another language. For instance: with " English " as defined default language, I am navigating the German

java.lang.NoClassDefFoundError: org/eclipse/wst/web/internal/deployables/IFlatDeployable

谁说胖子不能爱 提交于 2019-12-12 03:45:40
问题 Servlet not working in newly created Dynamic Web Project in Eclipse Juno for Java EE. Here is how it goes, from scratch: I downloaded Eclipse EE (Juno), didn't change any of default config I downloaded latest Tomcat (7.0.30) In Preferences > Server > Runtime Environments I added new Apache Tomcat v7.0 I created new Dynamic Web Project called UniBudget (context root: budget ) I added new file ( index.jps with "it works!" inside) At this moment after adding project to server and running it I

Eclipse - Edit web.xml like Netbeans (GUI)

故事扮演 提交于 2019-12-12 03:44:02
问题 I'm learning Java EE from scratch, and in the tutorial I'm following they're using netbeans to configure web.xml and other content descriptors (like Glassfish descriptor). Because they use it graphic interface from Netbeans, I can't find to do the same on Eclipse. Just the xml file. Is there a way to configure the web.xml from a graphic interface like I do in netbeans? 回答1: A NetBeans tutorial that does not show you the resulting source from making edits in a GUI is worthless for Eclipse.

Links (href) not relative to application in Spring MVC?

蹲街弑〆低调 提交于 2019-12-12 02:47:02
问题 I am in the process of changing a project which used a simple java HTTPServer on port 8080 to that which uses the Spring MVC servlet framework. There are lots of links in the application like so: <a href=\"/rule\">Manage rules</a><br/> Which worked fine using requests such as: http://localhost:8080/send However, these now don't work unless I put the servlet name in front like so: "<a href=\"/ServletName/rule\">Manage rules</a><br/>" Just wondering is there any way around this, or is it a

Servlet 3.0 without web.xml error-page javaconfig

試著忘記壹切 提交于 2019-12-12 02:09:06
问题 In the web.xml file, error page as follows. <error-page> <location>/WEB-INF/jsp/admin/ErrorPage.jsp</location> </error-page> without web.xml javaconfig convert @Configuration @EnableWebMvc @ComponentScan("sg.ani.api.controller") public class WebConfig extends WebMvcConfigurerAdapter{ } override search no error page How to javaconfig convert? 回答1: Create a class with the following: @ControllerAdvice public class ExceptionHandling { @ExceptionHandler(value=Exception.class) public String

Call servlet from Ajax [duplicate]

白昼怎懂夜的黑 提交于 2019-12-12 01:47:24
问题 This question already has answers here : How to use Servlets and Ajax? (7 answers) Closed 4 years ago . This is my jsp.. and i use javascript-function and ajax-call to call servlet (ReadprojectInfo). <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <script type="text/javascript"> function displayProject() { var xmlhttp; if (window

JSF ServletFilter Restriction on Restricted pages when logged in

假装没事ソ 提交于 2019-12-12 01:02:30
问题 I've this servlet filter servlet called everytime a file (images and xhtmls) from my "com.shadibandhan.Restricted" folder is called. I'm using JSF, so there's also Faces Servlet . This is my web.xml <?xml version="1.0" encoding="UTF-8"?> <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> <context-param> <param-name>javax

Infinite loop occures when run the program

那年仲夏 提交于 2019-12-11 19:22:35
问题 This java web application run like an infinite loop. can anyone tell me the reason? need to filter every request here.allowed can use the system.other users should go to login page with a message..please help me to do this. FilterRequest.java package com.mobitel.bankdemo.web; import java.io.IOException; import javax.servlet.Filter; import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax