what's the difference between "dynamic web project" with JSF facet and "JSF project"? - eclipse

When I install "web tools platform" plugins in Eclipse I have a new type of project I can create, called "dynamic web project". In such project I can add JSF facet and then use it to make JSF application.
But when I install "jboss tools" plugins I have a project type called just "JSF project".
What's the difference between both types of projects? Why have jboss tools people created their own type of JSF project?

Eclipse plugins are created to achieve some commonly used/desired configurations at much ease. As you said, you can create a Dynamic Web Prject and then perform couple of steps to convert/support JSF. JSF project is created with those required configuration already done for you.
Same example you can apply even between, a simple project(created though New -> General->Project option) and Dynamic Web Project i.e. you may create a simple project, create files/folders, update the class path etc manually and achieve the same which is directly available through Dynamic Web Project option. These plug-ins/options help you avoid several manual steps to reach a commonly desired functionality. JSF project is no exception.

Related

Add library to Vaadin Web App project in Netbeans

I recently used the Library Manager in Netbeans (8.2, on Windows 10) to add a library, as show below:
However, in most guides I find online, in order to actually add the library to the project, I should do the following:
Right click the project -> Select the Libraries tab -> .... further steps ....
However, I haven't even been able to make it past the second step: the Libraries tab simply does not exist on my project properties, as seen below: Is this because the structure for a Vaadin web app project is so different from other Netbeans projects? Any advice would be appreciated
tl;dr
Don’t.
Do not configure libraries manually for your Vaadin project.
Instead, create a new Vaadin project using the template of a Maven archetype provided by the Vaadin Ltd company. Locate and edit the new project’s POM.xml file to list the libraries you need Maven to automatically download and install.
For Vaadin Framework (Vaadin 8), see:
Using Vaadin with Maven
Overview of Maven Archetypes
Maven
Usually Vaadin projects are configured using the Apache Maven tool.
Maven is quite popular across all kinds of Java projects. All three major IDEs (NetBeans, IntelliJ, Eclipse) support Maven-driven projects as an alternative to their own particular project definition system.
Maven has two purposes:
Configure the project parts and define a series of events for the compile-and-build process. You can create a new project pre-configured this way by starting with a Maven archetype (a project template).
Manage “dependencies”. This means you tell Maven what libraries your project needs. Maven then reaches out over the Internet to access a Maven-oriented repository of known libraries. Maven downloads your needed library from that repository, placing it in an appropriate place within your project. Tip: Be patient the first time you do this as Maven builds a local cache of the repository’s database, taking several minutes or more.
You specify both the project-build configuration and your list of desired libraries (“dependencies”) in one or more POM.xml files.
Using Maven eliminates the need to place libraries manually as you are attempting to do. No need to touch the NetBeans Library Manager. Indeed, I believe manually configuring libraries will conflict with Maven, with troubled results.
Using Maven is annoying at first, having to learn the lingo and the concepts. But once you are orientated, Maven does save you time and trouble, and makes your developer life easier. One big benefit: Maven makes switching between the 3 main IDEs much easier since you don’t have to learn about each one’s own idiosyncratic project-build-system.
I recommend you take a few hours to learn the basics. You’ll find many introductions and tutorials on Maven.
The Vaadin Ltd company provides a few good Maven archetypes for a new Vaadin project.
vaadin-archetype-applicationOne is a simpler structure, good for learning Vaadin and also good if building a simple small app.
vaadin-archetype-application-multimoduleAnother archetype is a “multi-module” Maven archetype, good for more serious Vaadin apps. One major feature is that your backend logic such as database-access can be separated from your user-interface logic, each in separate modules. You should definitely start with the simple archetype first. Don’t touch the multi-module archetype until you are comfortable with both Vaadin and Maven (unless you have the guidance of a helpful colleague who is a Maven maven).
By the way, Vaadin development in previous years virtually required the use of a Vaadin-savvy plugin that you would have to install into your IDE. Such a plug-in is no longer needed, now supplanted by Maven. You can ignore old outmoded guides to Vaadin that talk about an IDE plug-in for Vaadin.
Note: This entire Answer applies to Vaadin 8 (Vaadin Framework) specifically, and probably Vaadin 7 (as I recall). Vaadin 10 (Vaadin Flow) is a new ballgame, and I am not yet familiar with the situation there.

Dynamic Web project Error "Loading descriptor"

In the process of trying to build an android web service using Spring under Eclipse IDE, I need to create a Dynamic Web Project using Maven. The problem I am facing is an error " Loading descriptor for project has encountered a problem. I don't know how to solve this. Any input on that?
If you get the following exception:
Loading descriptor for project has encountered a problem. [...]
Nullpointerexception
right after creating a project, then there are 2 possible causes (or at least that how it was for me, when I had this issue).
1) A web.xml file is missing in your WebContent/WEB-INF folder or was not created during project creation. (in the last window you have to check option "Generate web.xml deployment descriptor" in eclipse, otherwise eclipse won't generate that file)
If your project is already created, you can still add a web.xml file into your WEB-INF directory. Depending on your servlet version (e.g. 2.5) you have to use a different template which can be found on the net.
2) Your Eclipse does not have all the necessary plugins for Dynamic Web projects.
You need to go to Help >> Install new Software
Select the site which corresponds to your eclipse version. (e.g. Kepler - http://download.eclipse.org/releases/kepler )
Install:
JST Server UI
JST Web UI
JST Server Adapters
JST Server Adapters Extension
WST Server Adapters.
You may also need:
Eclipse Java EE Developer tools
Eclipse Java Web Developer tools
Java Server Faces tools or JSF tools
Eclipse faceted Project Framework
Eclipse faceted Project Framework JDT Enablement
install Java EE web developer tools from Help >> "Install new Software".
check in project properties "Project Facets" should have proper check boxes enabled eg Dynamic Web Project etc.
I know this is late but may be useful for others.
In web.xml there may be some attribute repated in web-app tag.
In my case xmlns="http://java.sun.com/xml/ns/javaee" attribute in repeated in tag web-app.
Install Eclipse Java Development tools from Help >> "Install new Software".

Adding JSF 2.2 results in "Found multiple versions of the required class javax.faces.FactoryFinder"

I'm wondering how I can use JSF 2.2 (instead of the 2.0.2) in Eclipse?
It seems like there is no official release (only majorra 2.0 and myfaces 2.0.2 are available)
and when I add jsf 2.2 impl and api manually (Project Facets), it tells me: "Found multiple versions of the required class javax.faces.FactoryFinder.".
When i remove the old (myfaces 2.0.2) tomcat fails...
is there a way to make JSF 2.2 run in eclipse as default?
You can both, add the library to your classpath or configure it in jsf preferences, if you've the facet enabled. In the first way you're not telling Eclipse you're using JSF and second way you tell it and you can choose between configuring the classpath yourself or make Eclipse choose which JSF jars you want to use to let it include them.
First of all you need to download the jars from Mojarra's or MyFaces'es site. MyFaces doesn't have 2.2 version implemented as of today.
To just add the library to your classpath, right click on the project and go to Properties, Java build path. Then click on Add JAR or Add External JARs, depending where you have the jar and add the jsf-api and jsf-impl jars.
Otherwise, if you have the project configured as a JSF project, firstly you have to enable the JSF facet, check Project Facets. Then Eclipse will create a submenu inside Project Facets, letting you configure JSF. You can choose disable library configuration and do it the previous way or select User Library:
Then click on the books icon and you can add a new user library. Once added you only need to add required jars. Keep in mind that you need both jsf-api and jsf-impl jars to have it working, as Tomcat is a plain servlet container and doesn't include any JSF implementation out of the box.
Alternatively, you can also place the jsf-impl directly in your Tomcat shared libraries folder. You should drop it in $CATALINA_HOME/lib and every single application you deploy will use the same implementation. In that way you can just reference the jsf-api from your projects and code against it, having the implementation itself into the server's classpath.

Type of Eclipse project for sample Spring project

In a tutorial at http://static.springsource.org/docs/Spring-MVC-step-by-step/part1.html Spring guys didn't say which Eclipse project they choose to create this sample application. Project icon has S symbol over it, so this isn't a Java project (marked with J symbol).
However, it doesn't look like a Dynamic Web project either.
Could you please explain that S symbol and say which project type is it?
They are using the Spring Eclipse plugin (either that, or they are using the Springsource Tool Suite IDE, based on Eclipse)
With this plugin, a dynamic web project should get you the 'S' you are looking for.
The S just means that the Spring nature is active (and it's either Spring IDE or SpringSource Tool Suite). In Eclipse-speak, I guess you should generate a dynamic web project, but it would be better to generate a Maven Project and import that into Eclipse (then Eclipse will automatically set the correct project type).

What IDE (Eclipse or Aptana) and What tools i need to develop a JSP Project

I need to create a web based project where I will use java codes to do the back-end processing and database connections. So I need to write my code in JSP. I already installed tomcat.
But in Aptana i do not get the option "New Dynamic Web Project". Which i have created JSP projects previously. Any one knows how to add it or what toold i need to install?.
I'm not a fan of Aptana; in my experience it's a bloated tool that tries to do too much and does nothing particularly well. I would just get the Eclipse IDE for Java EE Developers package from http://www.eclipse/downloads and use that.