매우 기본적인 JSF 페이지를 실행하려고합니다. Websphere 7.0을 서버로 사용하므로 JSF 1.2를 사용하려고합니다. 브라우저는 html을 렌더링하지 않습니다. doctype을 포함한 모든 html 코드를 표시한다는 의미입니다.
FacesServlet을 통과하지 못했지만 url-pattern이 ' 일치하지 않으면 페이지를 찾을 수 없습니다. JSF 버전 문제입니까? 다른 아이디어? 감사합니다 여러분JSF 페이지가 HTML로 렌더링되지 않습니다.
저는 lib 폴더에 jstl-api-1.2.jar와 jstl-imp-1.2.jar를 포함 시켰습니다.
는 I는 다음의 web.xml을 설정 한 :
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<context-param>
<param-name>javax.faces.application.CONFIG_FILES</param-name>
<param-value>/WEB-INF/faces-config.xml</param-value>
</context-param>
<context-param>
<param-name>javax.faces.DEFAULT_SUFFIX</param-name>
<param-value>.xhtml</param-value>
</context-param>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
얼굴-config.xml의 :
<?xml version="1.0"?>
<faces-config 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-facesconfig_1_2.xsd"
version="1.2">
</faces-config>
의 index.jsp :
<% response.sendRedirect("page-a.jsf"); %>
그리고 시작 xhtml 파일 :
<!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://java.sun.com/jsf/html">
Proyect에서 Facelets를 사용하고있는 것으로 보입니다. 이것이 시나리오라면 접미어와 패턴에 문제가 있습니다. Faces 서블릿은 모든 _ * .jsf_ 페이지 즉, http : // YourServerIP/YourProject/index.jsf를 처리하지만 기본 접미사는 * xhtml *. Faces 서블릿 패턴을 * .xhtml로 변경하고 'http : // YourServerIP/YourProject/index.xhtml'과 같은 페이지에 액세스하고 있는지 확인하십시오. –