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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:47:11+00:00 2026-05-18T02:47:11+00:00

Hi I have a struts 1.X app, and in order to show errors detected

  • 0

Hi I have a struts 1.X app, and in order to show errors detected in an action class, I use:

errors.add("Error Global", new ActionMessage("some_string_in_properties_file"));

Which works just fine.

My problem is that now the string I need to send to the jsp page as error has a session variable in it (like “You have 3 more valid attempts”, being 3 the session variable).

How can I accomplish this ?

Thanks.

  • 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-18T02:47:11+00:00Added an answer on May 18, 2026 at 2:47 am

    Try to use ActionMessage constructor of 2 arguments. According to JavaDoc:

    public ActionMessage(java.lang.String key,
                         java.lang.Object value0)
    
    Construct an action message with the specified replacement values.
    
    Parameters:
        key - Message key for this message
        value0 - First replacement value
    

    In your case:

    errors.add("Error Global", new ActionMessage("some_string_in_properties_file", sessionVariable)); 
    

    some_string_in_properties_file should look like this:

    some_string_in_properties_file=You have {0} more valid attempt(s)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a struts app with a jsp with the code: <input name=inrofol class=inputfilter
I inherited this gigantic legacy Java web app using Struts 1.2.4. I have a
I inherited this gigantic legacy Java web app using Struts 1.2.4. I have a
I have a Struts + Velocity structure like for example, a Person class, whose
I have a J2EE Struts app deployed on Weblogic 10.3. When clicking on one
I have recently inherited a J2EE Struts web app that was written back in
It's a Struts application. I have to show some dynamic date in the left
I have a new web app that is packaged as a WAR as part
I'm trying to have my Struts2 app redirect to a generated URL. In this
I have a Struts (1.3x) ActionForm that has several String and boolean properties/fields, but

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.