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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:07:42+00:00 2026-06-03T07:07:42+00:00

We are using Struts2 in our Java webapplication. There is a Member table(columns name,

  • 0

We are using Struts2 in our Java webapplication. There is a Member table(columns name, phoneno.etc.,) which is mapped to Address table(columns street, city, zipcode, country) using a mapped table MemberAddress(old code, no chance of changing the member table to add columns of address in it and remove Address table).

When a user want to edit the member profile, he clicks on settings, which directs him to the execute() method of action class. There am getting the address object with the logged in member id. something like the below code.

protected String execute() throws Exception {

    Member loginMember = memberDAO.getLoggedInMember();
    memberId = loginMember.getId();
    if (StringUtils.isNotBlank(memberId)) {
        loginMember = memberDAO.getById(memberId);
        Memberaddress memberAddress =   
                      memberAddressDAO.getByMemberId(loginMember.getId());
        Address newAddress = null;
        if (memberAddress != null && memberAddress.getId() != null) {
            newAddress = addressDAO.getById(memberAddress.getId().getAddressid());
        } else {
            newAddress = new Address();
        }
    }
    return SUCCESS;
}

if the result is Success, it directs to its results page, memberprofile.jsp, which contains input form fields. Here i want to display the existing profile details, including Address object instance variable i.e, street, city, zipcode. How should i get the Member object & Address object in the jsp page. I am trying

<s:set var="address" value="newaddress"/>

and enter its data in the jsp’s input name fields like this.

<input id="addressStreet" type="text"    
 value="<s:property value="#address.addressstreet" escape="false"/>"/>

but I am getting value=”” in firebug. I thing am doing something wrong while retrieving the output.

  • 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-03T07:07:43+00:00Added an answer on June 3, 2026 at 7:07 am

    Well Struts2 will make your life easy and it will take care of transferring your object from action to the ValuStack and all you need to play around with OGNL to get values from the Value-stack.

    I believe you want to place the data in the newAddress object and want to retrieve its value in the respected JSP.
    All you need to define the property in your action class with getters and setters and let S2 fill the object and transfer it to your the valuestack.

    All you need to access the property of the newAddress object in the ValueStack using OGNL like

    <s:property name="addressStreet"/>
    

    When the success result will send back from your action class S2 will place newAddress on the top of Value Stack and we have OGNL to access them.

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

Sidebar

Related Questions

In our Struts2-Spring application we are using the follwoing lines of code access the
I'm working on on a site built using struts2. The vast majority of our
we are using Struts2 in our code and I have scenario where I need
We are currently using the struts2-jquery plugin in our web-application. The plugin works great
Using Struts2, I compute a link in my java code and expose the link's
I am using struts2-jquery grid plugin and would like to know if there's any
Using struts2, is there a way to trigger an action to occur at specified
I using struts2 s:iterate tag. My collection name keeps on changing. So i wants
I am using Struts2, Spring 2 and Junit 4.5. My main question is, whether
I am using struts2 to build a web application and I use struts2 tags

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.