How to use template url with Rewrite
February 1, 2015 at 6:24 pm #26812
Good day, i am new in your community and have some problems with using your project. I work on Java project with RestFul services, that working with AngularJS. On AngularJS i using template url (i have one basic html page, that contains all style links and different scripts. All other html working with basic html page. They don`t contains main tags), when i open main page it is load all scripts and styles and all page work perfect, but when i try to reload one of additional pages it does not load scripts and styles.
I`m not sure in correctness of using html terminology, so i gave some links to my project.
Main page – https://github.com/MindHeaders/QDump/blob/master/qdump-service/src/main/webapp/login/index.html
Additional page – https://github.com/MindHeaders/QDump/blob/master/qdump-service/src/main/webapp/login/auth.html
Main AngularJS script – https://github.com/MindHeaders/QDump/blob/master/qdump-service/src/main/webapp/login/scripts/app.js
Thank you for your help
February 2, 2015 at 12:36 am #26815
- This topic was modified 2 years, 3 months ago by vlasovartem.
Sorry, but I don’t understand your question. How do you use Rewrite in your project? And how does Rewrite relate to your problem?February 2, 2015 at 3:33 am #26817
I forgot to say, that I am start using html5 for ‘pretty links’, so when I use angularjs with html5 I need server side links rewriter. When using reloading pages my project uses ocpsoft rewrite implementation for redirections links, but i need to rewrite parent page before child page load. And for these needs I chose ocpsoft rewrite.
Thank you for reply.
February 2, 2015 at 5:32 am #26819
- This reply was modified 2 years, 3 months ago by vlasovartem.
Sorry, but I still don’t understand what you are trying to archive. If you are using Angular, all URL stuff is typically done on the client side.February 2, 2015 at 11:05 am #26820
Okay, i try to explain my problem. I have test project that have Java back-end and AngularJS front-end. On AngularJS i activate html5mode. This mode is requiring server side pages rewriter. So for the server side pages rewrite i choose your project. But i have some issues, when i start main page(parent page /login/index.html url http://localhost:8080/) it is load all scripts and style, after that i can navigate throw child pages (example child page /login/registration.html url – http://localhost:8080/reg). Child page not contains any scripts and styles. But when i try to reload registration page it loads only /login/registration.html without any scripts and styles. I thinks that my problem is that first i should reload parent page and then child page. I hope you understand my explanation.February 2, 2015 at 11:45 am #26821
OK, so you say that this page works fine:
But this one doesn’t:
The second page is incomplete. It is just a fragment of an full HTML page. So of cause it doesn’t load any scripts. Because there are no scripts referenced in this file. 😉February 2, 2015 at 12:52 pm #26822
/login/auth.html is loaded inside /login/index.html page. With help of this https://github.com/MindHeaders/QDump/blob/master/qdump-service/src/main/webapp/login/scripts/app.jsFebruary 3, 2015 at 3:18 am #26828
Ok, so the files are merged on the client side?
You say “scripts are not loaded”. This problem description is not very helpful. Does the browser try to fetch the files? What do you get? A 404? Or something else.
I’m not very familiar with Angular. So we should try to solve the problem by examining what happens on the HTTP request level.February 4, 2015 at 5:51 pm #26849February 5, 2015 at 6:05 am #26850
Thanks you. I solved my problem, it was my mistake 🙂
You must be logged in to reply to this topic.