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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:56:42+00:00 2026-05-25T14:56:42+00:00

I need to stay on the same page after Item update, but I need

  • 0

I need to stay on the same page after Item update, but I need the item id to know where to go on success. I tried a few examples:

First one:

    <action
        name="add-item"
        method="addItem"
        class="com.deveto.struts.actions.ItemsAction" >
        <interceptor-ref name="defaultStack"/>
        <result name="success" type="redirectAction">
            <param name="actionName">show-update-item</param>
            <param name="itemId">${itemId}</param>
        </result>
    </action>

Second one:

    With an Action variable and setter & getter methods.

and

    <action
        name="add-item"
        method="addItem"
        class="com.deveto.struts.actions.ItemsAction" >
        <interceptor-ref name="defaultStack"/>
        <result name="success" type="redirectAction">show-update-item</result>
    </action>

Third one:

    With request.setAttribute("itemId", itemId); and request.getAttribute("itemId");

and

    <action
        name="add-item"
        method="addItem"
        class="com.deveto.struts.actions.ItemsAction" >
        <interceptor-ref name="defaultStack"/>
        <result name="success" type="redirectAction">show-update-item</result>
    </action>

Fourth one:

    With an Action variable and setter & getter methods.

and the type=”chain”

    <action
        name="add-item"
        method="addItem"
        class="com.deveto.struts.actions.ItemsAction" >
        <interceptor-ref name="defaultStack"/>
        <result name="success" type="chain">show-update-item</result>
    </action>

Eventually the Action is one, show-update-item.action.

But all of this is giving me the same null result.

Any advices?

Ex: show-update-item.action?itemId=33 (getParameter of itemId) -> editing some textfields -> submit (with itemId=33 in request) -> on succes redirectAction -> show-update-item.action (here when I try to getAttribute it is null)

  • 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-25T14:56:42+00:00Added an answer on May 25, 2026 at 2:56 pm

    If I understand correctly you’re staying on the same page with a different action after an item is selected on the first action. If this is the case, your first action definition should work:

    <action
        name="add-item"
        method="addItem"
        class="com.deveto.struts.actions.ItemsAction" >
        <interceptor-ref name="defaultStack"/>
        <result name="success" type="redirectAction">
            <param name="actionName">show-update-item</param>
            <param name="itemId">${itemId}</param>
        </result>
    </action>
    

    Now that being said, you need to make sure you have accessor methods in both actions (we’ll call them action 1 and action 2) for itemId.

    In action 1 ${itemId} is being retreived through the getter and in action 2 ${itemId} should be set through the setter method.

    Another option would be to consider using sessionaware. Simply set a session variable in action 1 and in action 2 retrieve the session variable and remove it from session if you’re concerned about overhead. I tend to use session more often than not.

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

Sidebar

Related Questions

I need to display a page inside of a page, like an iframe, but
Sorry i really don't know how to code in PHP but i need to
I need to calculate the quantity of nights (stay at a hotel) from the
HELP!! I need to bundle a gem otherwise a published client's site will stay
I need make system call from method of Ruby of Rails , but I
Imagine you have one page app using Javascript MVC, which should switch between sub-apps
I am solving how to pass values from one page to another without making
This is a tricky one, for me at least. I have a page that
I have a one page website that uses AJAX to load new php files
I need a PHP page that will take an image and resize to how

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.