S
S
Sland Show2018-10-06 20:47:43
Java
Sland Show, 2018-10-06 20:47:43

Why does the environment say that I don't have servlet mapping?

I have an application on WildFly. I registered EJB (service layer), created JSF (xhtml page) and now I want to register servlet mapping in the deployment descriptor (web.xml). Moreover, Faces-servlets are used here:

<!DOCTYPE web-app PUBLIC
        "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
        "http://java.sun.com/dtd/web-app_2_3.dtd" >

<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_2_5.xsd"
         id="WebApp_ID" version="2.5">

    <display-name>EmployeeApp</display-name>
    <welcome-file-list>
        <welcome-file>hello.xhtml</welcome-file>
    </welcome-file-list>

    <servlet>
        <servlet-name>facesServlet</servlet-name>
        <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet-mapping>
        <servlet-name>facesServlet</servlet-name>
        <url-pattern>*.xhtml</url-pattern>
    </servlet-mapping>
</web-app>


Here is the EJB:
@Stateless
public class HelloWorldBean {

    public String f() {
        return "Hello World bean!";
    }

    public String view() {
        return "hello.xhtml";
    }

}


Here is the JSF:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
<f:view>
    <h:outputLabel value="Hello, world"/>
</f:view>
</html>


But in the end, the Idea says that I don't have a mapping:
5bb8f53850fe5326666820.jpeg

What's wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sland Show, 2018-10-06
@SlandShow

Understood.
Project Structure -> Modules -> Add web.xml deployment descriptor
https://stackoverflow.com/questions/43153904/servl...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question