JSP页面:<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %><f:view>
<html>
<head>
<title></title>
</head>
<body  background="../images/blue.jpg">
        <h:form>
            <f:loadBundle basename="com.data.analysis.resource.messages" var="messages"/>
            <table align="center">
            <thead >
            <tr><td colsapn="2"><h:outputText value="#{messages.register_plant}"></h:outputText></td></tr></thead>
            <tbody>
<tr>
<td>
<h:panelGrid columns="2">

                <h:outputLabel for="userID" value="#{messages['user_name']}"></h:outputLabel>
<h:inputText id="userID" value="#{registerBean.user_ID}"></h:inputText>

<h:outputLabel for="userPassword" value="#{messages['user_password']}"></h:outputLabel>
<h:inputSecret id="userPassword" value="#{registerBean.user_Password1}"></h:inputSecret>

<h:outputLabel for="userAffirmpass" value="#{messages['user_affirmpass']}"></h:outputLabel>
<h:inputSecret id="userAffirmpass" value="#{registerBean.user_Password2}"></h:inputSecret>
        
<h:outputLabel for="sel_priv" value="#{messages['user_power']}"></h:outputLabel>
<h:selectOneMenu id="sel_priv" value="#{registerBean.user_Privilege}">
<f:selectItems value="#{registerBean.actionBean}"/>
</h:selectOneMenu>

<h:outputLabel for="sel_group" value="#{messages['user_coporation']}"></h:outputLabel>
<h:selectOneMenu id="sel_group" value="#{registerBean.user_Group}">
<f:selectItems value="#{registerBean.groupBean}"/>
</h:selectOneMenu>

<h:outputLabel for="sel_role" value="#{messages['user_role']}"></h:outputLabel>
<h:selectOneMenu id="sel_role" value="#{registerBean.user_Role}">
<f:selectItems value="#{registerBean.roleBean}"/>
</h:selectOneMenu>


<h:commandButton id="putOn" value="#{messages['register_puton']}" actionListener="#{registerBean.RegisterUser}"></h:commandButton>
    </h:panelGrid>
</td>
    </tr>
    </tbody>
    <tfoot>
    <h:outputText value="#{messages.register_welcome}"></h:outputText>
    </tfoot>
    </table>

    </h:form>
        </body>
</html>
</f:view>managed bean :
package com.data.analysis.security.web;import java.util.ArrayList;
import java.util.List;import javax.faces.event.ActionEvent;import com.data.analysis.security.bo.ActionBean;
import com.data.analysis.security.bo.GroupBean;
import com.data.analysis.security.bo.RoleBean;
import com.data.analysis.security.bo.UserBean;import javax.faces.model.SelectItem;public class RegisterBackBean extends RegisterBackBaseBean
{
private String user_ID;                 //用户名
private String user_Password1;          //密码
private String user_Password2;
private String user_Privilege;          //所属组或者部门
private String user_Role; //角色  (高级管理员,,中级管理员,初级用户)
private String user_Group; //权限级别 (与角色对应)
private List<SelectItem> actionBean;
private List<SelectItem>  groupBean;
private List<SelectItem>   roleBean;


private List<ActionBean> list1;
private List<GroupBean> list2;
private List<RoleBean> list3;

........余下的没写出来
}
异常
2007-11-06 14:41:47,250 [http-8084-Processor22] ERROR org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/ElectronTax].[Faces Servlet] - Servlet.service() for servlet Faces Servlet threw exception
javax.faces.FacesException: Could not retrieve value of component with path : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /WebProject/GroupCreate.jsp][Class: javax.faces.component.html.HtmlForm,Id: _idJsp0][Class: javax.faces.component.html.HtmlPanelGrid,Id: _idJsp1][Class: javax.faces.component.html.HtmlInputText,Id: groupname]}
    

解决方案 »

  1.   

    jsf 没用过 但是请教楼主<f:view> 标签何义?可以把html包含起来?
    我用过struts标签 webwork标签 像你这种用法还真没用过。
    这2个标签库有在servlet配置文件中注册?
    javax.faces.component.UIViewRoot,ViewId:   /WebProject/GroupCreate.jsp][Class:   javax.faces.component.html.HtmlForm,Id:   _idJsp0]
      

  2.   

    看代码没有用,可能是你的faceconfig的问题。看了下你的代码好像没有错,以前我也遇到到你这样的错误。现在忘了是什么原因了。
      

  3.   

    应该是你messages中的某些标签未定义。
    详细察看系统日志,输出比较详细一点。