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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:27:12+00:00 2026-06-03T11:27:12+00:00

Here it goes: I am refreshing a page named index.jsp via this <head> <meta

  • 0

Here it goes:
I am refreshing a page named index.jsp via this

<head>
        <meta http-equiv="Refresh" CONTENT="0;URL=populatefields.action">

</head>

And it is calling my action. here is the mapping in my struts.xml

 <struts>

        <package name="com.action" extends="struts-default">
            <action name="*fields" method="{1}" class="com.action.RegisterAction">
    <result name="populate">/register.jsp</result>
    <result name="fields">/success.jsp</result>
<result name="error">/index.jsp</result>
    </action>

What i did here is on loading of index.jsp, i refreshed it with this url 'populatefields.action'. This calls my action class and the populate method(wildcard method invocation).Populate method picks entry from databases and assign them to form fields properties and returns "populate";Which takes the control to register.jsp with some values filled already.[i.e dynamic filling of a part of form according to the current user]

On register.jsp if some validation check is there like
if(getUssername.equals(""))
{this.addActionerror("Empty field -Uname-"); return error;}

The problem is on return “error” the control goes to index.jsp and then to populate method and automatic fields get populated but populate method does not throw any errors so is empty…or errors are lost …
Any idea how i can access thses errors ? by setting dem global in my action class? The actionerrors comes in index.jsp but i want to refresh that page evry time it loads to pick values form Database…can i take the value of action error from one jsp page to another ?

  • 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-03T11:27:13+00:00Added an answer on June 3, 2026 at 11:27 am

    Done: I never thought it would be that easy.. no need to transfer the values of <s:actionerror/>.But you can do transfer your whole page using <jsp:include page='index.jsp'> if it doesnot refreshes and contains only <s:actionerror/> tag. Like when you use an <a> link to call your action, not in this case that refreshes its way to action.. But in my case i want a refresh so be it:

    Just before when you type return error; copy the contents of your populate method there in your execute method. Such as

    execute{
    if(validation fails){populate method content(leave the return statement); 
      return error;
     }
    else
    return success;
    }
    

    In struts.xml change this <result name="error">/register.jsp</result>rather than <result name="error">/index.jsp</result>

    Also no need to write <s:actionerror> in index.jsp,since you are now redirecting it to register.jsp so just write it in register.jsp…

    Now the refresh funda working that take you to register form..
    Try submitting now if validation fails same page will get called with populated fields 😀 and action errors…

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

Sidebar

Related Questions

Ok here goes. This is my first ever wicket application and I'm trying to
Okay this is definitely a n00b question but here goes. The way I understand
Not sure if this is the correct Stack Exchange website but here goes.. A
Here goes my .htaccess file's content. Options +FollowSymLinks RewriteEngine On RewriteRule ^online-products$ products.php?type=online RewriteRule
OK here goes, This one i find complicated to explain, but I have attached
this is kinda tricky to explain,but here goes....I have multiple hidden divs that swap
This is my first question on here so here goes.... I've got an issue
I am probably thinking about this wrong but here goes. A computer starts spitting
Here goes: I have a view that looks like this: public interface IAddressView {
I'm pretty new to this so here goes... I'm using Visual Studio 05 (C#)

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.