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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T21:16:08+00:00 2026-06-07T21:16:08+00:00

In my application I have configured Session interceptor for the actions in Default package

  • 0

In my application I have configured Session interceptor for the actions in Default package (i.e. actions with result type JSP or tiles). Is there any option to configure Interceptor for actions in JSON package. i.e. Action classes with JSON results.

Here is my Struts.xml

<struts>
    <constant name="struts.devMode" value="false" />
    <package name="default" extends="struts-default">
        <result-types>
            <result-type name="tiles" class="org.apache.struts2.views.tiles.TilesResult" />
        </result-types>
        <interceptors>
            <interceptor name="sessionInterceptor" class="com.dar.session.SessionInterceptor" />
            <interceptor-stack name="myInterceptorStack">
                <interceptor-ref name="defaultStack"></interceptor-ref>
                <interceptor-ref name="sessionInterceptor"/>
            </interceptor-stack>
        </interceptors>
        <action name="createCampaign">
            <interceptor-ref name="myInterceptorStack"></interceptor-ref>
            <result type="tiles">createCampaign</result>
        </action>
    </package>
    <package name="example" namespace="/" extends="json-default">
        <result-types>
            <result-type name="json" class="com.googlecode.jsonplugin.JSONResult"/>
        </result-types>
       <action name="peopleCountAction" class="com.dar.business.BusinessSearchAction" method="findPeopleCount">
            <result name="success" type="json">
                <param name="includeProperties">peopleCount</param>
            </result>
       </action> 
    </package>
</struts>
  • 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-07T21:16:09+00:00Added an answer on June 7, 2026 at 9:16 pm
    <struts>
    <package name="default" namespace="/" extends="json-default">
        <interceptors>
            <interceptor name="SecurityInterceptor"
                class="com.i2c.cportal.framework.interceptors.SecurityInterceptor"/>
            <interceptor name="cacheInterceptor"
                class="com.i2c.cportal.framework.interceptors.CachingInterceptor"/>
            <interceptor-stack name="jsonStack">
                <interceptor-ref name="defaultStack"></interceptor-ref>
                <interceptor-ref name="SecurityInterceptor"></interceptor-ref>
                <interceptor-ref name="cacheInterceptor"></interceptor-ref>
            </interceptor-stack>
        </interceptors>
    
        <default-interceptor-ref name="jsonStack"></default-interceptor-ref>
        <default-action-ref name="defaultAction"></default-action-ref>
        <action method="getJsonOfOrders" name="getJsonOfOrders" class="sample.SampleAction">
            <result type="json" />
        </action>
    </package>
    </struts>
    

    It will work you just have to define stack and use and remember to use default stack else SessionAware session will become null if you are using it.

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

Sidebar

Related Questions

We have a WebSphere Application Server 6.1. Session management is configured with replication and
I have configured my application to use the Service configuration Local in the development
I have configured my application to use form based authentication and set up the
The application I have inherited is configured by a properties file passed in with
In my urls file I have configured the Django admin application to run off
Hi i am testing android E-mail application . I have configured an Exchange account
I have MVC application configured to use Forms Authentication. I'm signing out users by
In have my application configured in asp.net. I am using ajaxcontroltoolkit. After building the
I have a flex application which is configured with blazeds sever and i am
I have a portlet application. It is configured using Spring framework IoC container. I

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.