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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:52:50+00:00 2026-06-01T03:52:50+00:00

This is basically a ‘best practices’ question. Struts 1 forms have getters and setters

  • 0

This is basically a ‘best practices’ question. Struts 1 forms have getters and setters for retrieving/setting form properties. Should they be used for just that, or a getter (let’s say) can have logic (or some form of pre-processing) that potentially modifies the property before giving it to the jsp/action? Another alternative is to use the logic (or the same pre-processing) in the action class before setting it into the form attribute (and hence, the getter will be free of this processing).

Which one is the recommended way ?

  • 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-01T03:52:51+00:00Added an answer on June 1, 2026 at 3:52 am

    It depends entirely on your needs and the context of what you’re actually doing.

    Actions, however, should be as lean as possible–they exist as the layer between the web page and the business logic. If they’re doing much beyond marshalling data between the layers, something’s wrong.

    There’s no way to answer this question in a general way. IMO getters and setters should be as logic-free as possible, no more, no less.

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

Sidebar

Related Questions

This is basically a math problem, but very programing related: if I have 1
This is basically a duplicate of this question , but the accepted answer was
This is basically the same question as Click items in select box, and then
This is basically a rails 3 version of this question . Short of parsing
I have a comboxbox defined like this (basically): <ComboBox x:Name=pageViewSize> <ComboBox.Items> <ComboBoxItem IsSelected=True>5</ComboBoxItem> <ComboBoxItem>10</ComboBoxItem>
I'm sure someone will help with this: Basically I got a form which on
I have seen this question asked a few times but I have not seen
I asked this question about reasons to use Drupal 7's Forms API as opposed
So I have found this code here This basically lets me pull some data
Basically I have run-time loaded class that looks like this: [Plugin(Plugin name)] class PluginActions

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.