1

I have some 3rd party SPRING MVC application where I have provided links to some content pages in my application, how would I redirect the user to this content pages in my application when the link is being hit from the 3rd party application?

Is their any configuration or security related feature in spring MVC which does this kind of mapping?

I can write a controller to grab the request url and accordingly redirect to content pages, but is there any better solution to the problem ??

  • No one could answer the above problem and let me tell you'll it's not duplicate of any other question on stackoverflow.

For people who could not answer the question and simply pointed that it's duplicate, I have mentioned the answer below to improve their knowledge.

Answer :- Spring my authentication success handler can be extended with SavedRequestAwareAuthenticationSuccessHandler which solves my problem and question....so simple and no one on stackoverflow could get it :)

  • Can you clarify where the link user initially clicks comes from? Is it rendered by your application? Or you do not control how links are created? – Roman-Stop RU aggression in UA Aug 07 '14 at 16:09
  • My application has content pages with links like https://www.abc.com/cms/content/1, https://www.abc.com/cms/content/2, https://www.abc.com/cms/content/3, https://www.abc.com/cmscontent/4 etc. Now, user clicks on link to refer content from my application. The link pattern is like https://www.abc.com/link/1, https://www.abc.com/link/2 etc. Now, I need to map this, for example https://www.abc.com/link/1 to https://www.abc.com /cms/content/1 – user3919131 Aug 07 '14 at 16:46
  • When user will click on link like www.abc.com/link/1 from 3rd party application which has domain like www.ThirdPartyApplication.com he will be redirected to login page of my application which has domain www.abc.com/login.jsp. Now after login, I need to take the user directly to www.abc.com/cms/content/1 rather then redirecting to my application dashboard, which happens in normal case when user logs into the system. – user3919131 Aug 07 '14 at 16:52
  • I can control how links are being created on both the application and as a matter of solution I can even write a controller to grab the request URL and redirect it as I want. but, I want to make this somewhat generic and configurable. – user3919131 Aug 07 '14 at 16:57
  • It's not about URL Rewrite....I have 100+ content pages in my application and I have given links to this pages in another application....both application runs independently and are developed using SPRING MVC. When user will click on link, he should be redirected to my application which has the actual content related to that link. Content id will be present in the link and it will be mapped with the actual content link. – user3919131 Aug 07 '14 at 17:06
  • I still not quite understand 1. why url rewrite doesn't fit? it supports patterns and pretty powerfull 2. if you control links generation why you generate abc.com/link/1 instead of abc.com/cms/content/1 ? – Roman-Stop RU aggression in UA Aug 07 '14 at 17:13
  • I have another scenario, My application sends jobs email to user. Now, when user will click on job link in email he should be redirected to a page in my application which has detailed description about the job. How would you design this and the above content related problem, both scenarios describe the same problem ? I think, URL rewrite would be too heavy to manage. Just imagine, there are 1000+ jobs links send to user. It will tedious to map all this url's. Need some elegant solution. – user3919131 Aug 07 '14 at 17:43

0 Answers0