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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:57:42+00:00 2026-06-04T21:57:42+00:00

I am new to struts2 and going thru struts2 in action where i came

  • 0

I am new to struts2 and going thru struts2 in action where i came across the statement that says valuestack is the stack of object and statements where it discuss
how resolution takes place when two objects having same property names are stored on value object. To clear this,I started looking
into how it is implemented in struts2. When i went to last level , i found struts2 simply inserting the object at zero position inside push method similarly
during peek, it gets the object from zero postion. So as per my understanding under struts2, value stack is going to contain only one object (and that will be
action object). Is that correct? If it is not correct when can we have scenario where we can store more than a object in valuestack apart from action object?

Also i came up about some fundamental question about stack when i went thru stack at http://en.wikipedia.org/wiki/Stack_(abstract_data_type). It is stated
there that In computer science, a stack is a last in, first out (LIFO) abstract data type and linear data structure and characterized by two fundamental operations, called push and pop
. I agree that datastructure that involves push and pop operation classifies for stack. But got doubt about LIFO stuff.When i see array implementation in java(which is
also stack and stated at the same link), as per my understanding it does not follow the LIFO as we can access any element thru index not necesseraly last element
has to come out. Dont flame me if am wrong as this is the notation i have. If this correct can we say stack does not have to be compulsory LIFO only it should confirm push and pop operation?

  • 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-04T21:57:43+00:00Added an answer on June 4, 2026 at 9:57 pm

    No, the value stack will not contain a single object under almost all circumstances, and it wouldn’t be much of a stack if it only allowed a single object.

    When you insert an object at position 0, it’s a push–the object previously as position 0 will then be at position 1, etc. It’s a normal push, using the insert method.

    Essentially all normal action invocations will have multiple objects on the stack. This is trivially demonstrable using either the <s:debug> tag (image below), or by dumping the stack. In addition, the <s:push> tag will add objects to the stack on a JSP page, interceptors can add objects, etc.

    Your observation about stacks being LIFO is interesting, but ultimately irrelevant: normal stack operations (push, pop) are what make it LIFO. This doesn’t preclude a stack implementation from offering additional access modes.


    debug tag value stack dump

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

Sidebar

Related Questions

I have an action in struts2 that will query the database for an object
In struts2 version 2.1.x there is a new UnknownHandler that kicks in when a
I am new t struts2. i built one page, that shows list of employees.
I have a struts2 action that builds a form and pre-populates the fields with
hi I am new in Struts2 and want to send parameter from one action
My questions are: In Struts2, does every action object have its own corresponding ActionContext
I'm new to struts2 and confused by the '#','%' and '$' element. There are
I'm relatively new to Struts2. I've started using ModelDriven to reduce overhead in development.
I am familier with jQuery,Ajax and JSP Servlets but new to Struts2.I want to
I'm developing new web app with Struts2 framework, eclipse, and I've mapped the db

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.