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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:41:16+00:00 2026-05-24T01:41:16+00:00

struts 1.x I have always defined a struts form action mapping with scope=request unless

  • 0

struts 1.x

I have always defined a struts form action mapping with scope=”request” unless forced into session. An Example:

    <action
                path="/hello/my/oldfriend"
                type="com.imFine.HowAreYouAction"
                name="greetingActionForm"
                scope="request"
                validate="true"
                input="/the/front/door">
                <forward
                    name="success"
                    path="/go/get/drinks.do" />
            </action>

If I convert this action mapping from request scope to session scope, then I almost always see a performance decrease. What are the extra method calls to the struts servlet that cause the extra workload for session scoped form beans?

  • 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-24T01:41:17+00:00Added an answer on May 24, 2026 at 1:41 am

    There is indeed a difference in how the ActionForm is handled when request scoped or session scoped.

    For request scope, when the user submits the HTML form, Struts instantiates your ActionForm, binds the request parameters onto it, then places it in request scope with a request.setAttribute(...) for the view to consume. Once the request has been handled, the ActionForm disappears (subject for garbage collection) because all data of the request is now out of scope. Each new request causes the ActionForm to be created, used and destroyed.

    For session scope, when the user submits a form, Struts tries to find an ActionForm inside the session. If it finds one, it uses it and binds the request parameters onto it. If it does not find one it creates one and places it into session with session.setAttribute(...). Once the request has been handled the ActionForm remains in session and for further requests it is reused.

    The above should not cause significant performance overhead.

    A session means data on the server for each user of your application. This data means memory. More users means more memory. Servers usually move this data on persistent storage when there is more user data than memory can handle. The session data is serialized on disk when not needed and then deserialized when needed again (a database is another storage type for the data).

    Maybe this is what happens. Not enough memory and the server stores/restores it on disk causing IO operations which are slower than memory access.

    How Struts handles the forms depending on specified scope might be a red herring. Check your session first.

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

Sidebar

Related Questions

I have a html form with action attribute pointing to struts action Here is
I have a Struts + Velocity structure like for example, a Person class, whose
Say I have a struts.properties file with a defined value uploads.directory . How can
I have a struts action receiving following JSON: { commandId:tC, id:123, def: } Following
I have a Struts 2 action returning a JSON result. {columns:[coupon,CM,CM+1,CM+2,CM+3],couponList:[{coupon:3.0,CM:88.2323,CM+1:89.45,CM+2:132.3128125,CM+3:32.82},{coupon:3.5,CM:25,CM+1:3125,CM+2:333,CM+3:5}],Caption:30 Yr Fixed} I
I have Struts 2 configured to redirect any java.lang.Exception to a special Action which
I have a struts and hibernate project, From the action class, I need to
I'm using Spring and struts and have the following entry in '/META-INF/context.xml' <Context cachingAllowed=false
I have a Struts (1.3x) ActionForm that has several String and boolean properties/fields, but
We have a Struts 2 web application that's used by pretty much every employee

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.