I have a jsp based web application.
The source is kept in C:/MyApp/src. Here it contains the controllers and other .java files.
After building the application via eclipse. I copied the .war file to Apache/WebApps folder. Apache Tomcat expanded it and the web-application is working perfectly.
From the last couple of days I edited a lot of pages directly in Apache/WebApps folder. Now I want to edit a .java file in C:/MyApp/src/..
Now I want to use that updated .java file in my Apache/WebApps but don’t want to rebuild the whole code via eclipse. If I do so my changes that I made in Apache/WebApps folder will be lost.
What should I do?
Follow the changes as suggested by @bpgergo or else …
You can configure your tomcat server with Eclipse and are starting and stopping the server from eclipse then you can
add your projectto the configured Server in eclipse.Eclipse can be configured to auto-deploy the changes to the server, so whenever you change anything like a JSP or a java file the server will automatically take the changes without you deploying your WAR file.
But since java changes are not hot-deployable eclipse would restart the server whenever you save changes to your java file.
If you want to deploy java changes without restarting the server you can also try using JRebel (it is free for 30 days :-)).
For now I would suggest (if you don’t want to go the above mentioned way. The following is a very crude method and should be avoided in the future)
.javafile into a.classin eclipse..classfile to the exact location on the server inWEB-INF/classes/...javachangesHope this helps.