You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Erik Fäßler <er...@uni-jena.de> on 2011/06/12 13:22:17 UTC

Easiest way to communicate with the WebApp

Hey all,

the web application I'm developing depends on some resources which may change on a regular basis. I have a plain Java application which is responsible for creating/updating these resources, e.g. a database table.
I would like this update application to be able to tell my tapestry web app that new data is available and should be loaded. I would like to send a command like "update" to the web app which then would tell the services that new resources are available and that they should reload these.
The question: Which would be easiest way to do this? I have found a package "tapestry-resteasy" which seems to offer a RESTful interface quite nicely. However, I do not intend to offer a public API to my web application - I would rather hide the update functionality from the public.

I would be glad for a few tips about in which direction I should think and search here.

Thanks and best regards,

Erik
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Easiest way to communicate with the WebApp

Posted by Nikola Milikic <ni...@gmail.com>.
Hi Erik,

I think you're on the right track there with REST services through
tapestry-resteasy. It's really easy to set up and it provides you reading
(using GET method) and writing (using PUT or POST) capabilities. Regarding
the issue of these methods being publicly available is unavoidable as they
must be public in order for the other app to communicate with it. Thus, as
Thiago suggested, some authentication must be involved. Unless those two
apps are residing on the same machine which would be a different issue...

Best,
Nikola

On Mon, Jun 13, 2011 at 3:34 PM, Nicolas Barrera <nb...@gmail.com> wrote:

> On Sun, Jun 12, 2011 at 9:55 AM, Thiago H. de Paula Figueiredo <
> thiagohp@gmail.com> wrote:
>
> >
> > Another option is to implement a service that opens a server socket to
> > receive the commands. Again, you'll need to implement some kind of
> > authentication.
> >
> >
> Perhaps you could connect to a JMS queue (which the other app creates) on
> startup, then you communicate your webapp and the other java application
> though JMS.
>
> just a suggestion
>
> Nicolás.-
>

Re: Easiest way to communicate with the WebApp

Posted by Nicolas Barrera <nb...@gmail.com>.
On Sun, Jun 12, 2011 at 9:55 AM, Thiago H. de Paula Figueiredo <
thiagohp@gmail.com> wrote:

>
> Another option is to implement a service that opens a server socket to
> receive the commands. Again, you'll need to implement some kind of
> authentication.
>
>
Perhaps you could connect to a JMS queue (which the other app creates) on
startup, then you communicate your webapp and the other java application
though JMS.

just a suggestion

Nicolás.-

Re: Easiest way to communicate with the WebApp

Posted by Erik Fäßler <er...@uni-jena.de>.
Thanks a lot for your ideas. I already thought of a thread regularly checking on updates.  I will just think a bit more about pros and cons and then implement one of the mentioned possibilities.

Thanks again and best regards,

Erik



Am 12.06.2011 um 14:55 schrieb "Thiago H. de Paula Figueiredo" <th...@gmail.com>:

> On Sun, 12 Jun 2011 08:22:17 -0300, Erik Fäßler <er...@uni-jena.de> wrote:
> 
>> Hey all,
> 
> Hi!
> 
>> the web application I'm developing depends on some resources which may change on a regular basis. I have a plain Java application which is responsible for creating/updating these resources, e.g. a database table.
>> I would like this update application to be able to tell my tapestry web app that new data is available and should be loaded. I would like to send a command like "update" to the web app which then would tell the services that new resources are available and that they should reload these.
>> The question: Which would be easiest way to do this?
> 
> Just create a page and use the page activation context to receive the desired command.
> 
>> I have found a package "tapestry-resteasy" which seems to offer a RESTful interface quite nicely. However, I do not intend to offer a public API to my web application - I would rather hide the update functionality from the public.
> 
> Any URL in a webapp is public, so you need to implement some kind of authentication.
> 
> Another option is to implement a service that opens a server socket to receive the commands. Again, you'll need to implement some kind of authentication.
> 
> -- 
> Thiago H. de Paula Figueiredo
> Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, and instructor
> Owner, Ars Machina Tecnologia da Informação Ltda.
> http://www.arsmachina.com.br


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Easiest way to communicate with the WebApp

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Sun, 12 Jun 2011 08:22:17 -0300, Erik Fäßler  
<er...@uni-jena.de> wrote:

> Hey all,

Hi!

> the web application I'm developing depends on some resources which may  
> change on a regular basis. I have a plain Java application which is  
> responsible for creating/updating these resources, e.g. a database table.
> I would like this update application to be able to tell my tapestry web  
> app that new data is available and should be loaded. I would like to  
> send a command like "update" to the web app which then would tell the  
> services that new resources are available and that they should reload  
> these.
> The question: Which would be easiest way to do this?

Just create a page and use the page activation context to receive the  
desired command.

> I have found a package "tapestry-resteasy" which seems to offer a  
> RESTful interface quite nicely. However, I do not intend to offer a  
> public API to my web application - I would rather hide the update  
> functionality from the public.

Any URL in a webapp is public, so you need to implement some kind of  
authentication.

Another option is to implement a service that opens a server socket to  
receive the commands. Again, you'll need to implement some kind of  
authentication.

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Easiest way to communicate with the WebApp

Posted by "dragan.sahpaskix@gmail.com" <dr...@gmail.com>.
Hi,
You can start a thread in your AppModule with a @Startup method and poll for
changes on a regular interval.

Cheers,
Dragan Sahpaski



On Sun, Jun 12, 2011 at 1:22 PM, Erik Fäßler <er...@uni-jena.de>wrote:

> Hey all,
>
> the web application I'm developing depends on some resources which may
> change on a regular basis. I have a plain Java application which is
> responsible for creating/updating these resources, e.g. a database table.
> I would like this update application to be able to tell my tapestry web app
> that new data is available and should be loaded. I would like to send a
> command like "update" to the web app which then would tell the services that
> new resources are available and that they should reload these.
> The question: Which would be easiest way to do this? I have found a package
> "tapestry-resteasy" which seems to offer a RESTful interface quite nicely.
> However, I do not intend to offer a public API to my web application - I
> would rather hide the update functionality from the public.
>
> I would be glad for a few tips about in which direction I should think and
> search here.
>
> Thanks and best regards,
>
> Erik
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>