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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:06:45+00:00 2026-06-04T06:06:45+00:00

In my struts2 application i want to define a global configuration part and want

  • 0

In my struts2 application i want to define a global configuration part and want to use it where needed.
To clarify let me share one action definiton below;

<action name="do_login" class="xxx.actions.AuthAction" method="doLogin">
        <result name="success" type="json">
            <param name="noCache">true</param>
            <param name="contentType">text/html</param>
            <param name="excludeProperties">actionErrors,actionMessages,errorMessages,errors,fieldErrors,locale,texts,action,username,password,errorCode,errorMessage,session</param>
            <param name="ignoreHierarchy">false</param>
        </result>

        <result name="error" type="json">
            <param name="noCache">true</param>
            <param name="contentType">text/html</param>
            <param name="excludeProperties">actionErrors,actionMessages,errorMessages,errors,fieldErrors,locale,texts,action,session</param>
            <param name="ignoreHierarchy">false</param>
        </result>
    </action>

as you can see, in result definitions there are some repeating parts which are;

<param name="noCache">true</param>
<param name="contentType">text/html</param>
<param name="excludeProperties">actionErrors,actionMessages,errorMessages,errors,fieldErrors,locale,texts,action,username,password,errorCode,errorMessage,session</param>
<param name="ignoreHierarchy">false</param>

i want to define this repeating parts globally at the beginning of struts.xml file and use it in each result definition like;

<result name="success" type="json">
    {include global definition here}
</result>

i know it is possible to split struts.xml by packages or actions, but i’m wondering it is possible to do above my need?

thx in advance for any response.

  • 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-04T06:06:47+00:00Added an answer on June 4, 2026 at 6:06 am

    Struts2 doesnt have anything for global parameters though they have for global result type,

    so you can very well have both success and error as global result and use them.

    They have something called as static parameters which is for Action class but not for result type as you need.

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

Sidebar

Related Questions

I make extensive use of Struts2 in my application. Now I want to add
I want to implement delete functionality using checkboxes in my struts2 application. I'm using
I needed to create an application using Struts2 as MVC,Hibernate for data access and
I use tomcat. I am developing a web application using struts2, and I use
I am using struts2 to build a web application and I use struts2 tags
I want to send my JSON object from Javscript to Struts2 Action. Sample JSON
I want to check deploying procedure of my struts2 web application developed using eclipse
I am working on struts2 application. I have getter/setter in my action class. Now,
Im developing a web application(J2EE,Struts2,JSP,Tomcat) I want to hide the .jsp extension from webpages.
I have developed a web application on Struts2 and used JSP. I want to

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.