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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:56:46+00:00 2026-05-28T01:56:46+00:00

To following is something like… pseudo code… To illustrate what I am looking for:

  • 0

To following is something like… pseudo code… To illustrate what I am looking for:

// Setters and Getters ommitted to keep the example short here:
class Address
{
  private String street;
  private String city;
}

class AddressBookEntry
{
  private String name;
  private Address address;
}

class MyController
{
  public void render(@RenderParam AddressBookEntry entry)
  {
    ...
  }
}

As you can see there are two POJOs (Address and AddressBookEntry). Now I would like to pass an AddressBookEntry to my Controller as http request parameter. I imagine that the URL looks like this: /target?entry.name=Random-Guy&entry.address.street=Random-Street&entry.address.city=Random-City.

As far as I understand @RenderParam doesn’t work this way. I would have to create a PropertyEditor that takes a single string and construct my target Object from it, which means that I can’t have an individual URL-param for each (sub-)property.

@ModelAttribute comes closer, but I could not find any hint if and how nesting of objects might work with this annotation. Additionally this annotation works without the “entry.” prefix in my URL above which means that I need to make sure that I don’t have multiple ModelAttributes that share a property name, correct? That sounds stressful.

How can I solve this?

  • 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-28T01:56:47+00:00Added an answer on May 28, 2026 at 1:56 am

    It’s the situation when you should use @ModelAttribute. It supports nested objects as you want.

    If you need multiple @ModelAttributes, you can compose them into special class (for example, it you case that class can contain a field named entry of type AddressBookEntry, so that parameter names will be the same).

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

Sidebar

Related Questions

I have something like the following code: template<typename T1, typename T2, typename T3, typename
I would like to do something like the following: def add(a, b): #some code
I want to do something like following code excerpt in ruby a = MyClass.new
The following code prints something like °Ð½Ð´Ð¸Ñ-ÐÑÐ¿Ð°Ð½Ð¸Ñ getDirectoryContents path/to/directory/that/contains/files/with/nonASCII/names >>= mapM_ putStrLn Looks like
I have something like the following code in one of my views: <?php $this->load->view('_validation_error',
I have something like the following code you see below as a template. what
I was given the following code: accept Something like this: $(input[id^='position_']).change(function() { //get the
I would like to use something like AutoMapper for the following code instead of
I have something like the following line of code: Notification notif = new Notification(R.drawable.notification_XX,
I had something like the following code in a project I recently worked on.

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.