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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:18:22+00:00 2026-05-27T12:18:22+00:00

Is there any sample code where I can see the use of scope interceptor

  • 0

Is there any sample code where I can see the use of scope interceptor in Struts2? I want to pass a parameter from one action to other action (configured through struts.xml) & want to use scope interceptor.

Since I’m new to Struts 2, can any one provide sample of using scope interceptor?

  • 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-27T12:18:22+00:00Added an answer on May 27, 2026 at 12:18 pm

    I believe this is very well described in the Struts2 documentation.hers is all you have to do

        <action name="scopea" class="ScopeActionA">
                    <result name="success" type="dispatcher">/jsp/test.jsp</result>
                    <interceptor-ref name="basicStack"/>
                    <interceptor-ref name="scope">
                        <param name="key">funky</param>
                        <param name="session">person</param>
                        <param name="autoCreateSession">true</param>
                    </interceptor-ref>
                </action>
    
    <action name="scopeb" class="com.mevipro.test.action.ScopeActionB">
                <result name="success" type="dispatcher">/jsp/test.jsp</result>
                <interceptor-ref name="scope">
                    <param name="key">funky</param>
                    <param name="session">person</param>
                    <param name="autoCreateSession">true</param>
                </interceptor-ref>
                <interceptor-ref name="basicStack"/>
            </action>
    

    All you need to take care is that, you have a getter in ActionA and and a similar setter in actionB. Also, you should use a key parameter to make sure you tell Struts2 which action gets which objects

    read this official documentation for detail
    Struts2 Scope Interceptor

    I will prefer Scope Interceptor only when i have to develop a wizard like functionality as it will handle other things like session-level locking.
    If this is not your requirement there are other way to pass parameters like putting object in Session and getting object from session at second action

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

Sidebar

Related Questions

Is there any utility (or sample source code) that truncates HTML (for preview) in
Are there any sample applications avaliable that make use of both caliburn and prism?
I just got my azure invitation code...yay! Are there any official samples for windows
I need a simple app to edit database tables. Are there any code generators
As a follow up question to my last one , is there any simple
in my code I use HANDLE s from windows.h . They are used like
I want to know if there is any easy/elegant way to determine the source
Is there any simple algorithm to determine the likeliness of 2 names representing the
Is there any simple way to programatically colorize images in .NET? Basically we have
Is there any simple way to generate a default crud (given an entity) with

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.