web.xml

Change default location of struts.xml in Struts2

我是研究僧i 提交于 2020-01-04 02:34:34
问题 I've created a Struts2 project which is working fine when I place my struts.xml file inside src directory. Below is my web.xml configuration. <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <display-name>struts2project</display-name> <filter> <filter-name>struts2<

web.xml with different files in welcome-file-list

北战南征 提交于 2020-01-03 05:33:08
问题 i'm starting to use JSF and I'm a bit lost. I'm developping a JSF application and I have two enter points. Some times I need my browser to open a page named mydata.xhtml and another times I need to open a page named dataexchange.xhtml. Now I have done the first one, and the application works fine. I think I have to change my web.xml file, isn`t it? My web.xml is this. <?xml version="1.0" encoding="UTF-8"?> <web-app version="3.1" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www

How to request complete query string in Spring MVC?

非 Y 不嫁゛ 提交于 2020-01-02 02:17:09
问题 In Spring MVC, I can do this to get a value of items on the query string: public void sendMessage(HttpServletResponse response, @RequestParam("Session Id") String sessionId, But how to I get the complete querystring as one long string? I.e. I don't want individual parameters from it, I want the whole thing? Many thanks! 回答1: Add the HttpServletRequest as argument to the method, and get the query string from the request: public void sendMessage(HttpServletRequest request, HttpServletResponse

web.xml default file in directory (for jetty, or tomcat)?

◇◆丶佛笑我妖孽 提交于 2020-01-02 02:10:32
问题 I have a directory called ./welcome/ and ./welcome/ has a file called ./index.jsp. I know how to tell jetty or tomcat how to start at ./wecome/index.jsp. But, I also have lots of other directories with an ./index.jsp like --- ./blogs/, ./whatever/, etc. Without using servlets, is there a way to tell jetty or tomcat, "hey, whenever you get a request for a directory, see if there is an ./index.jsp -- and display it to the user." Like if I access ./blogs/ I dont want to see a 404 not found. I

Spring : Exception starting filter springSecurityFilterChain

南楼画角 提交于 2020-01-02 01:36:06
问题 I am trying to write an application using Spring 3.1.2-Release . App server is Tomcat 7 . When I start the server I get this error : SEVERE: Exception starting filter springSecurityFilterChain org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'springSecurityFilterChain' is defined at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:553) at org.springframework.beans.factory.support

Use HTTPS only for certain pages in servlet based webapp

我只是一个虾纸丫 提交于 2020-01-01 09:23:15
问题 I have a servlet based webapp running on Tomcat 6 server. The URL scheme is HTTPS. The entire site is currently being served on HTTPS. But what I would really like to do is setup HTTPS only for certain operations like purchase and login. Is there any configuration in Tomcat that can help me do this easily? Are there any code changes required to persist session across HTTPS and HTTP? 回答1: Really, ideally, this is configured in your web app's web.xml file. You simply specify certain URLs that

Use HTTPS only for certain pages in servlet based webapp

試著忘記壹切 提交于 2020-01-01 09:22:39
问题 I have a servlet based webapp running on Tomcat 6 server. The URL scheme is HTTPS. The entire site is currently being served on HTTPS. But what I would really like to do is setup HTTPS only for certain operations like purchase and login. Is there any configuration in Tomcat that can help me do this easily? Are there any code changes required to persist session across HTTPS and HTTP? 回答1: Really, ideally, this is configured in your web app's web.xml file. You simply specify certain URLs that

Is it possible to use .properties files in web.xml in conjunction with contextConfigLocation parameter?

孤者浪人 提交于 2019-12-31 17:26:24
问题 Here is part of my web.xml: <context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath:application-config.xml </param-value> </context-param> application-config.xml uses property placeholder: <context:property-placeholder location="classpath:properties/db.properties"/> Is it possible somehow to define which properties file to use in web.xml rather than in application-config.xml? 回答1: Yes, you can use ServletContextParameterFactoryBean to expose context-param value

Is it possible to use .properties files in web.xml in conjunction with contextConfigLocation parameter?

本小妞迷上赌 提交于 2019-12-31 17:25:53
问题 Here is part of my web.xml: <context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath:application-config.xml </param-value> </context-param> application-config.xml uses property placeholder: <context:property-placeholder location="classpath:properties/db.properties"/> Is it possible somehow to define which properties file to use in web.xml rather than in application-config.xml? 回答1: Yes, you can use ServletContextParameterFactoryBean to expose context-param value

Including files in web.xml

会有一股神秘感。 提交于 2019-12-31 02:11:08
问题 I'm in the process of writing unit tests for a JEE5 web service. The behaviour of the web service depends on the attributes set in the web.xml file. I'm wanting to therefore split my web.xml into a constant part and a part that is changed around inbetween test runs. To see if it's actually possible, I've tried to see if I can split out the welcome-file-list attribute. Using some instructions I found I've come up the following: web.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE web-app