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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:23:01+00:00 2026-05-27T01:23:01+00:00

I have 2 variable in my action class, id1 and id2 . Joined by

  • 0

I have 2 variable in my action class, id1 and id2. Joined by a _, they’re used as a map key.

I am not able to retrieve the map value using this code:

<s:property value="%{mymap[id1_id2]}" /> 

How should I retrieve the map value?

  • 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-27T01:23:02+00:00Added an answer on May 27, 2026 at 1:23 am

    The expression id1_id2 in OGNL will assume the presence of a variable named id1_id2, since it’s a perfectly legal identifier.

    If you want to concatenate strings, you’d need:

    <s:property value="%{mymap[id1 + '_' + id2]}" />
    

    I’d likely create a separate variable to use as the key:

    <s:set var="mapKey" value="%{id1 + '_' + id2}" />
    <s:property value="%{mymap[#mapKey]}" />
    

    Or more likely, I’d do it somewhere besides the view layer.

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

Sidebar

Related Questions

I have a controller with an action and a variable like this: class AccountsController
<action name=Locator method=execute class=LocatorAction> <result name=success>/locator/StoreInfo.jsp</result> </action> I have a variable foo in LocatorAction
I have a variable of type Hashmap <String,Integer >. In this, the Integer value
I have a set of class instances which have a BOOL instance variable called
I have a custom class, and that class has a UIButton instance variable. I
I have two classes: Action and MyAction . The latter is declared as: class
I have a result jsp page, which print the string variable of java class.
I have a class that creates a List<Action<int>> and holds on to them until
I'm not really sure if I'm using the WebImage class correctly. I have a
I have a class with an overloaded method: MyClass.DoThis(Action<Foo> action); MyClass.DoThis(Action<Bar> action); I want

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.