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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:16:15+00:00 2026-05-26T17:16:15+00:00

I have multiple SimpleFormController controllers. One controller contains a command object used to filter

  • 0

I have multiple SimpleFormController controllers. One controller contains a command object used to filter results in the other controllers. I seem to be missing something simple, but I can’t seem to find a way to use the same instance of the command object in the other controllers.

My setup is such that this main controller, let’s call it RootController extends SimpleFormController, and the rest of the controllers extend RootController. The idea was that the command object is stored in one place – RootController and the controllers that extend it reuse the same object. However, it doesn’t seem to be working that way, other controllers seem to have their own copy of the command object.

  • 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-05-26T17:16:16+00:00Added an answer on May 26, 2026 at 5:16 pm

    Form backing objects are just normal Pojos, so you can inherit it form each other.

    public class BaseCommand {
      ...
    }
    
    public class MoreCommand extends BaseComman {
      ...
    }
    

    May you just forget the “update” the commandClass in your Controller Subclasses.

    Anyway: notice that SimpleFormController is deprecated in Spring 3.0. Instead the Annotation Style is preferred.


    Update: One INSTANCE of an command object, can be handled by only one INSTANCE of an Controller. So you can subclass the Controller (don’t miss to call super), but you can not have two instances of the controller and hope that both are invoked.

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

Sidebar

Related Questions

I have multiple controllers one in Areas /Areas/Demo/Admin/AdminController and other in main site /Controller/Admin/AdminController
I have multiple selects: <select id=one> <option value=1>one</option> <option value=2>two</option> <option value=3>three</option> </select> <select
I have multiple dl elements on a page. At the end of each one
I have multiple tables . I have created one stored procedure where I am
I have multiple pages containing the same partial view. The partial contains a form
I have multiple object doing random movement with random speed. i wanted to repeat
I have multiple groups of duplicates in one table (3 records for one, 2
i have multiple rows with the same id and when used the jquery function
I have multiple plone sites in one zope instance (ZODB). Now I'd like to
I have multiple classes that are not allowed to modify each other's fields, but

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.