Eclipse+STS or STS all function invalid - eclipse

I follow some guide, In the video, Their IDE have all those functions (by default! no config needed):
No auto compile in any type
No Spring entry in "NEW" or "XML Configure File" in XML or anything handy
No Spring XML editor in "OpenWith"
etc....
Almost everything is missing
I try both way: Download STS4 or install STS in Eclipse
None of them working
So: How to get those lost function ?

The tutorial you are following is probably using STS3, which contains all the features for Spring XML config files that you mentioned. However, the tooling that you have installed is Spring Tools 4 for Eclipse, which comes with a different set of features. It supports Spring XML config files, too, but in a different way. It is much more focused on implementing apps on top of Spring Boot. You can find more details in the Spring Tools 4 wiki: https://github.com/spring-projects/sts4/wiki

Related

Spring Annotation-based Project Templates

I am new to Spring. I am learning it from different sources. Spring Recipes, Spring In Action and Spring documentation. According to Spring 3.+, XML configuration can be ignored at all. This is good for me as a beginner.
Problem:
I am using Spring Tool Suite, is there a Spring Web project template that starts with annotations only? All the project templates I have found use XML configuration. I don't even know where to put my DispatcherServlet. I don't know where to put my controllers.
I also had the same problem when Starting out with Spring to find only annotation based templates. Then I found this from John Thompson. This project is completely annotation based and the only xml file involved is pom.xml
I recommend you to run through Spring Guides - they are up to date and use annotation based configuration.
This is guide how to make a restfull web service using spring-boot. It has description how to made project with maven, gradle or STS.
The official recommendation is to base all new projects on Spring Boot which is XML-less out of the box.
STS offers a nice integration with the Spring Initializr service: just go to "New -> Spring Starter Project", fill in a few fields like project name etc. and tick the boxes next to modules you're interested in.

How to get eclipse content assist working in XML files

I have started creating the Spring web application where I need to mention the spring classes in the XML configuration files, for ex, the deployment descriptor (web.xml) where I need to mention the DispatcherServlet class of Spring.
What I am looking for is, I want eclipse to show me the list of packages/classes when I type org.springframework..., like we do in the Java editor. I have googled to find out, but no luck. I am sure there would be plugins available. Can any of you please share me on how to fix this?
Since you are working on a spring project, I'd recommend installing the SpringToolSuite (STS). The info page is here: http://spring.io/tools
Since you already have an Eclipse instance that you are working with, you should go with the update sites: http://dist.springsource.com/release/TOOLS/update/e4.4/
(Make sure to use the correct update site for the Eclipse version you are using.)
Not only does STS include all tools for XML editing, but it also includes special tools for editing your Spring application files.

Eclipse plugin for spring

IDEA allow to find bean definition, declared in xml, right from Java code. For example if I've got interface SomeIntrfaceImpl IDEA allow me to find out instances of SomeIntrfaceImpl in .xml contextes files, pointing me to .xml file to line of code where bean is created
Is there any Eclipse plugin, that allow me to do the same ?
Yes there is different Eclipse provided by SpringFramework makers itself. They have extended the eclipse to provide easy development for Spring web application and other products like Spring ROO also.
Its is called SpringSourceToolSuit. You can download its latest version from here after providing some basic information about you asked in a form there.
Its the best IDE to develop Spring applications. I am currently using it.
Hope this helps you. Cheers.

JBOSS Eclipse Integration

I am working with Eclipse and JBOSS. I was wondering if there is a way to do hot in-place deployment for a web project, by integrating the JBOSS server with Eclipse.
By hot in-place deployment, I mean, I should be able to view the change made to a jsp , by refreshing the page on the browser, not required to go through the routine , build-deploy-test cycle.
Take a look at JBoss Tools. That has everything you need.
JBoss Tools seems to do auto-redeploy by default when you create a web application with their wizard: http://docs.jboss.org/tools/3.1.0.CR1/en/GettingStartedGuide/html/jsp_application.html#AutoRedeploy
AFAIK every time you save a JSP they copy it to the application deploy directory in JBoss, but if your source layout matches the WAR layout they might run the application directly from your project directory (I know some versions of WTP did this with Tomcat, but with JBoss it's probably harder).
You are after "Exploded Hot Deployment" - deploys a directory of your files rather than an archive and then any subsequent "explode" will only deploy changes rather than the whole project (depending on how you have Ant configured).
Frameworks like Seam do this for you. Maybe worth grabbing a build.xml file from them and modifying it for your use?
Have you tried using JSP-Weaver?
Here is the Wikipedia description:
JSP Weaver is a JavaServer Pages
interpreter. Unlike JSP compilers it
evaluates the JSP files directly,
without generating or compiling
intermediate Java source files for the
JSP Java servlet.
Although this sacrifices some
performance on page rendering (10%-20%
overhead depending on the compiler in
question) it enables a much faster
reloading of changes made to the
source of the JSP file (10-20 times
decrease in time depending on the page
and the compiler in question).
Unlike simpler attempts at
interpreting JSP-like syntax (e.g.
Facelets) it supports embedded Java
statements called Scriptlets (a
standard JSP feature). This allows
full compatibility with the JSP
specification versions 1.0 to 2.1.
I also agree with Sietse in you should check out JBoss Tools. It is a great free alternative to the JBoss Developer Studio

Spring Explorer not showing beans from bean definition file

I just downloaded the Springsource Tool Suite, and I created a simple bean configuration file called myDefinition.xml and placed it in the root directory of the Spring Project. However, the Spring Explorer is not showing any data. I'm using eclipse 3.5 and the latest SpringSource all-in-one installation.
Also, if I specify invalid property names in the configuration file, I get no error. Autocomplete, however, is working.
Thoughts?
In the Spring Explorer tab in Eclipse, right click on your project > properties. Then go to Spring > Beans Support and select the Config Files tab. You can then select files or scan a directory and that should add them. I haven't found a way to autoscan a directory so I don't have to do this whenever I add a new spring bean file. The beans that appear in that list are stored in the .springbeans file.
Just want to add that if you want to generate a diagram of a webflow of an existing project, you have to right-click said project in Eclipses Project Explorer and "Add Spring Project Nature" by using the Spring Tools entry of the context menu.
There currently (as of 2012-04-10) seem to be problems with the Spring Explorer view when using a purely annotation driven bean definition (i.e. using Java annotations to wire everything up instead of using XML files).
There is a workaround though, by providing a minimum XML file that declares scanning for components.
http://forum.springsource.org/showthread.php?118928-Spring-Explorer-with-Java-based-Web-Container-configuration
Unfortunately, this procedure is still flawed, missing some components.
Just to add Claudio030
Make sure you have JEE perspective selected for your project, otherwise it won't show in Java perspective.