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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:37:09+00:00 2026-06-07T09:37:09+00:00

Can I use s:property tag in s:text tag in Struts 2. The issue is

  • 0

Can I use s:property tag in s:text tag in Struts 2. The issue is that, i have a Map in my Action class

Map menuMap = new HashMap<String, String>();
menuMap.put("home()", "lbl.home.home");
menuMap.put("mymodule()", "lbl.home.mymodule");
menuMap.put("adduser()", "lbl.home.adduser");
menuMap.put("changepassword()", "lbl.home.chngPwd");

The Map is having Key/values as a String, Actually values exists in Map are the keys exists in application.properties file please see below
This is my Application.properties file

lbl.home.home                       = Home
lbl.home.adduser                    = Add User
lbl.home.mymodule                   = My Module 
lbl.home.chngPwd                    = Change Password 

Now I want to iterate this map in my jsp and want to get these values, from the properties file, by passing values of map as a key in application.properties file and show them as a label
I am able to get the key but not able to show the values from properties file
This is my Jsp code:

<s:iterator value="menuMap">
 <tr>
   <td>
    <a href="#" onclick="<s:property value="key"/>" ><s:text name="<s:property value='value'/>"/></a>
   </td>
</tr>
</s:iterator>

Now the problem is i am able to see, if i look for page source, a tag and the function name which is called on onclick() but not able to see the text as label. am i missing anything, please help me for 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-06-07T09:37:10+00:00Added an answer on June 7, 2026 at 9:37 am

    It’s actually simpler than what you are trying. Since the text tag is a Struts2 tag, the name attribute supports OGNL expressions, so there is no need to use the property tag to obtain the name, just OGNL:

    <a href="#" onclick="<s:property value="key"/>" ><s:text name="%{value}"/></a>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in my class i have a property with name from but i can't use
I have two methods that basically converts underlying checkboxes' text or tag as CSV
I must use jQuery for first time.... <a class=Tag Resource href=http://localhost/ resource=http://localres/ property=prop>test</a> I've
Is there some CSS property or something that I can use with my anchor
You can use the Filter property of a BindingSource to do SQL like filtering.
Where is the list of the names I can use in the property elements
Is there some event I can use to tell when the SelectedIndices property changes
How can I use jQuery to replace part of the onclick property / attribute?
I would like to format number displayed by <s:property value=summary.total/> tag in Struts 2.
I have a legacy Struts 1.2.8 application that I'm maintaining and porting from Oracle

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.