Uploaded image for project: 'Tools (JBoss Tools)'
  1. Tools (JBoss Tools)
  2. JBIDE-17151

Improve the "New Restful Web Service" wizard

    XMLWordPrintable

    Details

    • Release Notes Text:
      Hide
      2 new JAX-RS wizards are provided in replacement of the former "Create Sample RESTFul Web Services" one:
      - a wizard to create new JAX-RS Application (subclass of {{javax.ws.rs.core.Application}} or defined in {{web.xml}}
      - a wizard to create new JAX-RS Resources. This wizard provides the user with default settings for the class name, the @Path value ("resource path"), the default media-types ({{application/json}} and {{application/xml}}) and can also generates code skeleton for CRUD methods. This wizard also provides a page to create a JAX-RS Application (mandatory at runtime), so that the user can have all she needs at once.

      The JAX-RS Resource wizard can be call from "File>New" (in the menu bar and in the project's menu) and in the "Servlet" group in the toolbar, both in the JavaEE and JBoss perspectives.
      The wizards can also be invoked from other selected elements in the project, including classes, packages, source folders and even the "JAX-RS Web Services" node.
      Show
      2 new JAX-RS wizards are provided in replacement of the former "Create Sample RESTFul Web Services" one: - a wizard to create new JAX-RS Application (subclass of {{javax.ws.rs.core.Application}} or defined in {{web.xml}} - a wizard to create new JAX-RS Resources. This wizard provides the user with default settings for the class name, the @Path value ("resource path"), the default media-types ({{application/json}} and {{application/xml}}) and can also generates code skeleton for CRUD methods. This wizard also provides a page to create a JAX-RS Application (mandatory at runtime), so that the user can have all she needs at once. The JAX-RS Resource wizard can be call from "File>New" (in the menu bar and in the project's menu) and in the "Servlet" group in the toolbar, both in the JavaEE and JBoss perspectives. The wizards can also be invoked from other selected elements in the project, including classes, packages, source folders and even the "JAX-RS Web Services" node.

      Description

      The current wizard could be improved after feedback on JBIDE-13309, JBIDE-13310 and internal discussion:

      • Choosing the first wizard shows an option to edit "Web Service" and "Application Class Name" and have the same values. Why this value need to be entered twice and how is it used ?
      • web.xml is generated even though "Update web.xml" was not selected. Why can't ApplicationPath be used instead of web.xml anyway ?
      • Even in the generated web.xml, the mapped path is /*. This is not the recommended practice as none of the Servlets or other resources in the application would then be resolved correctly. The recommendation is to use something like /webresources, /resources, or /rest and have all the resources be accessed from there.
      • The generation of REST resource did not added JAX-RS facet to my project. Does it have to be manually added ? If yes, then why ?
      • Adding JAX-RS facet shows "Further configuration required" and require me to specify "JAX-RS Servlet class name". How is the user expected to know the class name ? This should not even be required for a Java EE 6 application.
      • In pure Java EE 6, there should be no need to ask that information anyway. Instead use @ApplicationPath to specify the base path of JAX-RS.

        Gliffy Diagrams

          Balsamiq Wireframes

            Attachments

              Activity

                People

                • Assignee:
                  xcoulon Xavier Coulon
                  Reporter:
                  xcoulon Xavier Coulon
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  6 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: