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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:46:02+00:00 2026-05-18T20:46:02+00:00

As the complexity of the web projects that I am working on increases, the

  • 0

As the complexity of the web projects that I am working on increases, the need to include a MVC structure is becoming more urgent. My model classes are well defined, but view and controller code tends to get munged together. I’ve been using pretty heavy AJAX on the site also (RichFaces jsFunctions mostly) which makes things slightly more complicated.

Has anyone found good strategies for implementing MVC using JSF2? I do not want to introduce another framework to the project (e.g. Spring MVC).

Some ideas thus far, which I haven’t started doing yet

  • For a page with heavy ajax, have a ‘view’ bean for remembering selected tabs, selected items, providing filtered lists of data, etc…
  • Have a ‘controller’ bean to handle actions such as changes to the model
  • Have ‘command’ beans which go between the JSF page and controller. A jsFunction populates the command bean with parameters, and calling command.execute() causes the command bean to call the correct method on the controller bean to perform the action. The ‘command’ bean may include some javascript to be called on completion. It may also specify regions of the page to be re-rendered.

Any thoughts?

Edit

What I see pretty often are managed beans that tend to do everything: keep track of users’ selections, update the model, get filtered lists, etc…

We’re using JSF 1.2 at the moment and so we can’t use actions/actionlisteners with parameters. So for example, our managed beans contain variables such as m_selectedDate whose only purpose is to feed the selected date to the back-end on the call to updateFilteredItemsBasedOnDate(). It would be nice if the extra variables could go away since they are just temporary. JSF 2’s EL with parameters should help but I’m curious if there is an alternate solution available.

I am curious if there is a way to apply MVC to managed beans, or some method of separating concerns so that we don’t end up with large beans that try to do everything.

  • 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-18T20:46:03+00:00Added an answer on May 18, 2026 at 8:46 pm

    You have to see the better way of managing the beans rather look into how better use the MVC in JSF. Because JSF itself come with the MVC in better implementation. I am not sure what exactly here you mean as the better way of implementing the MVC.

    As Balusc told in the comments, JSF itself has the sufficient MVC for your application. May be if you want to separate the concerns, it is good idea to separate the business logic into Helper classes and write only the presentation logic in the beans.

    There is debate on whether to use the bean for business logic or should separate it from the managed bean. That is all depends on the your application and domain specific.

    Thanks,
    Krishna

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

Sidebar

Related Questions

I need to calculate the time complexity of the following code: for (i =
A project I'm working on requires the use of jQuery on customers' Web pages.
I have a few projects coming up that have a number of endpoints or
At what level of complexity is it mandatory to switch to an existing framework
What is the time complexity of dynamic memory allocation using new, malloc, etc.? I
I'm taking a course in computational complexity and have so far had an impression
When adding an EditItemTemplate of some complexity (mulitple fields in one template), and then
I wonder what the time complexity of the pop method of list objects is
What is the Big-O time complexity of the following nested loops: for (int i
After reading What’s your/a good limit for cyclomatic complexity? , I realize many of

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.