Tomcat in Eclipse: Edit Javascript without redeploying - javascript

I am working on a Java application (which runs on Tomcat) using Eclipse WTP. For development I have configured my tomcat server in Eclipse and use the "auto publish" feature.
This works for .java files (compiled files are getting published).
Its also fine for working in jsp. In this case my edited jsp file is just copied to the server directory without redeploying my application.
However it does not work with javascript files. Everytime i change a .js file my application is redeployed and i have to wait a few seconds.
Is there any tomcat option i am missing?
Thanks

Doubleclick your server in the servers view, click on the tab modules at the lower bound of the servers property window, select your web module from the list, click the edit button, uncheck "auto reloading enabled", click ok, save your settings and restart the server.

Related

Keep getting ERR_HTTP2_PROTOCOL_ERROR when saving to file

The Problem:
I edit an asset file such has .js or .css via my code editor Sublime Editor 3. I then save those files to the server via an SFTP plugin on sublime. Then when I refresh the live website to view changes from my chrome browser (I have a plugin that flushes the browser cache so I see new changes.) I sometimes get a error on the chrome console that reads:
net::ERR_HTTP2_PROTOCOL_ERROR 200
Where the browser is not served the requested file. When I check my log file for Apache I see the following:
[alert] 657967#657967: *188534 pread() read only 7497 of 7498
My server is setup with Nginx running as a Web Server and Reverse Proxy for Apache.
How can I make it so that Nginx does not fail server the requested files even though they were just edited. Maybe sending back cache until it updates the new changes. Please advise because it is driving me nuts and I have no idea how to overcome it.
My workflow for JavaScript consists of me writing code and refreshing the live site to view web console on chrome. I need to be able to view the changes I made from the server via browser. I don't like local environments. I tried to google this topic many times with no luck so any help would be much appreciated.

Need to send information from chrome to external app

I have an app (software in my windows) which I can do whatherver I want with it and I need this app to be notified when some JS code is run inside chrome. Ok this is not easy.
So I came up with this idea: when I want to notify my app (running on my windows) to do something, I just downloaded a cacheable file (using js) to my chrome browser. THEN my app can check every 10 seconds the "C:\Users\PC\AppData\Local\Google\Chrome\User Data\Default\Cache" directory to know if a file with a specific size was created.
This is working flawlessly! But I wonder if you guys would recommend any other method to send a command or anything from JS code running inside chrome to an external app running in windows?

UwAmp server doesn't detect changes that've made in files

everyone!
I'm using UwAmp 3.1.0 for my php development but I had some troubles
with it.
It worked perfectly at the beginning and the server still works
perfectly now but whenever I made a change to a .js file or .php
file it doesn't reflect that change when I update the page in the
browser.
I went to the chrome dev tools and opened the source section to see if the file is exactly what I wanted but it shows the original version which I've amended a while ago. The links to all files are correct and they are in a subdirectory in www folder.
It's so frustrating as I can't see the changes in action. I checked
the syntax and everything is ok but it doesn't want to stop an
animation in jquery after I it was fully shown to the user.
Can you help me with this situation as I have no idea what's causing the problem here?
It should update the file instantly when I click refresh in the
browser but it doesn't and keeps loading the version of the files
that I started to work with.
Uwamp is AMP stack (Apache, MySql and PHP) and "out-of-the-box" it doesn't have anything with caching of files.
Apache is normally reading/getting files from Uwmap www folder "as is" so basically if your last change is saved into file in www folder (please check directly with tools like notepad) Apache will read it instantly.
This is related to your Browser Cache (Empty yours Browser/Chrome cache manually or install Chrome extension like [Clear Cache Extension]:https://chrome.google.com/webstore/detail/clear-cache/cppjkneekbjaeellbfkmgnhonkkjfpdn?hl=en) and try to clear cache but completely ("from begining of time" like Chrome said).
Also a workaround is to click that Empty Cache icon every save before refreshing the page beacuse it will clear it almost instantly (depending on how long time ago have you cleared your cache)
Also try to set OPCache in Php.ini (settings file) in Uwmap to Disabled (locate opcache settings in php.ini and put 0 to disable - you can access it from Uwamp GUI also).

Reading a file from a folder when it gets created using nodejs

Following operations are going to take place :
A text file is created using a java program and it gets stored in a folder
The file needs to be read and displayed in the text box which is present in the browser UI.
For this to happen, the java script needs to check the folder till the text file becomes available and then read it and display it in the text box.
How will the javascript come to know when the text file is available in the folder and how is it going to read it and display it.
We are using Nodejs as the container and Ember Java for the web framework
This is only possible if you run Ember locally rather than served from a web server.
Create an in-repo addon in your Ember app. It will have Node context.
Have the addon watch the folder for changes. Read the file when it's available
Have the addon run a web server that responds with file contents when it's available.
Configure your app for long polling the web server.
If you do need to server the app from a web server, then you're out of luck. You can try running a desktop app on the computer that watches the folder for changes then sends the file contents to the server. Then the app can request the file from the server. That's more elaborate.

how can run and edit locally this Angular website with VS

I am new in Angular things and need to run and edit a angular website. The files I got from the web server (windows Server 2012).
This is the web server directory
Then tried to remote edit the website with Webmatrix, but this did not work because there is no proper debugging.
Now want to run and edit the website locally.
The database i could setup locally. She is the base for the (asp.net mvc) webservice the website runs with.
For edit and debugging the webservice and website structure i want use Visual Studio, but i dont know how to bring in all the files and make them run.
I would use the new VS Code editor. as this is all client side.
https://www.visualstudio.com/en-us/products/code-vs.aspx
and if you create a website in IIS, and copy the code into the WWWROOT directory you will be good to go.

Categories