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

  • Home
  • SEARCH
  • 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 6045899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:10:34+00:00 2026-05-23T07:10:34+00:00

My Problem is that the action’s variables are not being populated after it is

  • 0

My Problem is that the action’s variables are not being populated after it is triggered from the interceptor using invocation.invoke. What i know is that before using an interceptor , it worked properly (From a .jsp i submitted a form and an action is called and every variable was populated)

Interceptor class:

public String intercept(ActionInvocation invocation) throws Exception {

    final ActionContext context = invocation.getInvocationContext();
    HttpServletRequest request = (HttpServletRequest) context.get(HTTP_REQUEST);
    HttpSession session = request.getSession(true);
    Object user = session.getAttribute(Constants.USER_HANDLE);

    if (user == null) {
        String signUp = request.getParameter(Constants.SIGN_UP);

        if (!StringUtils.isBlank(loginAttempt)) {
            if (processLoginAttempt(request, session)) {
                return "login-success";
            }
        } else if (!StringUtils.isBlank(signUp)) {
            return invocation.invoke();
        }
        return "login";
    } else {
        return invocation.invoke();
    }
}

Struts XML file :

<package name="defaultPackage" extends="struts-default">

    <interceptors>
        <interceptor name="login" class="com.spiddan.LoginInterceptor" />
        <interceptor-stack name="defaultStack">
            <interceptor-ref name="login"/>
        </interceptor-stack>
    </interceptors>

    <default-interceptor-ref name="defaultStack"/>
    <default-action-ref name="index"/>

    <global-results>
        <result name="login" type="redirect">/logIn.jsp</result>
        <result name="login-success" type="redirect">index</result>
    </global-results>

    <action name="addUserAction" class="com.spiddan.action.UserAction" method="addUser">
        <result name="input">/logIn.jsp</result>
        <result name="success">/index.jsp</result>
        <result name="error">/error.jsp</result>
    </action>

Action class :

public class UserAction extends ActionSupport implements ModelDriven {

private User user;
private int tempGender;
private String confirmPassword;
private UserDAO userDAO;
private PasswordEncrypter passwordEncrypter;

public Object getModel() {
    return getUser();
}

public String addUser() throws Exception {

}

 //Getter and setters ect 
  • 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-23T07:10:34+00:00Added an answer on May 23, 2026 at 7:10 am

    You’ve specified only your custom interceptor in your code and have excluded all the other Struts2 default interceptors. Try this instead:

    <interceptors>
        <interceptor name="login" class="com.spiddan.LoginInterceptor" />
        <interceptor-stack name="defaultStackModified">  <!-- name doesn't override existing defaultStack-->
            <interceptor-ref name="defaultStack"/>       <!-- include the defaultStack this way--> 
            <interceptor-ref name="login"/>
        </interceptor-stack>
    </interceptors>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using libxml2 for SOAP-Actions in an iPhone App. The big problem is that
I have a problem that confuses my users, being that although an item is
I have the problem that my code isn't triggering the action in my backing
I need to create and action that returns whether or not the user's session
I have a controller action that is being executed by a link that was
I have an update action that I post to using jquery serialize() public ActionResult
One problem that I come across regularly and yet don't have a solution to
A problem that we need to solve regularly at my workplace is how to
The problem that I am having has to do with the need to keep
A problem that has frequently come up in my career is I have some

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.