Generator-jhipster: HTML 5 Mode

Created on 3 Dec 2016  路  8Comments  路  Source: jhipster/generator-jhipster

Overview of the issue

Issue with URL in HTML 5 mode

Motivation for or Use Case

I have followed the instructions at

https://jhipster.github.io/tips/010_tip_configuring_html_5_mode.html

to enable HTML 5 mode. It works perfectly for the URLs like this..

localhost:8080/path1

AngularJS forward controller takes of redirecting when I hit this URL in browser directly. It doesn't work for the URLs like this.

localhost:8080/admin/path1
localhost:8080/admin/path2

JHipster Version(s)

Using Latest 3.12.0.

Browsers and Operating System

Mac OS X / Latest Chrome.

Most helpful comment

@parmarsanjay Thanks for the fix. Just a heads up that your solution works for /admin/path but not /admin/path/path2. I tested @RequestMapping(value = "/**/{[path:[^\\.]*}") and it works for any number of / https://github.com/jhipster/jhipster.github.io/pull/362

All 8 comments

My Bad. This was simple REGEX configuration. I changed AngularJS Forwarder request mapping to following and it worked.

@RequestMapping(value = {"/{[path:[^\.]}", "//{[path:[^\.]*}"})

@parmarsanjay Thanks for the fix. Just a heads up that your solution works for /admin/path but not /admin/path/path2. I tested @RequestMapping(value = "/**/{[path:[^\\.]*}") and it works for any number of / https://github.com/jhipster/jhipster.github.io/pull/362

Great. Thanks @ruddell. This worked.

Any idea what needs to happen on Gulp Serve side? It works when I launch the gulp serve. After this if i change my files, files don't load in browser. It say "Cannot GET".

Does it work without gulp serve, if you go directly to localhost:8080? Might be an issue with the gulp proxy configuration

@jdubois Yes. It works fine with localhost:8080. It seems to be an issue with gulp proxy / browsersync config.

OK, so there is something that needs to be updated here in the tip.
And this will need to be also updated for our soon-to-be-released Angular2 version, as there is no Gulp anymore :-)

Any update here? I'll be happy to update our config, but without any news I'm closing this, as this on our soon-to-be legacy 3 release, and we'll see how it goes with Webpack. Anyway, this isn't supported by default, so it's not really a bug.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Steven-Garcia picture Steven-Garcia  路  3Comments

pascalgrimaud picture pascalgrimaud  路  3Comments

kaidohallik picture kaidohallik  路  3Comments

dronavallisaikrishna picture dronavallisaikrishna  路  3Comments

RizziCR picture RizziCR  路  3Comments