JavaScript content assist not working for JSP file in Eclipse Kepler - eclipse

I am using Eclipse Kepler to develop App Engine application.The autocomplete feature is not working for JSP files and am not sure if I am missing any Property settings.
Would be glad if someone can let me know what needs to be done to enable auto-complete feature?
PS : FYI, I have the WTP tool already installed

You have to be working with a file in a JavaScript Source Folder. To do that, you can create a JavaScript project or enable an existing project from its Configure context menu (right-click->Configure->something JavaScript). Once that's done, if it wasn't opened automatically, bring up the project's JavaScript Include Path property page and create or mark an existing folder as a Source Folder. That should enable it for both JS files and web pages.

Have you tried closing the project and opening it again. That would clear the cache and get things running.
right click project > close project
right click closed project > open project

Related

Setting up hot deployment with eclipse and Jboss

I am used to work with rails locally where I can use any text editor I please while I have the server running. If I make changes to a file Webrick, it will pick it up and I am able to see the changes on the page.
Can I do this with eclipse?
I am using Atom for html editing but every time I save the changes and reload the page, the changes are not done. Any ideas?
Is your project an Eclipse Web project associated with a server in the Eclipse Servers view? If so, double-click on the server and you'll be able to tweak a few thing. The interesting option would be Automatically publish when resources change under Publishing.
PS: if you're using Java Enterprise or JBoss technologies, you can add JBoss Tools on top of your Eclipse IDE, it features some features and default settings that should make things simpler for you.
I've found the answer by going to eclipse in Preferences > General > Workspaces > Refresh using native hooks or polling
This way I am able to edit html files with Atom. Hope it helps someone
Question for reference: eclipse, refresh files edited by external editor

Sublime Text 2 edited file-changes does not show when refreshing browser in Maven project

I am having problems when editing template-files(HTML-files) in my Maven-project. I have made the Maven-project an Eclipse-project with the command "mvn eclipse:eclipse" (if it matters). I am using the Apache Velocity Engine as template engine for this project.
The problem arises when I'm editing the files in Sublime, and then save the file and refresh the browser. The changes does not show! If I however open the template file in Eclipse, just open it, I can even just open and close it right away, and THEN refresh the browser, the changes will show.
I have done a test to see if this problem occurs on other simple projects as well, and with a single HTML-file and a simple http-server, the work I save in Sublime shows as normal.
Does anybody know what is happening here? Am I bound to keep on using Eclipse as a HTML-editor? :( Does the Eclipse project files prevent me from using other editors? Why are the changes only showing when I open the files in Eclipse?
Any help is greatly appreciated!
In order for the changes to take place you have to right-click the file in Eclipse explorer tab and choose "refresh" in order for the (static) changes to be reloaded to Apache. For dynamic changes you'll need to restart apache or use a plugin such as JRebel.
Eclipse copies the files to the "target"-folder in the webapp. Sublime(and others) does not do this automatically, so you need to do this manually, or by a plug-in that will copy the files on save.

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 Plugin - XML Editor

I've followed this tutorial:
Eclipse Plugin
This tutorial explain why create a HTML Editor.
I need a Text editor,just for auto-highlight some words, anyway I thought this tuto should be a good one to start with.
The thing is that I created the Plugin project and the only thing that I changed it was the extension "pat" instead "html, htm", just that. After that I created a .pat file, but eclipse doesn't open it with my plugin, and my text editor is not in the editor's list.
Any suggestion??
Let me know if you need more information.
My guess is that you have just created the plugin, but aren't running it in your current Eclipse instance. That can be verified by opening the view "Plugin registry". That will show a list of all plugins, see if the plugin you have created is in that list.
If you click on the run button in Eclipse you will open a run configuration dialog. In one of the tabs, you get to choose what plugins should be available. Make sure your plug-in is selected. This will start up a new Eclipse instance that will run your plugin.
To make your plugin be a part of your ordinary Eclipse installation, you will need to export it to a jar and copy that jar to the dropins catalog.

How do I open the GWT samples in eclipse Helios and GWT 2.1.1?

What is the straight-forward way of importing one of the GWT samples in eclipse Helios + GWT 2.1.1. It seems like the content of the zip file doesn't contain any project files for eclipse.
I tried the following:
create a GWT project 'bla'
Delete the src ad war folder and
replace it with the src and war
folder from the sample
refresh the project in eclipse
hit 'run'
[ERROR] Unable to find
'bla/bla.gwt.xml' on
your classpath; could be a typo, or
maybe you forgot to include a
classpath entry for source?
So I go to the run configuration and remove the path for the example projects from the arguments list. I also changed the name of hosted html page to the one in the sample. Hit 'run' and:
[ERROR] Invalid version number "2.0"
passed to external.gwtOnLoad(),
expected "2.1"; your hosted mode
bootstrap file may be out of date;
Now I need an out of date version of GWT to run these samples? What is going on, I just want to look at a sample to learn a new concept.
Reading the readme.txt in the GWT samples directory I came across a solution that works on Eclipse 3.7. Assuming you have ant installed on your machine, execute the following from the sample's directory:
ant eclipse.generate
This will generate both the .classpath and .project files needed to import the sample into Eclipse and run it.
Here the relevant excerpt from README.txt:
-- Option A: Import your project into Eclipse (recommended) --
If you use Eclipse, you can simply import the generated project into
Eclipse. We've tested against Eclipse 3.4 and 3.5. Later versions
will likely also work, earlier versions may not.
If the directory containing this file does not have a .classpath or
.project file, generate them by running 'ant eclipse.generate'
In Eclipse, go to the File menu and choose:
File -> Import... -> Existing Projects into Workspace
Browse to the directory containing this file, select "Mail".
Be sure to uncheck "Copy projects into workspace" if it is checked.
Click Finish. You can now browse the project in Eclipse.
To launch your web app in GWT development mode, go to the Run menu and
choose:
Run -> Open Debug Dialog...
Under Java Application, you should find a launch configuration
named "Mail". Select and click "Debug".
You can now use the built-in debugger to debug your web app in
development mode.
In eclipse 3.7, instead of Run -> Open Debug Dialog..., its Run -> Debug Configurations. I got both the showcase and mail samples running following those commands. Should work for all of the other samples as well.
The examples that come with GWT SDK were built in different ways. Some are Maven builds, others use Ant. Eclipse can handle these common builds directly, but you have to choose the right option.
So, if you want to open the Expenses project in eclipse, you would look in the projects root directory (i.e. ../gwt2.4/samples/Expenses) where you'll find a file called pom.xml. That is a Maven build file. To import it into your Work space select:
File->Import...
Open Maven->Existing Maven Projects, and click on Next > button
Browse your file system til you reach the Expenses folder. Click on it and Select OK.
At this point it will show you the Projects in that directory in the Projects: area of the window...only one in this case: /pom.xml com.google.gwt.sample.expenses:...etc.
click on the checkbox for that project, Next>
Finally, it ask you to map plugins. You'll need to select in the drop down menu under Actions the required plugins (such as m2e).
In other project folders you may find a build.xml file instead. That's an Ant build file. To import that you do something similar, but different (of course!):
File->New->Project...
Open the Java folder and select "Java Project from Existing Ant Buildfile", Next >
Click the Browse button, dig through your directory to the project folder and select the build.xml file, and Open it.
Project name should fill in automatically, just select the declaration to use in the middle window and click Finish.
Since those tutorial only include the src and war directory, the idea remains to:
create a new project following this tutorial
remove any created class part of the example files which are automatically added (see Issue 1547)
Unfortunately the Google Plugin does not allow to created a new Web Application Project without creating template files. The template files are nice for the first try but annoying if you want to start from scratch with a new GWT application.
copy the src and war directory in place within the now empty project
Following your ticket 5847 (No easy and straight-forward way to make examples work in eclipse),
as xo4yhamope comments, you need the right GWT option.
and did you consider the Issue 5038 about the error message:
Unable to find 'xxxx.gwt.xml' on your classpath;
could be a typo, or maybe you forgot to include a classpath entry for source?
This message usually means you attempted to refresh the browser before dev mode has had a chance to finish loading the module.
The uppercase/lowercase confusion happens because the module has been renamed to 'stockwatcher', but dev mode cannot map 'stockwatcher' to "StockWatcher' until it has finished loading the entire module.
So, it's just a matter of waiting a few seconds longer after the Development Mode pane says I should go to http://127.0.0.1:8888/StockWatcher.html?gwt.codesvr=127.0.0.1:9997 ?
That seems a little messed up. It should wait until it's actually ready before telling me it's ok, because users (like me) are going to go there as soon as the UI says it's ready.
The other confusing part is that the server begins serving the host page as soon as that message in the UI comes up. Because this was happening, I assumed that the server was completely up, even though (as it turns out) it wasn't.
Anyway, waiting a few more seconds seems to resolve the "Unable to find 'stockwatcher.gwt.xml' on your classpath" problem. Thanks!
I'm beginning to suspect this is a bug in the samples. I am adding this answer so it can be marked as an answer when I get confirmation about that.
I was trying out some other samples and came across this page. At the top is a little explanation for how to download and import the sample.
Before you begin
The StockWatcher project
This tutorial builds on the GWT
concepts and the StockWatcher
application created in the Build a
Sample GWT Application tutorial.
If you have not completed the Build a
Sample GWT Application tutorial and
are familiar with basic GWT concepts,
you can import the StockWatcher
project as coded to this point.
Download the StockWatcher project.
Unzip the file.
Import the project into Eclipse
From the File menu, select the Import... menu option.
Select the import source General > Existing Projects into
Workspace. Click the Next button.
For the root directory, browse to and select the StockWatcher
directory (from the unzipped file).
Click the Finish button.
If you are using ant, edit the
gwt.sdk property in
StockWatcher/build.xml to point to
where you unzipped GWT.
Now this is what I call straight-forward and easy.
At that point I had already built the StockWatcher in a previous tutorial but I got intrigued by the fact that it was explained exactly as I tried it the first time. So I downloaded the project and it had the correct eclipse project structure. I tried to import it 'et voila' I have the project in eclipse. I runs out of the box (with warnings). That is how expected the samples to be.
This experience leads me into thinking that the sample projects are malformed (as eclipse projects) and need to be updated. Let's hope my issue report leads to results.
-- Option A: Import your project into Eclipse (recommended) --
If you use Eclipse, you can simply import the generated project into Eclipse.
We've tested against Eclipse 3.4 and 3.5. Later versions will likely also
work, earlier versions may not.
If the directory containing this file does not have a .classpath or .project
file, generate them by running 'ant eclipse.generate'
In Eclipse, go to the File menu and choose:
File -> Import... -> Existing Projects into Workspace
Browse to the directory containing this file,
select "Mail".
Be sure to uncheck "Copy projects into workspace" if it is checked.
Click Finish.
You can now browse the project in Eclipse.
Copy from readme.txt supplied by samples. I tried this method, it's OK.
To import GWT showcase(2.5.1) I did following steps:
Create a new Google Web Application Project
New –> Other –> Google –> Web Application Project
Provide the project name “Showcase” and the Package name is com.google.gwt.sample.showcase
Click Finish
Go to eclipse plugin folder and traverse to the gwt
Under that folder go to gwt-2.3.\samples\Showcase
Copy (Ctrl C) all the contents. The contents are
a. src
b. test
c. war
d. build.xml
e. README.txt
In the eclipse, right click on the Showcase project and paste. Overwrite all the files
The files should start copying without any problem
Right click on the Showcase and Run As “Web Application”
You should have your Showcase working like Gem!
For me it worked like a charm ;)
Ref : http://simplestepswebdev.wordpress.com/2011/05/16/import-gwt-samples-into-eclipse/