Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [] AutoText Completion Issue - CDIBean

I would try #{loginCDIBean.tcNoInfo} instead of #{LoginCDIBean.tcNoInfo}: That's probably all it is.

CodeRanch I think is a much better place than here for getting started. They even have a forum for Faces:

On 12/4/2022 10:54 AM, Mehmet Fatih ÇİN wrote:


I am new to the world of Java EE. That's why the problem may seem so absurd. However, I couldn't find any solution that works for my problem. My problem is this:

I have a ".xhtml" file. prompts the user to enter a username. I need to print the information entered with the "Login" button on the label under the button. This is a bit silly because I did it for the purpose of learning. but the CDI Bean in "#{...}" is not reachable. How can i solve this. I have searched many forums on the internet.


Error received:

Exception: jakarta.servlet.ServletException: /login.xhtml @14,242 value="#{LoginCDIBean.tcNoInfo}": Target Unreachable, identifier 'LoginCDIBean' resolved to null

Root Cause: jakarta.el.PropertyNotFoundException: /login.xhtml @14,242 value="#{LoginCDIBean.tcNoInfo}": Target Unreachable, identifier 'LoginCDIBean' resolved to null


CDI Bean Code:



* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license

* Click nbfs://nbhost/SystemFileSystem/Templates/JSF/ to edit this template




import jakarta.enterprise.context.SessionScoped;

import jakarta.inject.Named;





* @author Mehmet Fatih ÇİN




public class LoginCDIBean implements Serializable {


    private String tcNoInfo = "";



     * Creates a new instance of LoginManagedBean


    public LoginCDIBean() {

        this.tcNoInfo = "1234567890";



    public String getTcNoInfo() {

        if (Kontrol(tcNoInfo) == true) {

            return tcNoInfo;

        } else {

            return "Hata    ";




    public void setTcNoInfo(String tcNoInfo) {

        this.tcNoInfo = tcNoInfo;



    private Boolean Kontrol(String str) {

        if (str.length() == 11) {

            return true;

        } else {

            return false;





Login.xhtml Code:


<?xml version='1.0' encoding='UTF-8' ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">

<html xmlns=





        <title>Giriş Sayfası</title>




            <h:form id="giris-form">

                <h:outputText id="kullanici-label" style="font-family: Verdana; font-size: 12pt" value="Kullanıcı Adı"/><br/><br/>

                <h:inputText id="kullanici-text" value="#{LoginCDIBean.tcNoInfo}" style="font-family: Verdana; font-size: 10pt" p:placeholder="Kullanıcı Adınızı Giriniz." required="true" requiredMessage="Kullanıcı Adı Alanı Boş Geçilemez."/><br/>

                <h:message for=""/>

                <h:commandButton id="gonder-button" value="Giriş Yap"/>

                <h:outputText id="cikti-label" value="#{LoginCDIBean.tcNoInfo}"/>







Where is my mistake according to these codes? My dependencies:



GlassFish Server 6.2.5

Apache NetBeans 15



Mehmet Fatih ÇİN



_______________________________________________ mailing list
To unsubscribe from this list, visit

Back to the top