Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8998017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:58:04+00:00 2026-06-15T23:58:04+00:00

I tested this source code: Bean: private NewAccountObj na; public class NewAccountObj { private

  • 0

I tested this source code:

Bean:

private NewAccountObj na;

public class NewAccountObj {

    private int userid;
        ............

    public NewAccountObj(int userid.............) {

        this.userid = userid;
            ............
        }

        public int getUserid() {
            return userid;
        }

        ...............

    }

    // Getters 
    public NewAccountObj getDataList() {        
        return na;
    }

JSF Page:

<h:panelGrid columns="2">
    <h:panelGroup>User ID</h:panelGroup>
    <h:panelGroup>
        <h:inputText id="userid" value="#{bean.dataList['userid']}">                    
        </h:inputText>
    </h:panelGroup>
......................
</h:panelGrid> 

When I submit the form I get Target Unreachable, 'null' returned null.
Can you help me to find the problem? Maye this is not the proper way to access Java object in h:panelGrid?

PS:

I get this error message in Glassfish log:

javax.el.PropertyNotFoundException: /NewAccount.xhtml @38,126 value="#{NewAccountController.dataList['userid']}": Target Unreachable, 'null' returned null
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T23:58:05+00:00Added an answer on June 15, 2026 at 11:58 pm

    With the above code, the NewAccountObj is null. So when the getDataList() is called, it returns null. Then it will to call null.getUserId().

    na needs to be initialized. I see in your comment that you have a very long constructor, you should create another one with no arguments (or the minimum required for the object to work).

    private NewAccountObj na;
    
        public class NewAccountObj {
    
            private int userid;
            ............
    
            public NewAccountObj() {
                new New AccountObj(0,0,...........);
            }
    
            public NewAccountObj(int userid.............) {
    
                this.userid = userid;
                ............
    
            }
    
            public int getUserid() {
                return userid;
            }
    
            ...............
    
        }
    
        // Getters 
        public NewAccountObj getDataList() {        
            return na;
        }
    

    And change the datalist getter like this:

    public NewAccountObj getDataList() {
        if(na == null){
            na = new NewAccountObj();
        }
        return na;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I tested source code from this tutorial http://query7.com/php-jquery-todo-list-part-1 and just deploy their source taken
When I tested this code, it gave me java.lang.ArrayIndexOutOfBoundsException: 2 The code isn't finished
I had tested this code: http://support.microsoft.com/kb/316383 It works, but a Word application is opened
I have this source code where I got it from net tutsplus. I have
I've tested this Curl code to download multiple pages simultaneously. But I want to
I am using HTML5 Video with this code: <div id=lightBox1 class=lightBox> <video id=video controls
I tested this block of code and find that the GetInts method does not
I tested this on both .Net 4.0 and .Net 4.0 CP, same result. This
I've tested this snippet with 3 different TTF fonts and I still din't get
I have tested this servlet and it works well, except in Google Chrome it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.