web.xml

How can I serve static content from CXF / JAX-RS with my rest API mapped to root context?

半世苍凉 提交于 2019-12-23 18:05:41
问题 I have a rest API using CXF to implement JAX-RS where the REST endpoints are directly on the root context. For example if my root context is localhost:8080/myservice And my endpoints are: localhost:8080/myservice/resource1 localhost:8080/myservice/resource2 But I want to serve static content like this: localhost:8080/myservice/docs/swagger.json In my web.xml I'd like to do something like this: <servlet-mapping> <servlet-name>CXFServlet</servlet-name> <url-pattern>/*</url-pattern> </servlet

Servlet mapping with multiple (two) wildcards separated by slash

巧了我就是萌 提交于 2019-12-23 08:07:40
问题 I am trying to map a servlet pattern that matches both /server/abcDef/1432124/adfadfasdfa and /server/abcDef/abcd/12345 The values '1432124' and 'abcd' are not fixed and could be a multitude of values. So essentially I need to match against /abcDef/*/* -- only the abcDef is fixed. Is there a way for me to map this? Really I am looking for something like the following: <servlet-mapping> <servlet-name>abcDefServlet</servlet-name> <url-pattern>/server/abcDef/*/*</url-pattern> </servlet-mapping>

include database.properties from spring project into web.xml

删除回忆录丶 提交于 2019-12-23 05:23:22
问题 I have a database project which is using spring . For that I have two important files in src/META-INF/spring/ (database project) The first one is the cmn-dao-spring.xml . The other one is the database.properties. In my tomcat webapp project I am able to load with that code all the needed context-files: <context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath*:/META-INF/spring/*.xml </param-value> </context-param> The problem is that the database.properties is not

Using web.xml to get JSTL sql dataSource?

谁都会走 提交于 2019-12-23 05:08:20
问题 Attempting to get a dataSource for JSTL SQL operations, and it won't connect. In my web.xml : <context-param> <param-name>databaseJNDI</param-name> <param-value>jdbc/testDS</param-value> </context-param> What I'm attempting in my JSP file: <sql:setDataSource dataSource = "jdbc/testDS"/> I'm attempting to do this and failing in order to avoid hard-coding the database credentials into the page. The database is running, but I don't know enough about JSTL to tackle this on my own right now. It is

How do I redirect https:// requests to http:// in resin4.0

℡╲_俬逩灬. 提交于 2019-12-23 04:45:09
问题 in fact, i got the method for redirect http to https ,as I add a filter in web.xml. such as, <security-constraint> <web-resource-collection> <web-resource-name>SSL</web-resource-name> <url-pattern>/xxx/*</url-pattern> </web-resource-collection> <user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint> in this case, I can make the urls like /xxx/* to be requested in https mode. There are some others urls like /yyy/* which must

Access external project static web resources from Struts2.5 web server

你说的曾经没有我的故事 提交于 2019-12-23 02:34:41
问题 I have some files in a lib package that I am currently working on. It needs to be used by multiple projects so I can't put the files directly within my web server. I want my Struts2.5 web server to be able to serve some static files from my Lib package. I was looking into using a web-fragment.xml solution, but from what I gather from oracle, this is only going to work if I compile my library package and put it in my META-INF directory somewhere. That's fine and all, but really inconvenient

How to reference a websphere Resource Environment Provider in web.xml?

早过忘川 提交于 2019-12-23 02:27:18
问题 We have custom properties defined in websphere using a Resource Environment provider that was setup using the instructions on http://www.ibm.com/developerworks/websphere/library/techarticles/0611_totapally/0611_totapally.html In that article in section 6, it says "For a Web module, open the web.xml file (for an EJB module, open the ejb-jar.xml file ) using the deployment descriptor editor." I need to edit the web.xml by hand since the IBM development tools are unavailable to me at this time.

Class implementing ServletContainerInitializer in web.xml

对着背影说爱祢 提交于 2019-12-22 10:57:25
问题 Can you point to a class implementing the ServletContainerInitializer interface in the web.xml file or do you have to add a file under the META-INF/services/javax.servlet.ServletContainerInitializer to have a J2EE server pick it up? If it's possible via the web.xml file, please explain how. 回答1: I've checked the Java Servlet Specification 3.0 and I've not found any clue that it could be configured via web.xml . I think the only way is the META-INF/services/javax.servlet

Adjusting web.xml listeners, filters and servlets

非 Y 不嫁゛ 提交于 2019-12-22 10:55:02
问题 Following is outline of what I have in my web.xml config file. I need help putting this into the correct order. web.xml web-app 1. contextConfigLocation applicationContext.xml 2. defaultHtmlEscape true 3. listeners 4. servlets 5. filters <order sensitive> 6. session-config timeout 120 7. error page 404 500 UPDATE: I'm getting ClassNotFoundException on all my listeners in tomcat's logs/localhost.log There are not problems after the application starts just log entries that indicate that

com.opensymphony.xwork2.inject.DependencyException: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException

≡放荡痞女 提交于 2019-12-22 10:27:36
问题 While deploying my war file I am getting the below exception: SEVERE: Exception starting filter struts2 com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=com.opensymphony.xwork2.ObjectFactory, name='default'] in public void com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.setObjectFactory(com.opensymphony.xwork2.ObjectFactory). - Class: com.opensymphony.xwork2.inject.ContainerImpl File: ContainerImpl.java Method: