web.xml

No mapping found for HTTP request with URI?

夙愿已清 提交于 2019-12-25 08:28:19
问题 Hi I have the following code: Controller: @Controller public class HelloWorldController { @RequestMapping("/hello") public ModelAndView HelloWorld() { String message = "My First SpringMVC Program "; return new ModelAndView("hello","message",message); } web.xml <servlet> <!-- load on startup is used to determine the order of initializing the servlet when the application server starts up. The lower the number, earlier it starts --> <servlet-name>spring</servlet-name> <servlet-class>org

Profile not getting picked from environment variable set in tomcat but is picking when mentione in web.xml

北城以北 提交于 2019-12-25 08:16:35
问题 I have created a environment variable entry of profile to be active in my web application: In setenv.bat file in Tomcat server JAVA_OPTS=%JAVA_OPTS% -Dspring.profiles.active=prod And when my application tries to load datasource using active profile it gives exception as no active profile is set. Entry in applicationcontext.xml: <beans profile="dev"> <bean id="myDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="oracle.jdbc

Spring Boot take over web.xml configuration

自闭症网瘾萝莉.ら 提交于 2019-12-25 00:49:18
问题 I have a Spring Boot web application that works fine. Now I got a 3rd party lib which I must use in the project. The manual of integrating the lib is written with respect to an existing web.xml file. My project completely relies on a Java based config. According to the Spring documentation I can reach my goal of taking over the web.xml content into my application with the help of a WebApplicationInitializer. That's what I did (at least I think I did it correctly). Before going into more

Where to store database connection & global variables in struts 1.3

旧街凉风 提交于 2019-12-25 00:48:33
问题 I am new to struts java application & i want to store database connections & global variables. What is best option to store values (Web.xml or struts-config.xml). and How to access the variables defined in that xml files. Is there any other way to store & access database connections. There should be way so that i can go & edit the files like variables and databases connections easily. 回答1: Best way to store your database connection is Configure DataSource & ConnectionPool on application

How to replace web.xml with application context config files?

不羁的心 提交于 2019-12-25 00:07:14
问题 Background I'm trying to implement integration test for controller in Spring. I DON'T want to use WebApplicationInitializer (Java config for Spring) to run my web app. I want to use xml based configurations. However, @ContextConfiguration could not load web.xml , so I created application-context.xml . The problem is web.xml and application-context.xml are serving the same purpose, Question Can I remove web.xml in favor of application-context.xml ? If I remove web.xml , the test would pass,

the correct order of filters in web.xml for a grails application

醉酒当歌 提交于 2019-12-24 22:59:33
问题 the web.xml of my groovy application has some filters, filtermappings, servlet mappings, listeners defined in the following exact order: <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4"> <display-name>/gra-production-0.1</display-name> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF

org.jboss.as.server.deployment.DeploymentUnitProcessingException: Failed to parse “/WEB-INF/web.xml” at [6,1]

删除回忆录丶 提交于 2019-12-24 20:57:16
问题 I create simple app with PrimeFaces 3.4 and JSF 2.1. When I deploy the application in my JBoss AS 7.0, I encounter the following error 18:55:27,684 INFO [org.jboss.as.server.deployment] (MSC service thread 1-1) Starting deployment of "Getting-started-with-Primefaces.war" 18:55:29,480 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit."Getting-started-with-Primefaces.war".PARSE: org.jboss.msc.service.StartException in service

Tomcat 7: Invalid mapping (java.lang.IllegalArgumentException) [duplicate]

别等时光非礼了梦想. 提交于 2019-12-24 15:04:07
问题 This question already has answers here : java.lang.IllegalArgumentException: The servlets named [X] and [Y] are both mapped to the url-pattern [/url] which is not permitted (6 answers) Closed 4 years ago . I am migrating an existing project from Tomcat 6 to 7. Upon startup I am encountering this logged error message: Jul 02, 2013 2:38:39 PM org.apache.catalina.startup.ContextConfig parseWebXml SEVERE: Parse error in application web.xml file at jndi:/localhost/padd/WEB-INF/web.xml org.xml.sax

Properties file as init-param in web.xml

纵饮孤独 提交于 2019-12-24 14:05:55
问题 I am migrating a Jsp-servlet based Java project that was hosted in websphere to tomcat. Following init-param is in web.xml inside a filter definition. I moved the properties file src folder which is classpath. How to change the following in the web.xml. Can I define properties file as init-param because most of the answers I saw has used context-param to define properties file. I dont think its an option to me as the existing application needs the properties file to be init-param. <init-param

org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher cannot be cast to javax.servlet.Servlet

白昼怎懂夜的黑 提交于 2019-12-24 10:47:27
问题 I am using rest web service and building the project with maven. The project is building successfully, but when i hit url to test rest web services I am getting following exception. java.lang.ClassCastException: org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher cannot be cast to javax.servlet.Servlet at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1116) at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:809) at org.apache