angularjs - How to url rewrite with Google app engine -- HTML5 mode not working -


i using angularjs, java application. using tomcat run application. when run project open url

http://localhost:8080/projectname

so configured base tag , html5 mode as

$locationprovider.html5mode(true); $locationprovider.hashprefix(''); <base href="/projectname/"> 

with welcome file configured main.html in web.xml , added code

<welcome-file-list>       <welcome-file>main.html</welcome-file>   </welcome-file-list>  <error-page>     <error-code>404</error-code>     <location>/</location> </error-page> 

to make ui-router work html5 mode(mentioned in ui-router issue page).

then change project google app engine standard java project , when run project open url

http://localhost:8080

so changed base tag

<base href="/"> 

with there no problem in main.html routing not working. when use $state.go working. on refreshing or manually entering url i'm getting 404 error. console error is

warning: no file found for: /url 

i referred many blogs still confused configure


i have configured spring in web.xml file

<servlet>         <servlet-name>dispatcher</servlet-name>         <servlet-class>org.springframework.web.servlet.dispatcherservlet</servlet-class>         <load-on-startup>1</load-on-startup>     </servlet>      <servlet-mapping>         <servlet-name>dispatcher</servlet-name>         <url-pattern>/</url-pattern>     </servlet-mapping> 

it seems mapping url request spring, there way solve this?

problem refresh page, if open base , click on link work, need write code re-write url

for iis running application need add:

<system.webserver>     <rewrite>      <rules>        <rule name="main rule" stopprocessing="true">         <match url=".*" />         <conditions logicalgrouping="matchall">           <add input="{request_filename}" matchtype="isfile" negate="true" />                                            <add input="{request_filename}" matchtype="isdirectory" negate="true" />         </conditions>         <action type="rewrite" url="/" />       </rule>     </rules>     </rewrite> </system.webserver> 

see detail iis configuration

sorry, never worked tomcat


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -