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

  • Home
  • SEARCH
  • 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 9191041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:35:30+00:00 2026-06-17T20:35:30+00:00

I have two scenes Login.fxml and MainView.fxml and two diferent controllers LoginController.java and MainViewControler.java

  • 0

I have two scenes Login.fxml and MainView.fxml and two diferent controllers LoginController.java and MainViewControler.java

In LoginController I do the whole process to login and get the value of JSessionID and store it in a object, like below:

loginGateway = loginGateway(gateway);

Now in MainViewController I need to use the this object (loginGateway) to getJSessionID and make other requests to the server. But how can I acess this object in another Controller Class (MainViewController.java) ????

  • 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-17T20:35:31+00:00Added an answer on June 17, 2026 at 8:35 pm

    Update 2023

    As noted in the referenced question:

    • Passing Parameters JavaFX FXML

    An alternate solution to that presented here is to use MVC, similar to as documented in:

    • Applying MVC With JavaFx

    The solution presented here is still perfectly OK, but you might have a bit more flexibility (and a bit more complexity) by adopting the MVC approach instead.


    Use a variation on the solution in Passing Parameters JavaFX FXML.

    Setup a LoginManager which has a reference to both the LoginController and the MainViewController.

    1. The loginManager creates a login screen using the loginController and passes a reference to itself to the loginController.
    2. When login has passed, the loginController notifies the loginManager of the login sessionID.
    3. The loginManager can then create a MainViewController, passing the mainViewController the sessionID and replacing the scene contents with the main view.

    Here is a link to some sample code to demonstrate this approach.
    login screen
    mainview screen

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

Sidebar

Related Questions

In my iphone application I have two scenes, both of them are view controllers.
Have two folders with approx. 150 java property files. In a shell script, how
I have a JavaFX 2.0 application, which consists of two FXML files, and two
I have two scenes in the storyboard. Since I'm not allowed to upload images
In my cocos2d project, I have two scenes. I transition between the two using
I have two scenes. Scene A is the game scene, where the level variable
I have two scenes. A regular, full-screen iPad view and another popover view. Tapping
I have created a small flash project with 6 Scenes(two scenes contain flv clips
I have an iOS 5 application with a storyboard and two scenes. Scene 1
I am rendering a scene in which I have two spheres. I am revolving

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.