[
https://issues.apache.org/jira/browse/CXF-1072?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540643
]
Damien B commented on CXF-1072:
-------------------------------
My changes to make it work with the simple example
(http://cwiki.apache.org/CXF20DOC/servlet-transport.html :: Publishing an
endpoint with the API).
I'm quite sure it's not the right way to do it, but here it is:
-----8<---------------
org/apache/cxf/transport/http/WSDLQueryHandler.java
@@ -277,10 +277,10 @@
}
public boolean isRecognizedQuery(String baseUri, String ctx, EndpointInfo
endpointInfo) {
- return isRecognizedQuery(baseUri, ctx, endpointInfo, false);
+ return isRecognizedQuery(baseUri, ctx, endpointInfo, true);
}
-----8<---------------
org.apache.cxf.transport.servlet.CXFServlet.java
diff too big: have to remove the dependency toward Spring, and fix some
ordering see attached file
-----8<---------------
org.apache.cxf.transport.servlet.ServletTransportFactory
@@ -24,6 +23,7 @@
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -43,6 +43,16 @@
private Map<String, ServletDestination> destinations =
new ConcurrentHashMap<String, ServletDestination>();
+ /**
+ * This constant holds the prefixes served by this factory.
+ */
+ private static final Set<String> URI_PREFIXES = new HashSet<String>();
+ static {
+ URI_PREFIXES.add("http://");
+ URI_PREFIXES.add("https://");
+ URI_PREFIXES.add("/");
+ }
+
public ServletTransportFactory(Bus b) {
super.setBus(b);
List<String> ids = Arrays.asList(new String[] {
@@ -111,5 +121,8 @@
return Collections.unmodifiableSet(destinations.keySet());
}
-
+ @Override
+ public Set<String> getUriPrefixes() {
+ return URI_PREFIXES;
+ }
}
> CXFServlet can't be configured without using Spring.
> ----------------------------------------------------
>
> Key: CXF-1072
> URL: https://issues.apache.org/jira/browse/CXF-1072
> Project: CXF
> Issue Type: Bug
> Components: Configuration
> Affects Versions: 2.0.1
> Environment: Tomcat v5.5.17
> Reporter: Corey Puffalt
> Assignee: willem Jiang
> Attachments: CXFServlet.java
>
>
> CXFServlet appears to be designed to allow configuration without using Spring
> via the loadBusNoConfig() method called from init() but although reflection
> is used to test for the existence of the Spring ApplicationContext class,
> elsewhere in the code there is an instance variable of type
> ApplicationContext (and other spring types.) This means it's impossible to
> instantiate CXFServlet without Spring on the classpath and if you add Spring
> to the classpath so you can instantiate CXFServlet then it will only attempt
> to configure itself via Spring.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.