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 8348887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T07:49:23+00:00 2026-06-09T07:49:23+00:00

I am attempting to call some java code from an XPage and was attempting

  • 0

I am attempting to call some java code from an XPage and was attempting to do this via SSJS. Just trying to get even a basic hello world example working. Ideally the return from the java code could be stuffed into a variable.

Goal: (Xpage contents)

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
    <xp:label value="#{javascript:helloWorld.anyoneThere}" id="label1"></xp:label>
</xp:view>

would print ‘Yo!’ when the page loads. Instead I get a Runtime Error that helloWorld is not found.

Created a package

package testBean;

public class helloWorld {
    public String anyoneThere(){
        return "Yo!";
    }
}

Then I modified the faces-config file

<?xml version="1.0" encoding="UTF-8"?>
<faces-config>
    <managed-bean>
        <managed-bean-name>helloWorld</managed-bean-name>
        <managed-bean-class>testBean</managed-bean-class>
        <managed-bean-scope>application</managed-bean-scope>
    </managed-bean>
</faces-config>

Not sure what I need to do to initialize / call the java function. Some examples I’ve seen are hooking into views or are on events but the intended code for what I’m doing would more likely be run in the beforePageLoad section.

  • 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-09T07:49:24+00:00Added an answer on June 9, 2026 at 7:49 am

    Your managed-bean-class has you include the class name as well.

    <managed-bean-class>testBean.helloWorld</managed-bean-class>
    

    Also your label has to have parenthesis

    <xp:label value="#{javascript:helloWorld.anyoneThere();}" id="label1"></xp:label>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to use ASIHttpRequest with the iPhone to get some information from
I'm attempting to convert some of my code from Tkinter to wxPython. Currently I'm
I'm attempting to make a cross domain script call to get some JSON data
I am attempting to call the Apache Commons StringUtils.join() method from within a Groovy
I'm attempting to build a method call from strings that have been passed into
I'm attempting a basic AJAX call where I send the address 'www.google.com' to urlpost.php
I am attempting to call a remote modem using a local modem connected via
I have two questions: I am trying to embed fonts via this page in
I'm attempting to do a Facebook FQL Multiquery (via JS SDK FB.api call) to
I'm attempting to call a PHP script from a C++ program. For instance, here

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.