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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:39:25+00:00 2026-05-25T16:39:25+00:00

I am reading a struts2 tutorial on the following url. http://struts.apache.org/2.2.1/docs/message-resource-files.html it explains how

  • 0

I am reading a struts2 tutorial on the following url.

http://struts.apache.org/2.2.1/docs/message-resource-files.html

it explains how to read a value of a property key in a view file, but it doesn’t explain how to read property values in an action class or in a model class.

How do I read a value of a property key in an action or a model class?

  • 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-25T16:39:25+00:00Added an answer on May 25, 2026 at 4:39 pm

    Use the method ActionSupport.getText(String). For example :

    messages.properties

    foo.bar=foobar
    

    struts.xml

    <constant name="struts.custom.i18n.resources" value="messages" />
    

    Action class

    public class TestAction extends ActionSupport {
    
        public void method() {
    
            getText("foo.bar");
    
        }
    }
    

    @Moon : what if I’m not extending ActionSupport?

    For classes not extending ActionSupport, use the following (during run time of Struts2) :

    ActionSupport actionSupport = new ActionSupport();
    actionSupport.getText("foo.bar");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Reading this: http://guides.rubyonrails.org/routing.html#adding-more-restful-actions What does it mean to add a 'member route'? or do
Reading the Google Docs API I find this: Downloading Files cannot be downloaded in
Reading the documentation at http://jersey.java.net/nonav/documentation/latest/client-api.html#d4e704 makes me think that ClientFilter s are processed in
reading excel files from C# working well in 32 bit version server. It is
Reading Java's ConcurrentLinkedQueue Docs , I wonder why it is not possible for the
Reading the following article, I managed to put a legend outside plot. How to
Reading the Python 3.2 tutorial here , towards the end one of the examples
I started reading about struts2 yesterday and came across the below slide. Site link
I'm reading Struts 2 In Action, and, on the chapter five, a conversion.properties file
Reading through the documentation on Apache Tomcat, when I deploy a webapp it copies

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.