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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T13:39:52+00:00 2026-06-14T13:39:52+00:00

I have the following abstract class public abstract class ReturnAgentFromTab extends BasePage{ @Persist(session) public

  • 0

I have the following abstract class

public abstract class ReturnAgentFromTab extends BasePage{

    @Persist("session")
    public abstract Agent getAgent();
    public abstract void setAgent(Agent agent);

    @InjectObject("spring:agentApplicationModeResolver")
    public abstract AgentApplicationModeResolver getAgentApplicationModeResolver();

    .... more @InjectObject()

    public void nextPage(IRequestCycle cycle) {

        setApplicationModeUsingAgentStatus(getAgent());

        AgentSearchNavigationManager navManager = getAgentSearchNavigationManagerFactory().getAgentSearchNavigationManager();
        FlowStage stage = getFlowStage();
        if (stage == null) {
            setApplicationModeUsingAgentStatus(getAgent());
            stage = getUserDefaultFlowStageService().getDefaultFlowStage(UserHolder.getUser(), getVisitClass().getApplicationMode());
        }

        Class nextPageClass = navManager.getNextPage(getUserDefaultFlowStageService());

        String nextPageQualifier = getUserDefaultFlowStageService().getPageQualifier(getAgent(), nextPageClass, getVisitClass().getApplicationMode());
        IPage nextPage = getPageUtils().getPage(nextPageClass, nextPageQualifier);
        if ((getFlowStage() instanceof PSDFlowStage)) {
            nextPageQualifier = getFlowStage().getValue();
        }
        nextPage = getPageUtils().getPage(nextPageClass, nextPageQualifier);
        if (navManager instanceof NameBasedAgentSearchNavigationManager && nextPageClass != SignOffStatusPage.class) {
            NameBasedAgentSearchNavigationManager nameBasedNavManager = (NameBasedAgentSearchNavigationManager) navManager;
            String nextPageName = nameBasedNavManager.getNextPageName(stage); 
            if (!nextPageName.equals(nextPageClass.getSimpleName())) {
                nextPage = getPageUtils().getPage(nextPageName, nextPageQualifier);
            }
        }

        if (isNextPageActivateAgentGeneral(nextPage)) {
            initialisePageLink(nextPageClass, nextPage);
        }
        ((WuamsBasePage) nextPage).init(getAgent().getAgentId());
        getPageUtils().navigateTo(nextPage);

    }

    private void setApplicationModeUsingAgentStatus(Agent agent) {
        getVisitClass().setApplicationMode(getHomeLinksFactory().getRegionHomeLinksService().getApplicationMode(agent));
    }

    private boolean isNextPageActivateAgentGeneral(IPage nextPage) {
        return nextPage instanceof ActiveAgentGeneralPage;
    }

    private void initialisePageLink(Class nextPageClass, IPage nextPage) {
        if (getVisitClass().getPageLink() == null) {
            getVisitClass().setPageLink(PageLinkUtil.getPageLinkMessageKeyFromPageClass(nextPageClass, 
                    getUserDefaultFlowStageService().getDefaultFlowStage(UserHolder.getUser(), getVisitClass().getApplicationMode()).getValue()));
        }
    }

}

What I want to do is call my nextPage(cycle) from another class that is abstract and extends ReturnAgentFromTab, but when I try

public abstract class DoSomethingWithAgent extends ReturnAgentFromTab {

@Persist("session")
public abstract ReturnAgentFromTab getReturnAgentFromTab();
public abstract void setReturnAgentFromTab(ReturnAgentFromTab returnAgentFromTab);
....
getReturnAgentFromTab().nextPage(cycle);

I get a null pointer exception, I know this is because I am not actually setting ReturnAgentFromTab anywhere but I do not understand how to set it using abstract classes. Can anybody help?

If ye need more code just ask

  • 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-14T13:39:53+00:00Added an answer on June 14, 2026 at 1:39 pm

    The point of abstract classes is to simply not implement certain things, such as providing certain objects. The method getReturnAgentFromTab() is a perfect example: the class itself does not care where that object comes from because that is the sole responsibility of the subclass. So extend that class, write that method, and all of a sudden the base class does its thing.

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

Sidebar

Related Questions

I have the following simple code abstract class A { public abstract void Test(Int32
Within my code a have the following abstract superclass public abstract class AbstractClass<Type extends
I have the following code public abstract class Event { public void fire(Object... args)
I have the following class structure: public abstract class Generic<T extends SuperClass> public class
I have the following class: public abstract class MyClass<T extends Object> { protected T
I have the following classes: public abstract class ClassWithHelper<T extends HelperInterface> { Class<T> helperClass;
I have the following code: public abstract class A<T extends B<? extends A<T>>>{ @Override
I have following implementation public abstract class BaseAcion extends ActionSupport { private String result;
I have the following abstract class: public abstract class AbstractGroup { private String name;
Let's say I have defined the following class: public abstract class Event { public

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.