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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T04:49:23+00:00 2026-06-01T04:49:23+00:00

I am doing one project on Struts 2 that I am getting knowledge little

  • 0

I am doing one project on Struts 2 that I am getting knowledge little by little bit..

I have the action like this

<action name="backaction" class="HandlerAction">

<result name="user_profile" type="redirect">hai.jsp</result>

In the class Handler action I have the object userprofile in which the name and age are members.

In the execute function

log.info(userprofile.getName())//it is giving name xyz

return "user_profile"

I am getting hai.jsp but I am unable to retreive the value in that object userprofile in jsp.

hai.jsp is as follows..

<%@taglib prefix="s" uri="/struts-tags"%>
<html>
<body>
<s:textfield name="user_name" value="%{userprofile.name}"/>

</body>
</html>

I tried by putting as value="%{name}" also but i am not getting the value xyz..

  • 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-01T04:49:25+00:00Added an answer on June 1, 2026 at 4:49 am

    The problem is with

    <result name="user_profile" type="redirect">hai.jsp</result>
    

    since you are using redirect result type which means that framework will create a new Request and response object and discarding old request/response Object.So when you are returning from your action your user-object is theirs in the value stack till you tell S2 that you want to use redirect result type.

    On seeing redirect result type, it will discard any existing data and will create a new request for you place its content in value stack and that’s why this is not working for you.I am not sure why you using redirect result type since you can do the same using any build in result type say success.

    If you still want to use redirect result, i suggest you to save the user-profile data in either Session and retrieve it in your next action or use scope-interceptor

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

Sidebar

Related Questions

I have made one project in java. Now in this particular module, i am
I am very new to grails.I am doing one sample project for image uploading
I'm about to start a project where I will be the only one doing
For an art project, one of the things I'll be doing is zooming in
i am doing one small application , wheich have login functionality, in the user
Before I have tried about doing one attachment (upload) for each record of my
When doing databinding does one have to implement INotifyPropertyChanged on the datacontext in WPF?
I'm in a project that takes the Single Responsibility Principle pretty seriously. We have
Hi i am doing one project,I failed to display two listViews in a SingleActivity,
Hi I am doing one project in JSP with Google application engine. Now 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.