settingsLogin | Registersettings
Show Menu

How do I dynamically generate URLs in Spring MVC?

0 votes

I want to be able to open individual employee profiles when I click on their name. This will require a dynamic generation of URLs for individual profile. I'm not being able to do so.

I'm getting the required URL but also an Error 404 saying:

 

"The requested resource is not available."

 

Exactly what am I doing wrong?

asked Jan 3, 2015 by Ashzabin Wadud

1 Answer

0 votes
 
Best answer

Check this highlighted code in one of my projects: 

 

https://github.com/mozammel/bdchub/blob/master/src/main/java/com/livingoncodes/spring/web/controllers/ProfileController.java#L34-L39

 

You can send the username there with get request as a request parameter and read the value from your controller. Then you can get the required object form DB and perform additional tasks. Hope this helps.

 

If you are still confused, check this:

 
answered Jan 3, 2015 by mozammel (540 points)
edited Jan 3, 2015 by mozammel
Welcome to LivingOnCodes QA, where you can ask questions and receive answers from other members of the community.

Most popular tags

...