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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:36:04+00:00 2026-06-11T02:36:04+00:00

I was thinking about adding a new Interface (like validationAware, etc.) for sturts 2.

  • 0

I was thinking about adding a new Interface (like validationAware, etc.) for sturts 2. The methods of the interface would be methods that sets specific parameters that has to be present inside the request.

For example, consider this Interface :

    public interface MyCustomInterfaceForActions {

        /**
         * Set a specific parameter into the request 
         */
        public void setMyParameter1InRequest(HttpServletRequest request, String myParameter);

        /**
         * Sets another specific parameter into the request 
         */
        public void setSecondParamInRequest(HttpServletRequest request, String myParameter);

    }

The thing is that I don’t want to have to “call” the method “setParameterInRequest” in “execute” methods of each actions that implements that interface.

Also, I want to “force” the actions to set specific parameters into the request.

Is there a way to do that without having to call the “set” methods inside all “executes” methods of my actions? For example, can I extend a struts’ “actionExecutor” (I made that name up) and change it’s behavior to check if the class implements “MyCustomInterfaceForActions” and call the “set” methods if it’s the case?

Or better yet, just check to see if the interface is implemented and just add those parameters to the request anyway, without having to implement methods?

  • 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-11T02:36:06+00:00Added an answer on June 11, 2026 at 2:36 am

    Why not simply use the Preparable, interface. This way you can do your initialization in the prepare() method?

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

Sidebar

Related Questions

Just thinking about the best way to build an Order form that would (from
Thinking about avoiding code replication, I got a question that catches me every time
I am thinking about making a program that will need to send input and
How do I go about adding a new class attribute for each for my
Here's something that I've been thinking about for some time. I want to chain
I've been thinking for a while about modeling typical ecommerce site with ebay-like taxonomy
Thinking about if we modify the definition of Hamiltonian path as we need to
Im thinking about to use a DB for my logs instead of a normal
Im thinking about building an application on our website to track order places through
Been thinking about this for hours now. Im building a simple slideshow application, where

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.