[jbosstools-issues] [JBoss JIRA] (JBIDE-17151) Improve the "New Restful Web Service" wizard

Xavier Coulon (JIRA) issues at jboss.org
Fri May 9 05:21:56 EDT 2014


    [ https://issues.jboss.org/browse/JBIDE-17151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12966708#comment-12966708 ] 

Xavier Coulon commented on JBIDE-17151:
---------------------------------------

[~maxandersen],

not sure I grok what you mean: the Application class should be created only once per webapp, so basically, when creating the first JAX-RS resource. We could have a radio button to:
- create a subclass of JAX-RS Application
- configure a servler mapping in web.xml
- do not create an Application (and let the user manage herself that part if it is not a portable solution. Eg: deploying with RESTEasy on Tomcat) 

[~ArunGupta],
Yes, I would only override the base URL in web.xml, something like: 
{code}
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
	version="3.0">
	<servlet-mapping>
		<servlet-name>javax.ws.rs.core.Application</servlet-name>
		<url-pattern>/rest/*</url-pattern>
	</servlet-mapping>
</web-app>
{code}

(the servlet version should match the project settings)
I do not plan to provide implementation-specific servlet mappings in the wizard (yet). This could be a later improvement (if relevant)

> Improve the "New Restful Web Service" wizard
> --------------------------------------------
>
>                 Key: JBIDE-17151
>                 URL: https://issues.jboss.org/browse/JBIDE-17151
>             Project: Tools (JBoss Tools)
>          Issue Type: Enhancement
>          Components: webservices
>    Affects Versions: 4.2.0.Beta1
>            Reporter: Xavier Coulon
>            Assignee: Xavier Coulon
>             Fix For: 4.2.0.Beta2
>
>         Attachments: current wizard.png, Mockup for new JAX-RS Wizard.bmml, Mockup for new JAX-RS Wizard.bmml, Mockup for new JAX-RS Wizard.bmml, Mockup for new JAX-RS Wizard.png
>
>
> The current wizard could be improved after feedback on JBIDE-13309, JBIDE-13310 and internal discussion:
> {quote}
> - 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.
> {quote}



--
This message was sent by Atlassian JIRA
(v6.2.3#6260)


More information about the jbosstools-issues mailing list