Webcontent code modified from eclipse not updating - eclipse

I have java source code of about 3000 classes & other web content (js, css, html). I imported the project in eclipse(indigo) and run the project on Tomcat6. After ant compile.complete.deploy, a new folder ${env.CATALINA_HOME}.
I am modifying few js & html files from IDE, but it doesn't reflect in the browser. I reloaded the page several times, but no changes are done.
In Project -> Buildautomatically option is checked.
Do i need to modify on the files in ${env.CATALINA_HOME} or the direct src code is fine?

For all the UI related content - Webcontent folder files needs to be changes. And when new class files are added or existing classes are modified then "ant smartbuild" does fine.
--
thanks.

Related

Add external html and css file in a servlets project created in eclipse

I have a servlets project called LoginPortal. In this project, I intend to add an html called login.html and a css file called login.css . I added them to Webcontent folder which is where I added other html files that I created in project it self.
Besides login.html and login.css, all other files were created n the project only and so work just fine.
The directory structure now looks like this:
However , I still get 404 error when I try to access this html file added externally :
URL :http://localhost:8080/LoginPortal/login.html
What could be the possible reasons ?
Eclipse seems to maintain a list of files which it will be deploy to target server when changed.
Since, you added those files externally and eclipse does not know about them yet, it will not deploy this files when changed.
You can do this. after adding this files externally go to eclipse project explorer. Refresh your project from your context menu(Right click -> refresh). This will include the file you added and get listed.
The files will be added instantly when ever there is a changes, and is reflected in the output.

Eclipse src folder empty

So for my class I need to use eclipse to do some graphics stuff in Java. I've tried both Eclipse standard 4.4 and Eclipse for Java developers, but with both when I tried to create a new Java project, the src folder is completely empty. Why is that?
Edit: I should add in more information. In the lab section of my class I was able to follow the instructions and create a lab 1 project src folder, which contains many files such as Lab1.java, Polygon1.java and all that. When I am trying to do it on my own machine, it's not working
Because it's a blank canvas!!
Right click on the src file New->Class
Give the new class a name and a package and you're away, you can start coding.
If you want to include libraries create a new lib folder at the same level as the src folder and copy any jar folders into this folder. Right click on the .jar files and click Bukd Path->Add to Build path, you'll now be able to import and classes contained in this jar file(s)!!!
Because you created a new project. If you haven't added any code yet, why would there be code in the src folder?

Best way to open phonegap project created with CLI in eclipse

When I create a phonegap folder structure via the CLI (3.0), how do I open this in Eclipse?
When I choose project [New] - [Android project from existing code], the assets are taken from the platforms/android folder. But I need to change the html and js of the top folder (www). These are the files that are being used when I build the project to other platforms (via CLI or build.phonegap).
Now I change the assets in the editor of the eclipse environment and then manually copy paste the content to the files under www.
Actually PhoneGap project structure and Eclipse project structure are somewhat different. But they work in a similar way. If you want to create phonegap project in eclipse then you have to create html,js,css within asset/www folder. The java source files will be within src folder(as usual).
If you want to create project without eclipse like with command phonegap/cordova create MyApp, then you will get all java source file within project/platform/android folder and html,js,css in www folder which is auto-created. On the other hand in eclipse you have to create this www folder manually.
But project is compiled in a same way whether it is created in eclipse(IDE) or in other text editor.
I have experience in both Eclipse and Text Editor(SublimeText,Vim). I prefer Text Editor because Eclipse sometime creates problem and it needs some extra things like creating www folder and place all scripts,templates,css etc manually.
If anyone whan to go with CLI, then I think SublimeText,Vim,gEdit etc are the best choice for coding.

Eclipse Dynamic Web Module and Apache Wicket

I want to place .html files in the same package with .java files under /src/main/java but when creating new .html file Eclipse offers /webapp as the default folder. Is there any way to change this behavior?
The default is to offer to place it in a folder that will be deployable to the server and readable by clients. You're still able to pick another folder, aren't you?
I like to put my Wicket HTML files in the /src/main/resources folder. Then I mark that folder as 'source folder' in Eclipse (Project Buildpath).
So that, I have the HTML separated from the java files, but they will be packed together (both with Eclipse and Maven).

How the launcher of eclipse Plugin development project loads\handles the "plugin.xml" file?

I want to figure out how can I put a file in the root folder of the project and use it in run time, there it will be accessible.
The problem that I have by doing that (placing the file in the root folder)-is that by default it means:
It is not in the classpath of the project.
It is not copied to the bin (output) folder.
I can’t see how my modifications of the file will affect the run process.
As I know there is a similar mechanism in eclipse that does the same:
The Plugin development project has a file-"plugin.xml" in the root folder of the project.
When you make a change in the file without building the project or copying it to the bin folder the changes take place when you run it.
example:
add an extension point in ”plugin.xml” and hit “RUN”, it will take place immediately.
Does anybody have an idea how this mechanism works in eclipse?
Edit - for clarification :
I am interested in how the launcher of eclipse Plugin development project loads\handles the "plugin.xml" file.
I assume when you say you want to put a file in a "root folder of the project" you are refering to a plugin that you are developing and then in runtime you want to get access to that file. Please don't vote me down if I did not understand that question correctly but based on my understanding here are some steps to follow:
Open your MANIFEST.MF file /MANIFEST.MF, this will oepn a multipage editor.
Click on the build tab (third from right).
This is where you specify what resources in your plugin you want the builder to include in the plugin at runtime. You will notice that plugin.xml is already checked which is why extensions get updated each time.
Check the resource on this editor page for the resource you want to be able to load and access at runtime. Behind the scenes this is updating your build.xml which the internal builder uses to figure out what sources to build/add when building/exporting the plugin.
One you have done that this is how you can get access to that file, you get the Bundle for your plugin and call the getEntryMethod with the path to your file and then open in inputstream from there you can load it as a File or whatever you want. Code example below: Hope this helps - Duncan
Bundle myBundle = Platform.getBundle("com.mycompany.myplugin.id")
InputStream in = myBundle.getEntry("/myfile.txt").openStream();