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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:12:30+00:00 2026-06-10T01:12:30+00:00

Using the tutorial of Creating Java control in an NSF , I was able

  • 0

Using the tutorial of Creating Java control in an NSF, I was able to create a simple Java control. Now I want to extend it so that it displays an image so I modified the code in following way:

This is the example control class which now extends the UIGraphicEx class instead of UIComponentBase.

package com.example.component;
import com.ibm.xsp.component.UIGraphicEx;
public class ExampleControl extends UIGraphicEx {
    public ExampleControl() {
        super();
        setRendererType("com.ibm.xsp.ImageEx");

    }
    @Override
    public String getFamily() {
        return "com.example.examplecontrol";
    }
}

This is the xsp-config file for example control class defined above. I have modified it by adding <base-component-type> with value as com.ibm.xsp.component.UIGraphicEx and set <renderer-type> to com.ibm.xsp.ImageEx.

<faces-config>
    <faces-config-extension>
        <namespace-uri>http://example.com/xsp/control</namespace-uri>
        <default-prefix>eg</default-prefix>
    </faces-config-extension>
    <component>
        <description>Example</description>
        <display-name>Example Control</display-name>
        <component-type>com.example.examplecontrol</component-type>
        <component-class>com.example.component.ExampleControl</component-class>
        <component-extension>
            <base-component-type>com.ibm.xsp.component.UIGraphicEx</base-component-type>
            <component-family>com.example.examplecontrol</component-family>
            <renderer-type>com.ibm.xsp.ImageEx</renderer-type>
            <tag-name>exampleControl</tag-name>
            <designer-extension>
                <category>Example</category>
                <selected-event>onclick</selected-event>
            </designer-extension>
        </component-extension>
    </component>
</faces-config>

My renderer class looks like this. Here instead of using ResponseWriter class, I am casting the UIComponent object to UIGraphicEx and setting its URL (the image is present in the same database).

package com.example.renderkit.html_basic;
import javax.faces.render.Renderer;
import java.io.IOException;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import com.ibm.xsp.component.UIGraphicEx;
public class ExampleRenderer extends Renderer {
    @Override
    public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
        UIGraphicEx g = (UIGraphicEx)component;
        g.setUrl("review_icon.gif");
        g.setRendered(true);
        System.out.println("-----------" + g.getUrl());
    }
    @Override
    public void encodeEnd(FacesContext context, UIComponent component) throws IOException {
    }
}

When I put this control in XPage no output is given, however the System.out.println statement in method encodeBegin fires up in the console. What am I doing wrong here? Is this the correct way to proceed?

My final objective here is to generate image data on the fly (based on some input) and then put it into image control through the renderer. How can I achieve that?

  • 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-10T01:12:31+00:00Added an answer on June 10, 2026 at 1:12 am

    EDIT: You can’t wrap up an xagent and deploy it serverwide. I would suggest using a servlet and deploy it via an OSGI plugin.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple java applet that I took from here: http://docs.oracle.com/javase/tutorial/deployment/applet/subclass.html import
Using this tutorial: http://www.c-sharpcorner.com/uploadfile/UrmimalaPal/creating-a-windows-phone-7-application-consuming-data-using-a-wcf-service/ I have created sample/hello world application on the windows phone
I am using this tutorial: http://mobile.tutsplus.com/tutorials/android/android-sdk-creating-a-rotating-dialer/ Which gives me a rotating dialer based on
if yes, is there a tutorial available for creating an android app using the
Im using the tutorial http://www.webdesignlondon-tristar.co.uk/website-design-london/insane-jquery-image-rollover . I am wanting a fading/darken of the image
I'm using this tutorial right now and I got it working perfectly, but my
I am using this tutorial to create a login form http://www.ryancoughlin.com/2008/11/04/use-jquery-to-submit-form/ It authenticates against
I follow tutorial here on how to create web service using RESTful web service
i'm creating a lazy load of image in ListView. i was followed the tutorial
I'm following a tutorial on creating the NerdDinner using ASP.Net MVC. However, I'm using

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.