开发者

Getting HTTP Error 405

I'm trying to set up a PrimeFaces 2.2 simple webpage in Glassfish 3.1, with Maven as my project management tool.

Currently, my web.xml looks like:

<?xml version="1.0" encoding="utf-8"?>
<web-app version="2.5" 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_2_5.xsd">
  <servlet>
    <servlet-name>Jersey Web Application</servlet-name>
    <servlet-class>
    com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
    <init-param>
      <param-name>
      com.sun.jersey.config.property.packages</param-name>
      <param-value>org.myapp.services</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>Jersey Web Application</servlet-name>
    <url-pattern>/webresources/*</url-pattern>
  </s开发者_开发技巧ervlet-mapping>
  <servlet>
    <servlet-name>Faces Servlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>Faces Servlet</servlet-name>
    <url-pattern>*.jsf</url-pattern>
  </servlet-mapping>
  <servlet>
    <servlet-name>PrimeFaces Servlet</servlet-name>
    <servlet-class>org.primefaces.resource.ResourceServlet</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>PrimeFaces Servlet</servlet-name>
    <url-pattern>*.xhtml</url-pattern>
  </servlet-mapping>
</web-app>

For PrimeFaces, I set the following dependency on pom.xml:

<dependency>
  <groupId>org.primefaces</groupId>
  <artifactId>primefaces</artifactId>
  <version>2.2.1</version>
</dependency>

, and the following repository:

<repository>
  <id>prime-repo</id>
  <name>Prime Technology Maven Repository</name>
  <url>http://repository.prime.com.tr</url>
  <layout>default</layout>
</repository>

However, when I try to open a .xhtml file in the browser, I get: "HTTP Status 405 - HTTP method GET is not supported by this URL", which is really weird because org.primefaces.resource.ResourceServlet is supposed to respond to GET. What am I missing here?


Please follow the tutorials on the web, for example: http://technology.amis.nl/blog/6817/getting-started-with-primefaces-on-glassfish-v3 or try PrimeFaces 3.0M1.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜