Answer the question
In order to leave comments, you need to log in
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>
@Stateless
public class HelloWorldBean {
public String f() {
return "Hello World bean!";
}
public String view() {
return "hello.xhtml";
}
}
<?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>
Answer the question
In order to leave comments, you need to log in
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 questionAsk a Question
731 491 924 answers to any question