From: pieter v. z. <pv...@cs...> - 2006-09-20 15:17:40
|
I don't know AJAX. And now I am going to guess...... I would suggestion modifying CoefficientServlet. Or CoefficientServlet.execute() {.......... CoefficientWebContext ctx =3D new CoefficientWebContext(request, response); interceptor.invoke(ctx); // synchronize with CoefficientContext (reset session variables, // update cookies, forward if needed, etc...) ctx.synchronize(request, response); // Write out the page content ctx.getPage().process(response.getWriter()); ........... } one could modify the response in page.process method, where we are building and adding the page layouts. Hope this helps a bit..... On Tue, 2006-09-19 at 17:18 -0400, Miguel Perez wrote: > I=FFm trying to write a javascript using AJAX to return some values from > the server. >=20 >=20=20 >=20 > For example >=20 > var req; >=20 >=20=20 >=20 > function validate() { >=20 > var idField =3D document.getElementById("userid"); >=20 > var url =3D "validate?id=3D" + escape(idField.value); >=20 > if (window.XMLHttpRequest) { >=20 > req =3D new XMLHttpRequest(); >=20 > } else if (window.ActiveXObject) { >=20 > req =3D new ActiveXObject("Microsoft.XMLHTTP"); >=20 > } >=20 > req.open("GET", url, true); >=20 > req.onreadystatechange =3D callback; >=20 > req.send(null); >=20 > } >=20 >=20=20 >=20 > My question is how do I get the values back from coefficient. I can > execute the methods and a module but I don=FFt have access to > response.getWriter from ctx. >=20 >=20=20 >=20 > Do I need to write a next class, modify CoefficientServlet, or is > there a way to do this via ctx (coefficientcontext)? >=20 >=20=20 >=20 > Any help would be deeply appreciated. >=20 >=20=20 >=20 > regards >=20 >=20=20 >=20 >=20 > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share y= our > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > _______________________________________________ Coefficient-devel mailing= list Coe...@li... https://lists.sourceforge.net= /lists/listinfo/coefficient-devel |
From: pieter v. z. <pv...@cs...> - 2006-09-20 15:46:59
|
My vote goes to Page.process( On Wed, 2006-09-20 at 11:37 -0400, Miguel Perez wrote: > Pieter, >=20 > Thanks for pointing me in the right direction. The objective is to be able > to do a response.getWriter().write("some text") so the web browser can re= ad > the response "some text". >=20 > I was not sure if I should modify CoefficientServlet or > CoefficientWebContext. >=20 >=20 > If you (or anyone on the forum) has any other idea, I would appreciate it. >=20 > Regards >=20 >=20 > -----Original Message----- > From: pieter van zyl [mailto:pv...@cs...]=20 > Sent: Wednesday, September 20, 2006 11:17 AM > To: Miguel Perez > Cc: coe...@li... > Subject: Re: [Coefficient-devel] Asynchronous JavaScript -AJAX >=20 > I don't know AJAX. >=20 > And now I am going to guess...... >=20 > I would suggestion modifying CoefficientServlet. >=20 > Or > CoefficientServlet.execute() {.......... > CoefficientWebContext ctx =3D new CoefficientWebContext(request, > response); > interceptor.invoke(ctx); > // synchronize with CoefficientContext (reset session > variables, > // update cookies, forward if needed, etc...) > ctx.synchronize(request, response); >=20 > // Write out the page content > ctx.getPage().process(response.getWriter()); > .......... > } >=20 > one could modify the response in page.process method, where we are > building and adding the page layouts. >=20 >=20 > Hope this helps a bit..... >=20 > On Tue, 2006-09-19 at 17:18 -0400, Miguel Perez wrote: > > I'm trying to write a javascript using AJAX to return some values from > > the server. > >=20 > >=20=20 > >=20 > > For example > >=20 > > var req; > >=20 > >=20=20 > >=20 > > function validate() { > >=20 > > var idField =3D document.getElementById("userid"); > >=20 > > var url =3D "validate?id=3D" + escape(idField.value); > >=20 > > if (window.XMLHttpRequest) { > >=20 > > req =3D new XMLHttpRequest(); > >=20 > > } else if (window.ActiveXObject) { > >=20 > > req =3D new ActiveXObject("Microsoft.XMLHTTP"); > >=20 > > } > >=20 > > req.open("GET", url, true); > >=20 > > req.onreadystatechange =3D callback; > >=20 > > req.send(null); > >=20 > > } > >=20 > >=20=20 > >=20 > > My question is how do I get the values back from coefficient. I can > > execute the methods and a module but I don't have access to > > response.getWriter from ctx. > >=20 > >=20=20 > >=20 > > Do I need to write a next class, modify CoefficientServlet, or is > > there a way to do this via ctx (coefficientcontext)? > >=20 > >=20=20 > >=20 > > Any help would be deeply appreciated. > >=20 > >=20=20 > >=20 > > regards > >=20 > >=20=20 > >=20 > >=20 > > -----------------------------------------------------------------------= -- > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > > opinions on IT & business topics through brief surveys -- and earn cash > > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID= =3DDEVDEV > > _______________________________________________ Coefficient-devel maili= ng > list Coe...@li... > https://lists.sourceforge.net/lists/listinfo/coefficient-devel >=20 >=20 > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share y= our > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3D= DEVDEV > _______________________________________________ > Coefficient-devel mailing list > Coe...@li... > https://lists.sourceforge.net/lists/listinfo/coefficient-devel |
From: Miguel P. <mr_...@ho...> - 2006-09-20 16:19:12
|
I'll see if I can do it via the page.process Thanks -----Original Message----- From: coe...@li... [mailto:coe...@li...] On Behalf Of pieter van zyl Sent: Wednesday, September 20, 2006 11:46 AM To: Miguel Perez Cc: coe...@li... Subject: Re: [Coefficient-devel] Asynchronous JavaScript -AJAX My vote goes to Page.process( On Wed, 2006-09-20 at 11:37 -0400, Miguel Perez wrote: > Pieter, > > Thanks for pointing me in the right direction. The objective is to be able > to do a response.getWriter().write("some text") so the web browser can read > the response "some text". > > I was not sure if I should modify CoefficientServlet or > CoefficientWebContext. > > > If you (or anyone on the forum) has any other idea, I would appreciate it. > > Regards > > > -----Original Message----- > From: pieter van zyl [mailto:pv...@cs...] > Sent: Wednesday, September 20, 2006 11:17 AM > To: Miguel Perez > Cc: coe...@li... > Subject: Re: [Coefficient-devel] Asynchronous JavaScript -AJAX > > I don't know AJAX. > > And now I am going to guess...... > > I would suggestion modifying CoefficientServlet. > > Or > CoefficientServlet.execute() {.......... > CoefficientWebContext ctx = new CoefficientWebContext(request, > response); > interceptor.invoke(ctx); > // synchronize with CoefficientContext (reset session > variables, > // update cookies, forward if needed, etc...) > ctx.synchronize(request, response); > > // Write out the page content > ctx.getPage().process(response.getWriter()); > .......... > } > > one could modify the response in page.process method, where we are > building and adding the page layouts. > > > Hope this helps a bit..... > > On Tue, 2006-09-19 at 17:18 -0400, Miguel Perez wrote: > > I'm trying to write a javascript using AJAX to return some values from > > the server. > > > > > > > > For example > > > > var req; > > > > > > > > function validate() { > > > > var idField = document.getElementById("userid"); > > > > var url = "validate?id=" + escape(idField.value); > > > > if (window.XMLHttpRequest) { > > > > req = new XMLHttpRequest(); > > > > } else if (window.ActiveXObject) { > > > > req = new ActiveXObject("Microsoft.XMLHTTP"); > > > > } > > > > req.open("GET", url, true); > > > > req.onreadystatechange = callback; > > > > req.send(null); > > > > } > > > > > > > > My question is how do I get the values back from coefficient. I can > > execute the methods and a module but I don't have access to > > response.getWriter from ctx. > > > > > > > > Do I need to write a next class, modify CoefficientServlet, or is > > there a way to do this via ctx (coefficientcontext)? > > > > > > > > Any help would be deeply appreciated. > > > > > > > > regards > > > > > > > > > > ------------------------------------------------------------------------- > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > > opinions on IT & business topics through brief surveys -- and earn cash > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > _______________________________________________ Coefficient-devel mailing > list Coe...@li... > https://lists.sourceforge.net/lists/listinfo/coefficient-devel > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Coefficient-devel mailing list > Coe...@li... > https://lists.sourceforge.net/lists/listinfo/coefficient-devel |
From: Dylan E. <dyl...@gm...> - 2006-09-20 21:56:46
|
Why not add something like DWR, http://getahead.ltd.uk/dwr/ to your coefficient deployment. DWR deploys as a servlet and it allows you to write simple java beans that are exposed via javascript objects. This would allow you to get server-side where you can then access coefficient progamatically to find the information you are after. You can return your new html from the bean call and use javascript to update you html (client side). I am pretty sure that should work. Dylan On 9/21/06, Miguel Perez <mr_...@ho...> wrote: > > I'll see if I can do it via the page.process > > Thanks > > -----Original Message----- > From: coe...@li... > [mailto:coe...@li...] On Behalf Of > pieter > van zyl > Sent: Wednesday, September 20, 2006 11:46 AM > To: Miguel Perez > Cc: coe...@li... > Subject: Re: [Coefficient-devel] Asynchronous JavaScript -AJAX > > My vote goes to Page.process( > > On Wed, 2006-09-20 at 11:37 -0400, Miguel Perez wrote: > > Pieter, > > > > Thanks for pointing me in the right direction. The objective is to be > able > > to do a response.getWriter().write("some text") so the web browser can > read > > the response "some text". > > > > I was not sure if I should modify CoefficientServlet or > > CoefficientWebContext. > > > > > > If you (or anyone on the forum) has any other idea, I would appreciate > it. > > > > Regards > > > > > > -----Original Message----- > > From: pieter van zyl [mailto:pv...@cs...] > > Sent: Wednesday, September 20, 2006 11:17 AM > > To: Miguel Perez > > Cc: coe...@li... > > Subject: Re: [Coefficient-devel] Asynchronous JavaScript -AJAX > > > > I don't know AJAX. > > > > And now I am going to guess...... > > > > I would suggestion modifying CoefficientServlet. > > > > Or > > CoefficientServlet.execute() {.......... > > CoefficientWebContext ctx = new CoefficientWebContext(request, > > response); > > interceptor.invoke(ctx); > > // synchronize with CoefficientContext (reset session > > variables, > > // update cookies, forward if needed, etc...) > > ctx.synchronize(request, response); > > > > // Write out the page content > > ctx.getPage().process(response.getWriter()); > > .......... > > } > > > > one could modify the response in page.process method, where we are > > building and adding the page layouts. > > > > > > Hope this helps a bit..... > > > > On Tue, 2006-09-19 at 17:18 -0400, Miguel Perez wrote: > > > I'm trying to write a javascript using AJAX to return some values from > > > the server. > > > > > > > > > > > > For example > > > > > > var req; > > > > > > > > > > > > function validate() { > > > > > > var idField = document.getElementById("userid"); > > > > > > var url = "validate?id=" + escape(idField.value); > > > > > > if (window.XMLHttpRequest) { > > > > > > req = new XMLHttpRequest(); > > > > > > } else if (window.ActiveXObject) { > > > > > > req = new ActiveXObject("Microsoft.XMLHTTP"); > > > > > > } > > > > > > req.open("GET", url, true); > > > > > > req.onreadystatechange = callback; > > > > > > req.send(null); > > > > > > } > > > > > > > > > > > > My question is how do I get the values back from coefficient. I can > > > execute the methods and a module but I don't have access to > > > response.getWriter from ctx. > > > > > > > > > > > > Do I need to write a next class, modify CoefficientServlet, or is > > > there a way to do this via ctx (coefficientcontext)? > > > > > > > > > > > > Any help would be deeply appreciated. > > > > > > > > > > > > regards > > > > > > > > > > > > > > > > ------------------------------------------------------------------------- > > > Take Surveys. Earn Cash. Influence the Future of IT > > > Join SourceForge.net's Techsay panel and you'll get the chance to > share > > your > > > opinions on IT & business topics through brief surveys -- and earn > cash > > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > > _______________________________________________ Coefficient-devel > mailing > > list Coe...@li... > > https://lists.sourceforge.net/lists/listinfo/coefficient-devel > > > > > > > ------------------------------------------------------------------------- > > Take Surveys. Earn Cash. Influence the Future of IT > > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > > opinions on IT & business topics through brief surveys -- and earn cash > > > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > _______________________________________________ > > Coefficient-devel mailing list > > Coe...@li... > > https://lists.sourceforge.net/lists/listinfo/coefficient-devel > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Coefficient-devel mailing list > Coe...@li... > https://lists.sourceforge.net/lists/listinfo/coefficient-devel > |
From: Miguel P. <mr_...@ho...> - 2006-09-20 15:38:22
|
Pieter, Thanks for pointing me in the right direction. The objective is to be able to do a response.getWriter().write("some text") so the web browser can read the response "some text". I was not sure if I should modify CoefficientServlet or CoefficientWebContext. If you (or anyone on the forum) has any other idea, I would appreciate it. Regards -----Original Message----- From: pieter van zyl [mailto:pv...@cs...] Sent: Wednesday, September 20, 2006 11:17 AM To: Miguel Perez Cc: coe...@li... Subject: Re: [Coefficient-devel] Asynchronous JavaScript -AJAX I don't know AJAX. And now I am going to guess...... I would suggestion modifying CoefficientServlet. Or CoefficientServlet.execute() {.......... CoefficientWebContext ctx = new CoefficientWebContext(request, response); interceptor.invoke(ctx); // synchronize with CoefficientContext (reset session variables, // update cookies, forward if needed, etc...) ctx.synchronize(request, response); // Write out the page content ctx.getPage().process(response.getWriter()); .......... } one could modify the response in page.process method, where we are building and adding the page layouts. Hope this helps a bit..... On Tue, 2006-09-19 at 17:18 -0400, Miguel Perez wrote: > I'm trying to write a javascript using AJAX to return some values from > the server. > > > > For example > > var req; > > > > function validate() { > > var idField = document.getElementById("userid"); > > var url = "validate?id=" + escape(idField.value); > > if (window.XMLHttpRequest) { > > req = new XMLHttpRequest(); > > } else if (window.ActiveXObject) { > > req = new ActiveXObject("Microsoft.XMLHTTP"); > > } > > req.open("GET", url, true); > > req.onreadystatechange = callback; > > req.send(null); > > } > > > > My question is how do I get the values back from coefficient. I can > execute the methods and a module but I don't have access to > response.getWriter from ctx. > > > > Do I need to write a next class, modify CoefficientServlet, or is > there a way to do this via ctx (coefficientcontext)? > > > > Any help would be deeply appreciated. > > > > regards > > > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys -- and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ Coefficient-devel mailing list Coe...@li... https://lists.sourceforge.net/lists/listinfo/coefficient-devel |