主题:[讨论]新手jsf问题
刚学J2EE,用JSF进行WEB开发
在URL中输入:http://localhost:8081/JSFLoginDemo/userLogin.faces 提出如下错误
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: userName
javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
root cause
java.lang.IllegalArgumentException: userName
javax.faces.component.UIComponentBase.validateId(UIComponentBase.java:535)
javax.faces.component.UIComponentBase.setId(UIComponentBase.java:333)
javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:218)
javax.faces.webapp.UIComponentClassicTagBase.createChild(UIComponentClassicTagBase.java:476)
javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:660)
javax.faces.webapp.UIComponentClassicTagBase.doStartTag.........
userLogin.jsp的代码如下:
<body>
<f:view>
<f:loadBundle basename="Messages" var="bundle"/>
<h:outputText value="#{bundle.login_lable}"></h:outputText>
<h:form id="loginForm">
<h:outputLabel for="userName"
value="#{bundle.username_lable}"></h:outputLabel>
<h:inputText id="userName " value="#{UserBean.userName}"></h:inputText>
<br>password:<h:inputSecret id="password"
value="#{UserBean.password}"></h:inputSecret><br>
<h:commandButton id="submit" type="submit"
action="{UserBean.login}" value="登录"></h:commandButton>
</h:form>
</f:view>
</body>
请各位大侠指点,万分感激!!
在URL中输入:http://localhost:8081/JSFLoginDemo/userLogin.faces 提出如下错误
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: userName
javax.faces.webapp.FacesServlet.service(FacesServlet.java:256)
root cause
java.lang.IllegalArgumentException: userName
javax.faces.component.UIComponentBase.validateId(UIComponentBase.java:535)
javax.faces.component.UIComponentBase.setId(UIComponentBase.java:333)
javax.faces.webapp.UIComponentELTag.createComponent(UIComponentELTag.java:218)
javax.faces.webapp.UIComponentClassicTagBase.createChild(UIComponentClassicTagBase.java:476)
javax.faces.webapp.UIComponentClassicTagBase.findComponent(UIComponentClassicTagBase.java:660)
javax.faces.webapp.UIComponentClassicTagBase.doStartTag.........
userLogin.jsp的代码如下:
<body>
<f:view>
<f:loadBundle basename="Messages" var="bundle"/>
<h:outputText value="#{bundle.login_lable}"></h:outputText>
<h:form id="loginForm">
<h:outputLabel for="userName"
value="#{bundle.username_lable}"></h:outputLabel>
<h:inputText id="userName " value="#{UserBean.userName}"></h:inputText>
<br>password:<h:inputSecret id="password"
value="#{UserBean.password}"></h:inputSecret><br>
<h:commandButton id="submit" type="submit"
action="{UserBean.login}" value="登录"></h:commandButton>
</h:form>
</f:view>
</body>
请各位大侠指点,万分感激!!