0

I have this situation where the links are generated by the backend like this with .xhtml extension. User can just visit this link which they are given and I need to get the 1234 from 1234.xhtml and query the database with that. Getting the query param is clear. But the router doesn't parse this url. It throws error saying "Cannot GET /1234.xhtml". Imperative routing does work. So this is a browser or server related problem. How to resolve this?

My route is:

{path:':id', component:SomeComponent},

enter image description here

Parth Chokshi
  • 642
  • 4
  • 16

2 Answers2

0

I don't think that is a browser or server issue. Are you enconding your parameter? Because . char is translated to %2Eand without no enconding probably your application is trying to serve the xxxx.xhtml file

Tinwor
  • 7,765
  • 6
  • 35
  • 56
  • No. I don't have any controls on anything. It is just backend generate this links. User just hit that url, I parse that url, get the number and serve the dynamic data accroding to that number. – Parth Chokshi Sep 28 '16 at 22:02
0

So in the barebone application with Angular 2 running without backend, it was giving me this error. But as soon as I connected the backend. It works fine as intended.

Parth Chokshi
  • 642
  • 4
  • 16