配置JSF的jsp 页面报错
来源:互联网 发布:易语言统计成绩源码 编辑:程序博客网 时间:2024/04/25 17:29
ype Exception report
message An exception occurred processing JSP page /index1.jsp at line 14
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /index1.jsp at line 1411: <body>12: hello13: 14: <h:form id="form1">15: <h:inputText value="input"/> 16: <h:outputText value="h:output"/> hello锛�17: </h:form>>Stacktrace:org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:574)org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:461)org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)javax.servlet.http.HttpServlet.service(HttpServlet.java:729)org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:568)com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:363)com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:153)com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:99)com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
再三排查web.xml 和 faces-config.xml的配置都没错,最后发现是jsp页面少了 <f:view> 标签。
jsp 代码如下:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"pageEncoding="ISO-8859-1"%><%@ taglib prefix="f" uri="http://java.sun.com/jsf/core"%><%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title> Autotest here</title></head><body>hello<f:view><h:form id="form1"> <h:inputText value="input"/> <h:outputText value="h:output"/> hello! </h:form>></f:view><% out.println("name:--------------"); %></body></html>
浏览器输入:http://localhost:8080/autotest/index1.jsp 则报错,输入http://localhost:8080/autotest/index1.jsf 则页面能正常展示
web.xml 文件不能配有这段代码,否则输入http://localhost:8080/autotest/index1.jsf页面报错
<servlet-mapping><servlet-name>FacesServlet</servlet-name><url-pattern>*.jsp</url-pattern></servlet-mapping>
报错异常为:
type Exception report
message Servlet execution threw an exception
description The server encountered an internal error that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: Servlet execution threw an exceptionorg.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
0 0
- 配置JSF的jsp 页面报错
- jsp页面报错
- jsp页面的第一行报错
- jsp页面全部报错
- J2EE 报错跳转到指定的 JSP页面
- 关于jsp页面头部<%@ %>报错的问题
- JSP页面顶端出现“红色”的报错信息
- JSP, JSF的区别
- JSF 中 jsp 页面跳转没反应
- jsp页面:request.getContextPath()报错
- jsp页面报错(一)
- jsp页面上 out.flush 报错
- jsp页面编码报错问题
- jsp页面第一行报错问题
- jsp页面报错,无法定位问题
- Jsp页面报错状态码含义
- JSP添加<f:view>,页面报错
- jsp页面报错提示编码错误信息
- 标准非STL容器 : bitset
- C语言关键字
- maven3常用命令、java项目搭建、web项目搭建详细图解
- 本地广播的使用方法
- 怎么把pdf直接转换成word
- 配置JSF的jsp 页面报错
- 有道云笔记导入印象笔记,最简单方法
- spark学习笔记
- UIUITextView设置类似于UITextField的placeholder
- 数据分类:决策树Decision Tree
- 代码规范工具-Checkstyle使用手册
- 【整理】python 3.x爬虫
- 如何禁止App在后台运行以及如何保存和恢复App的状态
- Android官方API Demo学习之联系人获取