当前位置:编程学习 > JAVA >>

jsf初学者遇到问题,求助

自己想搭建一个jsf开发环境,但是搭建好以后jsf或者primefaces的控件都不现实,相关配置如下:
web.xml
 

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.5" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee   http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
  
  <context-param>    
        <param-name>primefaces.THEME</param-name>    
        <param-value>start</param-value>    
    </context-param>    
    <context-param>    
        <param-name>javax.faces.PROJECT_STAGE</param-name>    
        <param-value>Development</param-value>    
    </context-param>    
  <context-param>
        <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
        <param-value>.xhtml</param-value>
   </context-param>
   <context-param>
        <param-name>javax.faces.FACELETS_LIBRARIES</param-name>
        <param-value>/WEB-INF/app-tags.taglib.xml</param-value>
    </context-param>
    
    <context-param>
        <param-name>javax.faces.DATETIMECONVERTER_DEFAULT_TIMEZONE_IS_SYSTEM_TIMEZONE</param-name>
        <param-value>true</param-value>
    </context-param>
    
    <context-param>
        <param-name>primefaces.PUSH_SERVER_URL</param-name>
        <param-value>http://www.primefaces.org:8080</param-value>
    </context-param>
    
    <listener>
        <listener-class>
            com.sun.faces.config.ConfigureListener
        </listener-class>
    </listener>
  
  <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>
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
</web-app>

 
类库:

 
服务器是tomcat6.0
 
工程结构:

 
test2.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:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:p="http://primefaces.org/ui">
<head>
<title>My Facelets Page</title>
<meta http-equiv="keywords" content="enter,your,keywords,here" />
<meta http-equiv="description"
content="A short description of this page." />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />

<!--<link rel="stylesheet" type="text/css" href="styles.css">-->
</head>
<body>
<h:inputText value="123">
<p:ajax update="out" />
</h:inputText>
<h:outputText id="out" value="123" />
<p:editor />

</body>
</html>


 
用IE访问页面总是弹出下载框:


高手指点一下,谢谢。 --------------------编程问答-------------------- 自己顶。。。 --------------------编程问答-------------------- 头怎么是<?xml version="1.0" encoding="UTF-8"?>?
删了试试 --------------------编程问答-------------------- 看不到IE弹出来的对话框,你发的图片没有显示!重新截一个出错信息
补充:Java ,  Web 开发
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,