[jbosstools-dev] Nice AngularJS story

George Gastaldi ggastald at redhat.com
Thu Jul 10 09:54:14 EDT 2014


Just a minor correction: It generates a JAX-RS Container Filter, not a 
Servlet Filter. Here is the output generated:

import javax.ws.rs.ext.Provider;
import javax.ws.rs.container.ContainerResponseFilter;
import javax.ws.rs.container.ContainerRequestContext;
import javax.ws.rs.container.ContainerResponseContext;

@Provider
public class NewCrossOriginResourceSharingFilter implements 
ContainerResponseFilter
{

    @Override
    public void filter(ContainerRequestContext request,
          ContainerResponseContext response)
    {
       response.getHeaders().putSingle("Access-Control-Allow-Origin", "*");
response.getHeaders().putSingle("Access-Control-Allow-Methods",
             "GET, POST, PUT, DELETE");
response.getHeaders().putSingle("Access-Control-Allow-Headers",
             "content-type");
    }
}

On 07/10/2014 10:42 AM, Lincoln Baxter wrote:
> That is correct. It will generate a Servlet filter into any existing project. But if JAX-RS/Servlet is not setup yet, it will handle that for you.
>
> ----- Original Message -----
> From: "Max Rydahl Andersen" <manderse at redhat.com>
> To: "George Gastaldi" <ggastald at redhat.com>
> Cc: "Lincoln Baxter" <lbaxter at redhat.com>, "Fred Bricon" <fbricon at redhat.com>, "Vineet Reynolds Pereira" <vpereira at redhat.com>, "??? jbosstools-dev" <jbosstools-dev at lists.jboss.org>, "Burr Sutter" <bsutter at redhat.com>
> Sent: Thursday, July 10, 2014 4:09:24 AM
> Subject: Re: [jbosstools-dev] Nice AngularJS story
>
> Can I run this on any project ( I assume it just generates a single file so no forge setup required?) and how do u run it ? I assume it's an additional plugin ?
>
> /max (sent from my phone)
>
>
>> On 10/07/2014, at 02.18, George Gastaldi <ggastald at redhat.com> wrote:
>>
>> As of right now, Forge 2 has a REST: New Cross Origin Resource Sharing Filter command (and with tests - :)). Screenshot attached
>>
>> Forge on!!!! :D
>>
>>> On 07/09/2014 06:34 PM, Lincoln Baxter wrote:
>>> Reverse engineering in Forge 2 works well.
>>>
>>> I just made this video for you - https://www.youtube.com/watch?v=mg8Z7qHzpBA&feature=youtu.be
>>>
>>> Regarding CrossOriginResourceSharingFilter, it's simple enough to add a command in Forge to create one:
>>>
>>> https://issues.jboss.org/browse/FORGE-1929
>>>
>>> Enjoy ;)
>>>
>>> ~Lincoln
>>>
>>> ----- Original Message -----
>>> From: "Fred Bricon" <fbricon at redhat.com>
>>> To: "??? jbosstools-dev" <jbosstools-dev at lists.jboss.org>, "Lincoln Baxter" <lbaxter at redhat.com>, "George Gastaldi" <ggastald at redhat.com>, "Vineet Reynolds Pereira" <vpereira at redhat.com>
>>> Sent: Wednesday, July 9, 2014 9:03:49 AM
>>> Subject: Nice AngularJS story
>>>
>>> Hi,
>>>
>>> my Twitter TL got me to watch this Netbeans demo of building a web app
>>> with JAX-RS backend + AngularJS front-end :
>>> https://www.youtube.com/watch?v=2B3qL7XtKnE
>>>
>>> I wonder how our tooling fares compared to this demo. My guts tells me
>>> (take that with a grain of salt) that :
>>> * for the back-end, we could use reverse engineering with Forge 2,
>>> although I don't really know its level of maturity
>>> * we have nothing similar to the CrossOriginResourceSharingFilter (seen
>>> at 2'14")
>>> * we have no equivalent for seeding a stock angularjs project, AFAIK
>>> (unless F2 brings someting here too, idk). We could prolly create a
>>> Maven archetype containing the same thing though.
>>> * overall their angularjs tooling felt underwhelming. angularjs-eclipse
>>> probably brings a stronger UX, with its navigation capabilities and its
>>> inference engine
>>>
>>> WDYT?
>>>
>>> I count on Burr, to come up with a demo showcasing a similar story with
>>> our stuff :-)
>>>
>>> Fred
>> <screenshot.png>
>> _______________________________________________
>> jbosstools-dev mailing list
>> jbosstools-dev at lists.jboss.org
>> https://lists.jboss.org/mailman/listinfo/jbosstools-dev



More information about the jbosstools-dev mailing list