You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by Vijay Korimilli <vk...@gmail.com> on 2006/09/18 14:28:34 UTC

Ofbiz caching - JMeter Performance results on Ofbiz eCommerce store

Hi,

I did Jmeter performance testing on the Ofbiz server and the results are not
satisfactory. Here are the results:
- for 5 concurrent users (30 loops), the average response time is 2.5 secs
and 90% line is 5 secs.
- for 40 concurrent users (10 loops), the average response time is 27 secs
and 90% line is 44 secs.

For 40 concurrent users,
on ofbiz server - CPU spikes to 99% quite often and memory is as high as 44%
on db server  - CPU spikes to 99% here too! memory usage is low though

Other details:
- The Ofbiz server and mysql database are on seperate servers (AMD Opteron
(Sun V20z), Cent OS, 8GB and 4GM RAM respectively).
- From the cache management webtools, the number of cache misses have been
quite less compared to the number of hits, which I think is correct.
- The cache settings are in according to as suggested in
OFBizBasicProductionSetup.pdf, with commented last lines in
cache.propertiesand with correct xms and xmx settings.
- We did do some modifications to the UI from the default eCommerce store
but only at UI level.

What I am not able to understand is why does the db server CPU needs to go
such high if caching was working perfectly. Concern is using such a good
hardware, or is there anything I am missing something basic about Ofbiz
caching.

Would appreciate any help.

Thanks,
Vijay.

Re: Ofbiz caching - JMeter Performance results on Ofbiz eCommerce store

Posted by Jacques Le Roux <ja...@les7arts.com>.
You may be interested by this thread

http://www.nabble.com/Entity-Engine-Performance-tf2252097.html#a6246280

Jacques

----- Original Message ----- 
From: "Vijay Korimilli" <vk...@gmail.com>
To: <of...@incubator.apache.org>
Sent: Monday, September 18, 2006 2:28 PM
Subject: Ofbiz caching - JMeter Performance results on Ofbiz eCommerce store


> Hi,
> 
> I did Jmeter performance testing on the Ofbiz server and the results are not
> satisfactory. Here are the results:
> - for 5 concurrent users (30 loops), the average response time is 2.5 secs
> and 90% line is 5 secs.
> - for 40 concurrent users (10 loops), the average response time is 27 secs
> and 90% line is 44 secs.
> 
> For 40 concurrent users,
> on ofbiz server - CPU spikes to 99% quite often and memory is as high as 44%
> on db server  - CPU spikes to 99% here too! memory usage is low though
> 
> Other details:
> - The Ofbiz server and mysql database are on seperate servers (AMD Opteron
> (Sun V20z), Cent OS, 8GB and 4GM RAM respectively).
> - From the cache management webtools, the number of cache misses have been
> quite less compared to the number of hits, which I think is correct.
> - The cache settings are in according to as suggested in
> OFBizBasicProductionSetup.pdf, with commented last lines in
> cache.propertiesand with correct xms and xmx settings.
> - We did do some modifications to the UI from the default eCommerce store
> but only at UI level.
> 
> What I am not able to understand is why does the db server CPU needs to go
> such high if caching was working perfectly. Concern is using such a good
> hardware, or is there anything I am missing something basic about Ofbiz
> caching.
> 
> Would appreciate any help.
> 
> Thanks,
> Vijay.
> 

Re: AJAX and HttpSession

Posted by tibor katelbach <oc...@gmail.com>.
I dont understand why , if your AJAX is calling a url that is in the
controller
you process will have the same access as any other request call.
This works for sure, I tested it.
Regards
Tibor

On 9/18/06, Amit Shinde <am...@amicontech.com> wrote:
>
> Hello,
>         I was wondering if anyone has played with AJAX. I want to call a
> OFBiz
> service by making an XMLHttpRequest. I have a RequestHandler that is
> supposed to process this request. The problem I am facing is of
> HttpSession.
> Even though I am logged in, I get userLogin, dispatcher and delegator
> attributes null. Is there a way where we can get our HttpSession
> attributes
> from XMLHttpRequest. Do we need to do any special thing or is this just a
> limitation?
>
>         Without a valid HttpSession, I obviously cant run the service
> unless I pass
> userLoginId in the XMLHttpRequest and get UserLogin value through
> delegator.
> This approach will pose a security hazard nonetheless.
>
>         Any insight will be appreciated.
>
>
> Thanks in advance,
>
> Amit Shinde
>
>
>
>
>
>
>

Re: AJAX and HttpSession

Posted by Florin Jurcovici <fl...@mail.dnttm.ro>.
Hello.

Maybe it would make sense to monitor the http dialog between server and  
browser, to see if the authentication headers get sent from the browser  
with the XMLHttpRequest, and if they were obtained by the browser during  
the previous request - the one for the content filling the window from  
where the XMLHttpRequest is sent.

What we found out with an exotic web server is that even if you do a call  
to the server and send the authentication headers, the server won't send  
them back unless the resource you request requires authentication (I  
dunno, maybe that's in the spec, but it's odd). So if you have a window  
displaying a resource requiring authentication, then open a new one, from  
Javascript, which displays content not requiring authentication, then  
issue an XMLHttpRequest from this second window, it is possible that the  
XMLHttpRequest will not contain the authentication headers by default. If  
this is your problem, I can't see any other solution than making the  
resource from within which you send the XMLHttpRequest a protected one,  
for wich authentication is required.

In case you wonder, Ethereal is a free and nice traffic sniffer, which we  
used to diagnose such problems.

br,

-- 
Florin Jurcovici
------------------
Why do psychics have to ask you for your name?

On Mon, 18 Sep 2006 16:41:23 +0300, Amit Shinde <am...@amicontech.com>  
wrote:

> Hello,
> 	I was wondering if anyone has played with AJAX. I want to call a OFBiz
> service by making an XMLHttpRequest. I have a RequestHandler that is
> supposed to process this request. The problem I am facing is of  
> HttpSession.
> Even though I am logged in, I get userLogin, dispatcher and delegator
> attributes null. Is there a way where we can get our HttpSession  
> attributes
> from XMLHttpRequest. Do we need to do any special thing or is this just a
> limitation?
>
> 	Without a valid HttpSession, I obviously cant run the service unless I  
> pass
> userLoginId in the XMLHttpRequest and get UserLogin value through  
> delegator.
> This approach will pose a security hazard nonetheless.
>
> 	Any insight will be appreciated.
>
>
> Thanks in advance,
>
> Amit Shinde
>
>
>
>
>
>




Re: AJAX and HttpSession

Posted by "G.Venkata Phanindra" <ph...@gmail.com>.
Hi,
        I was able to use ajax and post a data to one of my services in
Ofbiz and i just specified as /control/xxxxxx it worked fine for me.
Check java Script console if u r using Mozilla.U may find some Java Script
related error .
Cheers
Phani

On 9/18/06, tibor katelbach <oc...@gmail.com> wrote:
>
> try
> req.open("POST", "/erp/control/dyna", true);
>
> the call has to start from the base.
>
> here's mine
> xhr_object.open("GET", "/PBBO/catalog/control/getimporterror?date="+new
> Date().getTime(), true);
>
> Tibor
>
> On 9/18/06, Amit Shinde <am...@amicontech.com> wrote:
> >
> > Lon,
> >         Heres the URL -
> >
> >
> >
> > Amit
> >
> >
> > -----Original Message-----
> > From: Lon Binder [mailto:lfb@alexanderinteractive.com]
> > Sent: Monday, September 18, 2006 7:18 PM
> > To: ofbiz-user@incubator.apache.org
> > Subject: RE: AJAX and HttpSession
> >
> >
> > Amit,
> >
> > What URL are you requesting?  The app server doesn't know the difference
> > between plain browser requests and ajax requests.  It's just a matter of
> > URL construction.
> >
> > - Lon
> >
> >
> > -----Original Message-----
> > From: Amit Shinde [mailto:amit@amicontech.com]
> > Sent: Monday, September 18, 2006 9:41 AM
> > To: ofbiz-user@incubator.apache.org
> > Subject: AJAX and HttpSession
> >
> > Hello,
> >         I was wondering if anyone has played with AJAX. I want to call a
> > OFBiz service by making an XMLHttpRequest. I have a RequestHandler that
> > is supposed to process this request. The problem I am facing is of
> > HttpSession.
> > Even though I am logged in, I get userLogin, dispatcher and delegator
> > attributes null. Is there a way where we can get our HttpSession
> > attributes from XMLHttpRequest. Do we need to do any special thing or is
> > this just a limitation?
> >
> >         Without a valid HttpSession, I obviously cant run the service
> > unless I pass userLoginId in the XMLHttpRequest and get UserLogin value
> > through delegator.
> > This approach will pose a security hazard nonetheless.
> >
> >         Any insight will be appreciated.
> >
> >
> > Thanks in advance,
> >
> > Amit Shinde
> >
> >
> >
> >
> >
> >
> >
>
>


-- 
G.Venkata Phanindra
Mob:: 9849852989

Romanian ofbiz users?

Posted by Florin Jurcovici <fl...@mail.dnttm.ro>.
Hello.

Any Romanian ofbiz users in here?

br,

-- 
Florin Jurcovici
------------------
Why do psychics have to ask you for your name?

BOM - Cost Question

Posted by Marcelo Hamra <ma...@hotmail.com>.
When I run a BOM Simulation, I couldn't get calculated the cost and total 
cost fields. Does someone knows why it is ocurring? I defined costs in the 
product cost tab for one raw material but nothing
happens. I've tried using the auto-calculate cost button, but it seems it 
does nothing either.

Thanks in Advance.
Marcelo



RE: AJAX and HttpSession

Posted by Lon Binder <lf...@alexanderinteractive.com>.
I recommend considering DOJO toolkit.  It's much richer in AJAX
functionality and is well sponsored by IBM, AOL, OpenLaszlo and more.

http://dojotoolkit.org/

 - Lon
 

-----Original Message-----
From: Leon Torres [mailto:leon@oss.minimetria.com] 
Sent: Thursday, September 21, 2006 12:03 PM
To: ofbiz-user@incubator.apache.org
Subject: Re: AJAX and HttpSession

Yes,

  *  Prototype is freely distributable under the terms of an MIT-style
license.
  *  For details, see the Prototype web site:
http://prototype.conio.net/

One of the neat things about Ajax is simplification of the UI.  If you
tried the demo, I merged the two input boxes into "Accounts or Leads" to
allow lookup on both.  The result is so cool that I keep playing with
the possibilities instead of writing the howto of it.

- Leon


Andrew Sykes wrote:
> Si,
> 
> Is the MIT License compatible?
> 
> I think it is, but can't remember for sure...
> 
> - Andrew
> 
> On Thu, 2006-09-21 at 07:41 -0700, Si Chen wrote:
>> We thought it was good to integrate something called prototype.js 
>> which is pretty lightweight and saves us from writing the ajax stuff.
>>
>> You can take a look at it yourself:
>> demo - http://demo.opentaps.org:8086/crmsfa/control/main - login as 
>> "DemoSalesManager/crmsfa" and go to "Opportunities"  The create 
>> opportunity box uses ajax to complete the account name checkout the 
>> code svn co svn://svn.opentaps.org/crmsfa/versions/1.0/
>> trunk
>>
>> Si
>>
>>
>> On Sep 20, 2006, at 11:48 AM, tibor katelbach wrote:
>>
>>> Hi all
>>> I just read this post,
>>> having worked quite a bit with ajax , it can get a bit chaotic if a 
>>> choice has to be made amongst all available scripts and ajax base 
>>> codes.
>>> They have great features but the hard part can be making the choice 
>>> ( openrico.org or http://www.zkoss.org/ are also interesting )
>>>
>>> But ajax being so simple to set up, it would be simplest  to set up 
>>> ofbiz's own ajax.js.
>>>
>>> After that Ajax calls work perfectly with ofbiz's REST url's, screen

>>> widget .
>>> example of where ajax came in handy for us :
>>>
>>> - retreiving event or error messages from session attributes as 
>>> asynchronous services were launched.
>>> - autocompletion
>>> - databse updates
>>>
>>> my two cents
>>> Regards
>>> Tibor
>>>
>>>
>>>
>>>
>>>
>>> On 9/20/06, Leon Torres <le...@oss.minimetria.com> wrote:
>>>> Prototype. This will be explained in the document. :)
>>>>
>>>> It might be a good exercise to attempt the same feature in other 
>>>> frameworks.
>>>> I've already tried with Dojo and some others, of which the 
>>>> impression are explained in the tutorial.
>>>>
>>>> - Leon
>>>>
>>>>
>>>> Andrew Sykes wrote:
>>>>> Leon,
>>>>>
>>>>> What technology have you settled on?
>>>>>
>>>>> - Andrew
>>>>>
>>>>> On Tue, 2006-09-19 at 08:18 -0700, Leon Torres wrote:
>>>>>> Great Idea.  Our document is crmsfa based because we're
>>>> actually using
>>>> it and
>>>>>> have a live demo.  The css and javascript libraries are in place.
>>>> However, it
>>>>>> should be easy to create one for example/ that autocompletes
>>>> Person
>>>> based on our
>>>>>> implementation.
>>>>>>
>>>>>> I hope the dust settles in AJAX, but I bet there will be several
>>>> different
>>>>>> mainstream approaches, just like there are several different
>>>> scripting
>>>> languages
>>>>>> that fill the scripting niche.  We're going to have to settle
>>>> for one,
>>>> just like
>>>>>> we settled on freemarker and bsh.  :-)
>>>>>>
>>>>>> - Leon
>>>>>>
>>>>>>
>>>>>>
>>>>>> David E Jones wrote:
>>>>>>> It would be great to have an example/poc or two in different
>>>> parts of
>>>>>>> the project, or even in the example component, that people can
>>>> look at
>>>>>>> and use as a basis for other parts of the project or
>>>> customizations or
>>>>>>> whatever.
>>>>>>>
>>>>>>> Given the somewhat chaotic nature of the AJAX world, it might
>>>> be nice
>>>> to
>>>>>>> have multiple PoC bits in place to compare things for making a
>>>> decision
>>>>>>> for other parts.
>>>>>>>
>>>>>>> -David
>>>>>>>
>>>>>>>
>>>>>>> On Sep 18, 2006, at 6:23 PM, Leon Torres wrote:
>>>>>>>
>>>>>>>> By the way, we'll be publishing a tutorial for using AJAX to
>>>> create
>>>> an
>>>>>>>> autocomplete text field sometime this week.
>>>>>>>>
>>>>>>>> - Leon Torres
>>>>>>>> Open Source Strategies Inc.
>>>>>>>>
>>>>>>>>
>>>>>>>> Amit Shinde wrote:
>>>>>>>>> That worked! I can get userLogin now but LocalDispatcher with
>>>> dispatcher
>>>>>>>>> attribute is still null. That is not a big deal as I get the 
>>>>>>>>> LocalDispatcher this way - LocalDispatcher dispatcher = 
>>>>>>>>> GenericDispatcher.getLocalDispatcher("local",
>>>>>>>>> delegator);
>>>>>>>>> Thanks for all the help,
>>>>>>>>> Amit Shinde
>>>>>>>>> -----Original Message-----
>>>>>>>>> From: tibor katelbach [mailto:oceatoon@gmail.com]
>>>>>>>>> Sent: Monday, September 18, 2006 7:32 PM
>>>>>>>>> To: ofbiz-user@incubator.apache.org
>>>>>>>>> Subject: Re: AJAX and HttpSession try req.open("POST", 
>>>>>>>>> "/erp/control/dyna", true); the call has to start from the 
>>>>>>>>> base.
>>>>>>>>> here's mine
>>>>>>>>> xhr_object.open("GET",
>>>> "/PBBO/catalog/control/getimporterror?date="+new
>>>>>>>>> Date().getTime(), true);
>>>>>>>>> Tibor
>>>>>>>>> On 9/18/06, Amit Shinde <am...@amicontech.com> wrote:
>>>>>>>>>> Lon,
>>>>>>>>>>         Heres the URL -
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Amit
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> -----Original Message-----
>>>>>>>>>> From: Lon Binder [mailto:lfb@alexanderinteractive.com]
>>>>>>>>>> Sent: Monday, September 18, 2006 7:18 PM
>>>>>>>>>> To: ofbiz-user@incubator.apache.org
>>>>>>>>>> Subject: RE: AJAX and HttpSession
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Amit,
>>>>>>>>>>
>>>>>>>>>> What URL are you requesting?  The app server doesn't know the

>>>>>>>>>> difference between plain browser requests and ajax requests.

>>>>>>>>>> It's just a matter of URL construction.
>>>>>>>>>>
>>>>>>>>>> - Lon
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> -----Original Message-----
>>>>>>>>>> From: Amit Shinde [mailto:amit@amicontech.com]
>>>>>>>>>> Sent: Monday, September 18, 2006 9:41 AM
>>>>>>>>>> To: ofbiz-user@incubator.apache.org
>>>>>>>>>> Subject: AJAX and HttpSession
>>>>>>>>>>
>>>>>>>>>> Hello,
>>>>>>>>>>         I was wondering if anyone has played with AJAX. I
>>>> want to
>>>>>>>>>> call a
>>>>>>>>>> OFBiz service by making an XMLHttpRequest. I have a
>>>> RequestHandler
>>>> that
>>>>>>>>>> is supposed to process this request. The problem I am
>>>> facing is of
>>>>>>>>>> HttpSession.
>>>>>>>>>> Even though I am logged in, I get userLogin, dispatcher and
>>>> delegator
>>>>>>>>>> attributes null. Is there a way where we can get our
>>>> HttpSession
>>>>>>>>>> attributes from XMLHttpRequest. Do we need to do any
>>>> special thing
>>>>>>>>>> or is
>>>>>>>>>> this just a limitation?
>>>>>>>>>>
>>>>>>>>>>         Without a valid HttpSession, I obviously cant run the
>>>> service
>>>>>>>>>> unless I pass userLoginId in the XMLHttpRequest and get
>>>> UserLogin
>>>> value
>>>>>>>>>> through delegator.
>>>>>>>>>> This approach will pose a security hazard nonetheless.
>>>>>>>>>>
>>>>>>>>>>         Any insight will be appreciated.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Thanks in advance,
>>>>>>>>>>
>>>>>>>>>> Amit Shinde
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>

Re: AJAX and HttpSession

Posted by Leon Torres <le...@oss.minimetria.com>.
Yes,

  *  Prototype is freely distributable under the terms of an MIT-style license.
  *  For details, see the Prototype web site: http://prototype.conio.net/

One of the neat things about Ajax is simplification of the UI.  If you tried the 
demo, I merged the two input boxes into "Accounts or Leads" to allow lookup on 
both.  The result is so cool that I keep playing with the possibilities instead 
of writing the howto of it.

- Leon


Andrew Sykes wrote:
> Si,
> 
> Is the MIT License compatible?
> 
> I think it is, but can't remember for sure...
> 
> - Andrew
> 
> On Thu, 2006-09-21 at 07:41 -0700, Si Chen wrote:
>> We thought it was good to integrate something called prototype.js  
>> which is pretty lightweight and saves us from writing the ajax stuff.
>>
>> You can take a look at it yourself:
>> demo - http://demo.opentaps.org:8086/crmsfa/control/main - login as  
>> "DemoSalesManager/crmsfa" and go to "Opportunities"  The create  
>> opportunity box uses ajax to complete the account name
>> checkout the code svn co svn://svn.opentaps.org/crmsfa/versions/1.0/ 
>> trunk
>>
>> Si
>>
>>
>> On Sep 20, 2006, at 11:48 AM, tibor katelbach wrote:
>>
>>> Hi all
>>> I just read this post,
>>> having worked quite a bit with ajax ,
>>> it can get a bit chaotic if a choice has to be made amongst all  
>>> available
>>> scripts and ajax base codes.
>>> They have great features but the hard part can be making the choice (
>>> openrico.org or http://www.zkoss.org/ are also interesting )
>>>
>>> But ajax being so simple to set up, it would be simplest  to set up  
>>> ofbiz's
>>> own ajax.js.
>>>
>>> After that Ajax calls work perfectly with ofbiz's REST url's,  
>>> screen widget
>>> .
>>> example of where ajax came in handy for us :
>>>
>>> - retreiving event or error messages from session attributes as  
>>> asynchronous
>>> services were launched.
>>> - autocompletion
>>> - databse updates
>>>
>>> my two cents
>>> Regards
>>> Tibor
>>>
>>>
>>>
>>>
>>>
>>> On 9/20/06, Leon Torres <le...@oss.minimetria.com> wrote:
>>>> Prototype. This will be explained in the document. :)
>>>>
>>>> It might be a good exercise to attempt the same feature in other
>>>> frameworks.
>>>> I've already tried with Dojo and some others, of which the  
>>>> impression are
>>>> explained in the tutorial.
>>>>
>>>> - Leon
>>>>
>>>>
>>>> Andrew Sykes wrote:
>>>>> Leon,
>>>>>
>>>>> What technology have you settled on?
>>>>>
>>>>> - Andrew
>>>>>
>>>>> On Tue, 2006-09-19 at 08:18 -0700, Leon Torres wrote:
>>>>>> Great Idea.  Our document is crmsfa based because we're  
>>>> actually using
>>>> it and
>>>>>> have a live demo.  The css and javascript libraries are in place.
>>>> However, it
>>>>>> should be easy to create one for example/ that autocompletes  
>>>> Person
>>>> based on our
>>>>>> implementation.
>>>>>>
>>>>>> I hope the dust settles in AJAX, but I bet there will be several
>>>> different
>>>>>> mainstream approaches, just like there are several different  
>>>> scripting
>>>> languages
>>>>>> that fill the scripting niche.  We're going to have to settle  
>>>> for one,
>>>> just like
>>>>>> we settled on freemarker and bsh.  :-)
>>>>>>
>>>>>> - Leon
>>>>>>
>>>>>>
>>>>>>
>>>>>> David E Jones wrote:
>>>>>>> It would be great to have an example/poc or two in different  
>>>> parts of
>>>>>>> the project, or even in the example component, that people can  
>>>> look at
>>>>>>> and use as a basis for other parts of the project or  
>>>> customizations or
>>>>>>> whatever.
>>>>>>>
>>>>>>> Given the somewhat chaotic nature of the AJAX world, it might  
>>>> be nice
>>>> to
>>>>>>> have multiple PoC bits in place to compare things for making a
>>>> decision
>>>>>>> for other parts.
>>>>>>>
>>>>>>> -David
>>>>>>>
>>>>>>>
>>>>>>> On Sep 18, 2006, at 6:23 PM, Leon Torres wrote:
>>>>>>>
>>>>>>>> By the way, we'll be publishing a tutorial for using AJAX to  
>>>> create
>>>> an
>>>>>>>> autocomplete text field sometime this week.
>>>>>>>>
>>>>>>>> - Leon Torres
>>>>>>>> Open Source Strategies Inc.
>>>>>>>>
>>>>>>>>
>>>>>>>> Amit Shinde wrote:
>>>>>>>>> That worked! I can get userLogin now but LocalDispatcher with
>>>> dispatcher
>>>>>>>>> attribute is still null. That is not a big deal as I get the
>>>>>>>>> LocalDispatcher
>>>>>>>>> this way -
>>>>>>>>> LocalDispatcher dispatcher =
>>>>>>>>> GenericDispatcher.getLocalDispatcher("local",
>>>>>>>>> delegator);
>>>>>>>>> Thanks for all the help,
>>>>>>>>> Amit Shinde
>>>>>>>>> -----Original Message-----
>>>>>>>>> From: tibor katelbach [mailto:oceatoon@gmail.com]
>>>>>>>>> Sent: Monday, September 18, 2006 7:32 PM
>>>>>>>>> To: ofbiz-user@incubator.apache.org
>>>>>>>>> Subject: Re: AJAX and HttpSession
>>>>>>>>> try
>>>>>>>>> req.open("POST", "/erp/control/dyna", true);
>>>>>>>>> the call has to start from the base.
>>>>>>>>> here's mine
>>>>>>>>> xhr_object.open("GET",
>>>> "/PBBO/catalog/control/getimporterror?date="+new
>>>>>>>>> Date().getTime(), true);
>>>>>>>>> Tibor
>>>>>>>>> On 9/18/06, Amit Shinde <am...@amicontech.com> wrote:
>>>>>>>>>> Lon,
>>>>>>>>>>         Heres the URL -
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Amit
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> -----Original Message-----
>>>>>>>>>> From: Lon Binder [mailto:lfb@alexanderinteractive.com]
>>>>>>>>>> Sent: Monday, September 18, 2006 7:18 PM
>>>>>>>>>> To: ofbiz-user@incubator.apache.org
>>>>>>>>>> Subject: RE: AJAX and HttpSession
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Amit,
>>>>>>>>>>
>>>>>>>>>> What URL are you requesting?  The app server doesn't know the
>>>>>>>>>> difference
>>>>>>>>>> between plain browser requests and ajax requests.  It's just a
>>>>>>>>>> matter of
>>>>>>>>>> URL construction.
>>>>>>>>>>
>>>>>>>>>> - Lon
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> -----Original Message-----
>>>>>>>>>> From: Amit Shinde [mailto:amit@amicontech.com]
>>>>>>>>>> Sent: Monday, September 18, 2006 9:41 AM
>>>>>>>>>> To: ofbiz-user@incubator.apache.org
>>>>>>>>>> Subject: AJAX and HttpSession
>>>>>>>>>>
>>>>>>>>>> Hello,
>>>>>>>>>>         I was wondering if anyone has played with AJAX. I  
>>>> want to
>>>>>>>>>> call a
>>>>>>>>>> OFBiz service by making an XMLHttpRequest. I have a  
>>>> RequestHandler
>>>> that
>>>>>>>>>> is supposed to process this request. The problem I am  
>>>> facing is of
>>>>>>>>>> HttpSession.
>>>>>>>>>> Even though I am logged in, I get userLogin, dispatcher and
>>>> delegator
>>>>>>>>>> attributes null. Is there a way where we can get our  
>>>> HttpSession
>>>>>>>>>> attributes from XMLHttpRequest. Do we need to do any  
>>>> special thing
>>>>>>>>>> or is
>>>>>>>>>> this just a limitation?
>>>>>>>>>>
>>>>>>>>>>         Without a valid HttpSession, I obviously cant run the
>>>> service
>>>>>>>>>> unless I pass userLoginId in the XMLHttpRequest and get  
>>>> UserLogin
>>>> value
>>>>>>>>>> through delegator.
>>>>>>>>>> This approach will pose a security hazard nonetheless.
>>>>>>>>>>
>>>>>>>>>>         Any insight will be appreciated.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Thanks in advance,
>>>>>>>>>>
>>>>>>>>>> Amit Shinde
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>

Re: AJAX and HttpSession

Posted by Andrew Sykes <an...@sykesdevelopment.com>.
Si,

Is the MIT License compatible?

I think it is, but can't remember for sure...

- Andrew

On Thu, 2006-09-21 at 07:41 -0700, Si Chen wrote:
> We thought it was good to integrate something called prototype.js  
> which is pretty lightweight and saves us from writing the ajax stuff.
> 
> You can take a look at it yourself:
> demo - http://demo.opentaps.org:8086/crmsfa/control/main - login as  
> "DemoSalesManager/crmsfa" and go to "Opportunities"  The create  
> opportunity box uses ajax to complete the account name
> checkout the code svn co svn://svn.opentaps.org/crmsfa/versions/1.0/ 
> trunk
> 
> Si
> 
> 
> On Sep 20, 2006, at 11:48 AM, tibor katelbach wrote:
> 
> > Hi all
> > I just read this post,
> > having worked quite a bit with ajax ,
> > it can get a bit chaotic if a choice has to be made amongst all  
> > available
> > scripts and ajax base codes.
> > They have great features but the hard part can be making the choice (
> > openrico.org or http://www.zkoss.org/ are also interesting )
> >
> > But ajax being so simple to set up, it would be simplest  to set up  
> > ofbiz's
> > own ajax.js.
> >
> > After that Ajax calls work perfectly with ofbiz's REST url's,  
> > screen widget
> > .
> > example of where ajax came in handy for us :
> >
> > - retreiving event or error messages from session attributes as  
> > asynchronous
> > services were launched.
> > - autocompletion
> > - databse updates
> >
> > my two cents
> > Regards
> > Tibor
> >
> >
> >
> >
> >
> > On 9/20/06, Leon Torres <le...@oss.minimetria.com> wrote:
> >>
> >> Prototype. This will be explained in the document. :)
> >>
> >> It might be a good exercise to attempt the same feature in other
> >> frameworks.
> >> I've already tried with Dojo and some others, of which the  
> >> impression are
> >> explained in the tutorial.
> >>
> >> - Leon
> >>
> >>
> >> Andrew Sykes wrote:
> >> > Leon,
> >> >
> >> > What technology have you settled on?
> >> >
> >> > - Andrew
> >> >
> >> > On Tue, 2006-09-19 at 08:18 -0700, Leon Torres wrote:
> >> >> Great Idea.  Our document is crmsfa based because we're  
> >> actually using
> >> it and
> >> >> have a live demo.  The css and javascript libraries are in place.
> >> However, it
> >> >> should be easy to create one for example/ that autocompletes  
> >> Person
> >> based on our
> >> >> implementation.
> >> >>
> >> >> I hope the dust settles in AJAX, but I bet there will be several
> >> different
> >> >> mainstream approaches, just like there are several different  
> >> scripting
> >> languages
> >> >> that fill the scripting niche.  We're going to have to settle  
> >> for one,
> >> just like
> >> >> we settled on freemarker and bsh.  :-)
> >> >>
> >> >> - Leon
> >> >>
> >> >>
> >> >>
> >> >> David E Jones wrote:
> >> >>> It would be great to have an example/poc or two in different  
> >> parts of
> >> >>> the project, or even in the example component, that people can  
> >> look at
> >> >>> and use as a basis for other parts of the project or  
> >> customizations or
> >> >>> whatever.
> >> >>>
> >> >>> Given the somewhat chaotic nature of the AJAX world, it might  
> >> be nice
> >> to
> >> >>> have multiple PoC bits in place to compare things for making a
> >> decision
> >> >>> for other parts.
> >> >>>
> >> >>> -David
> >> >>>
> >> >>>
> >> >>> On Sep 18, 2006, at 6:23 PM, Leon Torres wrote:
> >> >>>
> >> >>>> By the way, we'll be publishing a tutorial for using AJAX to  
> >> create
> >> an
> >> >>>> autocomplete text field sometime this week.
> >> >>>>
> >> >>>> - Leon Torres
> >> >>>> Open Source Strategies Inc.
> >> >>>>
> >> >>>>
> >> >>>> Amit Shinde wrote:
> >> >>>>> That worked! I can get userLogin now but LocalDispatcher with
> >> dispatcher
> >> >>>>> attribute is still null. That is not a big deal as I get the
> >> >>>>> LocalDispatcher
> >> >>>>> this way -
> >> >>>>> LocalDispatcher dispatcher =
> >> >>>>> GenericDispatcher.getLocalDispatcher("local",
> >> >>>>> delegator);
> >> >>>>> Thanks for all the help,
> >> >>>>> Amit Shinde
> >> >>>>> -----Original Message-----
> >> >>>>> From: tibor katelbach [mailto:oceatoon@gmail.com]
> >> >>>>> Sent: Monday, September 18, 2006 7:32 PM
> >> >>>>> To: ofbiz-user@incubator.apache.org
> >> >>>>> Subject: Re: AJAX and HttpSession
> >> >>>>> try
> >> >>>>> req.open("POST", "/erp/control/dyna", true);
> >> >>>>> the call has to start from the base.
> >> >>>>> here's mine
> >> >>>>> xhr_object.open("GET",
> >> "/PBBO/catalog/control/getimporterror?date="+new
> >> >>>>> Date().getTime(), true);
> >> >>>>> Tibor
> >> >>>>> On 9/18/06, Amit Shinde <am...@amicontech.com> wrote:
> >> >>>>>> Lon,
> >> >>>>>>         Heres the URL -
> >> >>>>>>
> >> >>>>>>
> >> >>>>>>
> >> >>>>>> Amit
> >> >>>>>>
> >> >>>>>>
> >> >>>>>> -----Original Message-----
> >> >>>>>> From: Lon Binder [mailto:lfb@alexanderinteractive.com]
> >> >>>>>> Sent: Monday, September 18, 2006 7:18 PM
> >> >>>>>> To: ofbiz-user@incubator.apache.org
> >> >>>>>> Subject: RE: AJAX and HttpSession
> >> >>>>>>
> >> >>>>>>
> >> >>>>>> Amit,
> >> >>>>>>
> >> >>>>>> What URL are you requesting?  The app server doesn't know the
> >> >>>>>> difference
> >> >>>>>> between plain browser requests and ajax requests.  It's just a
> >> >>>>>> matter of
> >> >>>>>> URL construction.
> >> >>>>>>
> >> >>>>>> - Lon
> >> >>>>>>
> >> >>>>>>
> >> >>>>>> -----Original Message-----
> >> >>>>>> From: Amit Shinde [mailto:amit@amicontech.com]
> >> >>>>>> Sent: Monday, September 18, 2006 9:41 AM
> >> >>>>>> To: ofbiz-user@incubator.apache.org
> >> >>>>>> Subject: AJAX and HttpSession
> >> >>>>>>
> >> >>>>>> Hello,
> >> >>>>>>         I was wondering if anyone has played with AJAX. I  
> >> want to
> >> >>>>>> call a
> >> >>>>>> OFBiz service by making an XMLHttpRequest. I have a  
> >> RequestHandler
> >> that
> >> >>>>>> is supposed to process this request. The problem I am  
> >> facing is of
> >> >>>>>> HttpSession.
> >> >>>>>> Even though I am logged in, I get userLogin, dispatcher and
> >> delegator
> >> >>>>>> attributes null. Is there a way where we can get our  
> >> HttpSession
> >> >>>>>> attributes from XMLHttpRequest. Do we need to do any  
> >> special thing
> >> >>>>>> or is
> >> >>>>>> this just a limitation?
> >> >>>>>>
> >> >>>>>>         Without a valid HttpSession, I obviously cant run the
> >> service
> >> >>>>>> unless I pass userLoginId in the XMLHttpRequest and get  
> >> UserLogin
> >> value
> >> >>>>>> through delegator.
> >> >>>>>> This approach will pose a security hazard nonetheless.
> >> >>>>>>
> >> >>>>>>         Any insight will be appreciated.
> >> >>>>>>
> >> >>>>>>
> >> >>>>>> Thanks in advance,
> >> >>>>>>
> >> >>>>>> Amit Shinde
> >> >>>>>>
> >> >>>>>>
> >> >>>>>>
> >> >>>>>>
> >> >>>>>>
> >> >>>>>>
> >> >>>>>>
> >> >>>
> >>
> 
-- 
Kind Regards
Andrew Sykes <an...@sykesdevelopment.com>
Sykes Development Ltd
http://www.sykesdevelopment.com


Re: AJAX and HttpSession

Posted by Si Chen <si...@opensourcestrategies.com>.
We thought it was good to integrate something called prototype.js  
which is pretty lightweight and saves us from writing the ajax stuff.

You can take a look at it yourself:
demo - http://demo.opentaps.org:8086/crmsfa/control/main - login as  
"DemoSalesManager/crmsfa" and go to "Opportunities"  The create  
opportunity box uses ajax to complete the account name
checkout the code svn co svn://svn.opentaps.org/crmsfa/versions/1.0/ 
trunk

Si


On Sep 20, 2006, at 11:48 AM, tibor katelbach wrote:

> Hi all
> I just read this post,
> having worked quite a bit with ajax ,
> it can get a bit chaotic if a choice has to be made amongst all  
> available
> scripts and ajax base codes.
> They have great features but the hard part can be making the choice (
> openrico.org or http://www.zkoss.org/ are also interesting )
>
> But ajax being so simple to set up, it would be simplest  to set up  
> ofbiz's
> own ajax.js.
>
> After that Ajax calls work perfectly with ofbiz's REST url's,  
> screen widget
> .
> example of where ajax came in handy for us :
>
> - retreiving event or error messages from session attributes as  
> asynchronous
> services were launched.
> - autocompletion
> - databse updates
>
> my two cents
> Regards
> Tibor
>
>
>
>
>
> On 9/20/06, Leon Torres <le...@oss.minimetria.com> wrote:
>>
>> Prototype. This will be explained in the document. :)
>>
>> It might be a good exercise to attempt the same feature in other
>> frameworks.
>> I've already tried with Dojo and some others, of which the  
>> impression are
>> explained in the tutorial.
>>
>> - Leon
>>
>>
>> Andrew Sykes wrote:
>> > Leon,
>> >
>> > What technology have you settled on?
>> >
>> > - Andrew
>> >
>> > On Tue, 2006-09-19 at 08:18 -0700, Leon Torres wrote:
>> >> Great Idea.  Our document is crmsfa based because we're  
>> actually using
>> it and
>> >> have a live demo.  The css and javascript libraries are in place.
>> However, it
>> >> should be easy to create one for example/ that autocompletes  
>> Person
>> based on our
>> >> implementation.
>> >>
>> >> I hope the dust settles in AJAX, but I bet there will be several
>> different
>> >> mainstream approaches, just like there are several different  
>> scripting
>> languages
>> >> that fill the scripting niche.  We're going to have to settle  
>> for one,
>> just like
>> >> we settled on freemarker and bsh.  :-)
>> >>
>> >> - Leon
>> >>
>> >>
>> >>
>> >> David E Jones wrote:
>> >>> It would be great to have an example/poc or two in different  
>> parts of
>> >>> the project, or even in the example component, that people can  
>> look at
>> >>> and use as a basis for other parts of the project or  
>> customizations or
>> >>> whatever.
>> >>>
>> >>> Given the somewhat chaotic nature of the AJAX world, it might  
>> be nice
>> to
>> >>> have multiple PoC bits in place to compare things for making a
>> decision
>> >>> for other parts.
>> >>>
>> >>> -David
>> >>>
>> >>>
>> >>> On Sep 18, 2006, at 6:23 PM, Leon Torres wrote:
>> >>>
>> >>>> By the way, we'll be publishing a tutorial for using AJAX to  
>> create
>> an
>> >>>> autocomplete text field sometime this week.
>> >>>>
>> >>>> - Leon Torres
>> >>>> Open Source Strategies Inc.
>> >>>>
>> >>>>
>> >>>> Amit Shinde wrote:
>> >>>>> That worked! I can get userLogin now but LocalDispatcher with
>> dispatcher
>> >>>>> attribute is still null. That is not a big deal as I get the
>> >>>>> LocalDispatcher
>> >>>>> this way -
>> >>>>> LocalDispatcher dispatcher =
>> >>>>> GenericDispatcher.getLocalDispatcher("local",
>> >>>>> delegator);
>> >>>>> Thanks for all the help,
>> >>>>> Amit Shinde
>> >>>>> -----Original Message-----
>> >>>>> From: tibor katelbach [mailto:oceatoon@gmail.com]
>> >>>>> Sent: Monday, September 18, 2006 7:32 PM
>> >>>>> To: ofbiz-user@incubator.apache.org
>> >>>>> Subject: Re: AJAX and HttpSession
>> >>>>> try
>> >>>>> req.open("POST", "/erp/control/dyna", true);
>> >>>>> the call has to start from the base.
>> >>>>> here's mine
>> >>>>> xhr_object.open("GET",
>> "/PBBO/catalog/control/getimporterror?date="+new
>> >>>>> Date().getTime(), true);
>> >>>>> Tibor
>> >>>>> On 9/18/06, Amit Shinde <am...@amicontech.com> wrote:
>> >>>>>> Lon,
>> >>>>>>         Heres the URL -
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>> Amit
>> >>>>>>
>> >>>>>>
>> >>>>>> -----Original Message-----
>> >>>>>> From: Lon Binder [mailto:lfb@alexanderinteractive.com]
>> >>>>>> Sent: Monday, September 18, 2006 7:18 PM
>> >>>>>> To: ofbiz-user@incubator.apache.org
>> >>>>>> Subject: RE: AJAX and HttpSession
>> >>>>>>
>> >>>>>>
>> >>>>>> Amit,
>> >>>>>>
>> >>>>>> What URL are you requesting?  The app server doesn't know the
>> >>>>>> difference
>> >>>>>> between plain browser requests and ajax requests.  It's just a
>> >>>>>> matter of
>> >>>>>> URL construction.
>> >>>>>>
>> >>>>>> - Lon
>> >>>>>>
>> >>>>>>
>> >>>>>> -----Original Message-----
>> >>>>>> From: Amit Shinde [mailto:amit@amicontech.com]
>> >>>>>> Sent: Monday, September 18, 2006 9:41 AM
>> >>>>>> To: ofbiz-user@incubator.apache.org
>> >>>>>> Subject: AJAX and HttpSession
>> >>>>>>
>> >>>>>> Hello,
>> >>>>>>         I was wondering if anyone has played with AJAX. I  
>> want to
>> >>>>>> call a
>> >>>>>> OFBiz service by making an XMLHttpRequest. I have a  
>> RequestHandler
>> that
>> >>>>>> is supposed to process this request. The problem I am  
>> facing is of
>> >>>>>> HttpSession.
>> >>>>>> Even though I am logged in, I get userLogin, dispatcher and
>> delegator
>> >>>>>> attributes null. Is there a way where we can get our  
>> HttpSession
>> >>>>>> attributes from XMLHttpRequest. Do we need to do any  
>> special thing
>> >>>>>> or is
>> >>>>>> this just a limitation?
>> >>>>>>
>> >>>>>>         Without a valid HttpSession, I obviously cant run the
>> service
>> >>>>>> unless I pass userLoginId in the XMLHttpRequest and get  
>> UserLogin
>> value
>> >>>>>> through delegator.
>> >>>>>> This approach will pose a security hazard nonetheless.
>> >>>>>>
>> >>>>>>         Any insight will be appreciated.
>> >>>>>>
>> >>>>>>
>> >>>>>> Thanks in advance,
>> >>>>>>
>> >>>>>> Amit Shinde
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>
>>


Re: AJAX and HttpSession

Posted by tibor katelbach <oc...@gmail.com>.
Hi all
I just read this post,
having worked quite a bit with ajax ,
it can get a bit chaotic if a choice has to be made amongst all available
scripts and ajax base codes.
They have great features but the hard part can be making the choice (
openrico.org or http://www.zkoss.org/ are also interesting )

But ajax being so simple to set up, it would be simplest  to set up ofbiz's
own ajax.js.

After that Ajax calls work perfectly with ofbiz's REST url's, screen widget
.
example of where ajax came in handy for us :

- retreiving event or error messages from session attributes as asynchronous
services were launched.
- autocompletion
- databse updates

my two cents
Regards
Tibor





On 9/20/06, Leon Torres <le...@oss.minimetria.com> wrote:
>
> Prototype. This will be explained in the document. :)
>
> It might be a good exercise to attempt the same feature in other
> frameworks.
> I've already tried with Dojo and some others, of which the impression are
> explained in the tutorial.
>
> - Leon
>
>
> Andrew Sykes wrote:
> > Leon,
> >
> > What technology have you settled on?
> >
> > - Andrew
> >
> > On Tue, 2006-09-19 at 08:18 -0700, Leon Torres wrote:
> >> Great Idea.  Our document is crmsfa based because we're actually using
> it and
> >> have a live demo.  The css and javascript libraries are in place.
> However, it
> >> should be easy to create one for example/ that autocompletes Person
> based on our
> >> implementation.
> >>
> >> I hope the dust settles in AJAX, but I bet there will be several
> different
> >> mainstream approaches, just like there are several different scripting
> languages
> >> that fill the scripting niche.  We're going to have to settle for one,
> just like
> >> we settled on freemarker and bsh.  :-)
> >>
> >> - Leon
> >>
> >>
> >>
> >> David E Jones wrote:
> >>> It would be great to have an example/poc or two in different parts of
> >>> the project, or even in the example component, that people can look at
> >>> and use as a basis for other parts of the project or customizations or
> >>> whatever.
> >>>
> >>> Given the somewhat chaotic nature of the AJAX world, it might be nice
> to
> >>> have multiple PoC bits in place to compare things for making a
> decision
> >>> for other parts.
> >>>
> >>> -David
> >>>
> >>>
> >>> On Sep 18, 2006, at 6:23 PM, Leon Torres wrote:
> >>>
> >>>> By the way, we'll be publishing a tutorial for using AJAX to create
> an
> >>>> autocomplete text field sometime this week.
> >>>>
> >>>> - Leon Torres
> >>>> Open Source Strategies Inc.
> >>>>
> >>>>
> >>>> Amit Shinde wrote:
> >>>>> That worked! I can get userLogin now but LocalDispatcher with
> dispatcher
> >>>>> attribute is still null. That is not a big deal as I get the
> >>>>> LocalDispatcher
> >>>>> this way -
> >>>>> LocalDispatcher dispatcher =
> >>>>> GenericDispatcher.getLocalDispatcher("local",
> >>>>> delegator);
> >>>>> Thanks for all the help,
> >>>>> Amit Shinde
> >>>>> -----Original Message-----
> >>>>> From: tibor katelbach [mailto:oceatoon@gmail.com]
> >>>>> Sent: Monday, September 18, 2006 7:32 PM
> >>>>> To: ofbiz-user@incubator.apache.org
> >>>>> Subject: Re: AJAX and HttpSession
> >>>>> try
> >>>>> req.open("POST", "/erp/control/dyna", true);
> >>>>> the call has to start from the base.
> >>>>> here's mine
> >>>>> xhr_object.open("GET",
> "/PBBO/catalog/control/getimporterror?date="+new
> >>>>> Date().getTime(), true);
> >>>>> Tibor
> >>>>> On 9/18/06, Amit Shinde <am...@amicontech.com> wrote:
> >>>>>> Lon,
> >>>>>>         Heres the URL -
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>> Amit
> >>>>>>
> >>>>>>
> >>>>>> -----Original Message-----
> >>>>>> From: Lon Binder [mailto:lfb@alexanderinteractive.com]
> >>>>>> Sent: Monday, September 18, 2006 7:18 PM
> >>>>>> To: ofbiz-user@incubator.apache.org
> >>>>>> Subject: RE: AJAX and HttpSession
> >>>>>>
> >>>>>>
> >>>>>> Amit,
> >>>>>>
> >>>>>> What URL are you requesting?  The app server doesn't know the
> >>>>>> difference
> >>>>>> between plain browser requests and ajax requests.  It's just a
> >>>>>> matter of
> >>>>>> URL construction.
> >>>>>>
> >>>>>> - Lon
> >>>>>>
> >>>>>>
> >>>>>> -----Original Message-----
> >>>>>> From: Amit Shinde [mailto:amit@amicontech.com]
> >>>>>> Sent: Monday, September 18, 2006 9:41 AM
> >>>>>> To: ofbiz-user@incubator.apache.org
> >>>>>> Subject: AJAX and HttpSession
> >>>>>>
> >>>>>> Hello,
> >>>>>>         I was wondering if anyone has played with AJAX. I want to
> >>>>>> call a
> >>>>>> OFBiz service by making an XMLHttpRequest. I have a RequestHandler
> that
> >>>>>> is supposed to process this request. The problem I am facing is of
> >>>>>> HttpSession.
> >>>>>> Even though I am logged in, I get userLogin, dispatcher and
> delegator
> >>>>>> attributes null. Is there a way where we can get our HttpSession
> >>>>>> attributes from XMLHttpRequest. Do we need to do any special thing
> >>>>>> or is
> >>>>>> this just a limitation?
> >>>>>>
> >>>>>>         Without a valid HttpSession, I obviously cant run the
> service
> >>>>>> unless I pass userLoginId in the XMLHttpRequest and get UserLogin
> value
> >>>>>> through delegator.
> >>>>>> This approach will pose a security hazard nonetheless.
> >>>>>>
> >>>>>>         Any insight will be appreciated.
> >>>>>>
> >>>>>>
> >>>>>> Thanks in advance,
> >>>>>>
> >>>>>> Amit Shinde
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>
>

Re: AJAX and HttpSession

Posted by Leon Torres <le...@oss.minimetria.com>.
Prototype. This will be explained in the document. :)

It might be a good exercise to attempt the same feature in other frameworks. 
I've already tried with Dojo and some others, of which the impression are 
explained in the tutorial.

- Leon


Andrew Sykes wrote:
> Leon,
> 
> What technology have you settled on?
> 
> - Andrew
> 
> On Tue, 2006-09-19 at 08:18 -0700, Leon Torres wrote:
>> Great Idea.  Our document is crmsfa based because we're actually using it and 
>> have a live demo.  The css and javascript libraries are in place. However, it 
>> should be easy to create one for example/ that autocompletes Person based on our 
>> implementation.
>>
>> I hope the dust settles in AJAX, but I bet there will be several different 
>> mainstream approaches, just like there are several different scripting languages 
>> that fill the scripting niche.  We're going to have to settle for one, just like 
>> we settled on freemarker and bsh.  :-)
>>
>> - Leon
>>
>>
>>
>> David E Jones wrote:
>>> It would be great to have an example/poc or two in different parts of 
>>> the project, or even in the example component, that people can look at 
>>> and use as a basis for other parts of the project or customizations or 
>>> whatever.
>>>
>>> Given the somewhat chaotic nature of the AJAX world, it might be nice to 
>>> have multiple PoC bits in place to compare things for making a decision 
>>> for other parts.
>>>
>>> -David
>>>
>>>
>>> On Sep 18, 2006, at 6:23 PM, Leon Torres wrote:
>>>
>>>> By the way, we'll be publishing a tutorial for using AJAX to create an 
>>>> autocomplete text field sometime this week.
>>>>
>>>> - Leon Torres
>>>> Open Source Strategies Inc.
>>>>
>>>>
>>>> Amit Shinde wrote:
>>>>> That worked! I can get userLogin now but LocalDispatcher with dispatcher
>>>>> attribute is still null. That is not a big deal as I get the 
>>>>> LocalDispatcher
>>>>> this way -
>>>>> LocalDispatcher dispatcher = 
>>>>> GenericDispatcher.getLocalDispatcher("local",
>>>>> delegator);
>>>>> Thanks for all the help,
>>>>> Amit Shinde
>>>>> -----Original Message-----
>>>>> From: tibor katelbach [mailto:oceatoon@gmail.com]
>>>>> Sent: Monday, September 18, 2006 7:32 PM
>>>>> To: ofbiz-user@incubator.apache.org
>>>>> Subject: Re: AJAX and HttpSession
>>>>> try
>>>>> req.open("POST", "/erp/control/dyna", true);
>>>>> the call has to start from the base.
>>>>> here's mine
>>>>> xhr_object.open("GET", "/PBBO/catalog/control/getimporterror?date="+new
>>>>> Date().getTime(), true);
>>>>> Tibor
>>>>> On 9/18/06, Amit Shinde <am...@amicontech.com> wrote:
>>>>>> Lon,
>>>>>>         Heres the URL -
>>>>>>
>>>>>>
>>>>>>
>>>>>> Amit
>>>>>>
>>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Lon Binder [mailto:lfb@alexanderinteractive.com]
>>>>>> Sent: Monday, September 18, 2006 7:18 PM
>>>>>> To: ofbiz-user@incubator.apache.org
>>>>>> Subject: RE: AJAX and HttpSession
>>>>>>
>>>>>>
>>>>>> Amit,
>>>>>>
>>>>>> What URL are you requesting?  The app server doesn't know the 
>>>>>> difference
>>>>>> between plain browser requests and ajax requests.  It's just a 
>>>>>> matter of
>>>>>> URL construction.
>>>>>>
>>>>>> - Lon
>>>>>>
>>>>>>
>>>>>> -----Original Message-----
>>>>>> From: Amit Shinde [mailto:amit@amicontech.com]
>>>>>> Sent: Monday, September 18, 2006 9:41 AM
>>>>>> To: ofbiz-user@incubator.apache.org
>>>>>> Subject: AJAX and HttpSession
>>>>>>
>>>>>> Hello,
>>>>>>         I was wondering if anyone has played with AJAX. I want to 
>>>>>> call a
>>>>>> OFBiz service by making an XMLHttpRequest. I have a RequestHandler that
>>>>>> is supposed to process this request. The problem I am facing is of
>>>>>> HttpSession.
>>>>>> Even though I am logged in, I get userLogin, dispatcher and delegator
>>>>>> attributes null. Is there a way where we can get our HttpSession
>>>>>> attributes from XMLHttpRequest. Do we need to do any special thing 
>>>>>> or is
>>>>>> this just a limitation?
>>>>>>
>>>>>>         Without a valid HttpSession, I obviously cant run the service
>>>>>> unless I pass userLoginId in the XMLHttpRequest and get UserLogin value
>>>>>> through delegator.
>>>>>> This approach will pose a security hazard nonetheless.
>>>>>>
>>>>>>         Any insight will be appreciated.
>>>>>>
>>>>>>
>>>>>> Thanks in advance,
>>>>>>
>>>>>> Amit Shinde
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>

RE: AJAX and HttpSession

Posted by Sayoke Shome <sa...@techmahindra.com>.
There are two steady frameworks in Ajax,
	1. DWR (Direct web remoting)
	2. Dojo framework.
But I believe a naked Ajax application will be better suitable for Ofbiz
framework.

Cheers,
Sayoke Shome |  Technical Associate | Techmahindra Ltd. |  BIPL, sector V
,saltlake | Kolkata | mobile : 9831105664 

-----Original Message-----
From: Andrew Sykes [mailto:andrew@sykesdevelopment.com] 
Sent: Tuesday, September 19, 2006 10:19 PM
To: ofbiz-user@incubator.apache.org
Subject: Re: AJAX and HttpSession

Leon,

What technology have you settled on?

- Andrew

On Tue, 2006-09-19 at 08:18 -0700, Leon Torres wrote:
> Great Idea.  Our document is crmsfa based because we're actually using it
and 
> have a live demo.  The css and javascript libraries are in place. However,
it 
> should be easy to create one for example/ that autocompletes Person based
on our 
> implementation.
> 
> I hope the dust settles in AJAX, but I bet there will be several different

> mainstream approaches, just like there are several different scripting
languages 
> that fill the scripting niche.  We're going to have to settle for one,
just like 
> we settled on freemarker and bsh.  :-)
> 
> - Leon
> 
> 
> 
> David E Jones wrote:
> > 
> > It would be great to have an example/poc or two in different parts of 
> > the project, or even in the example component, that people can look at 
> > and use as a basis for other parts of the project or customizations or 
> > whatever.
> > 
> > Given the somewhat chaotic nature of the AJAX world, it might be nice to

> > have multiple PoC bits in place to compare things for making a decision 
> > for other parts.
> > 
> > -David
> > 
> > 
> > On Sep 18, 2006, at 6:23 PM, Leon Torres wrote:
> > 
> >> By the way, we'll be publishing a tutorial for using AJAX to create an 
> >> autocomplete text field sometime this week.
> >>
> >> - Leon Torres
> >> Open Source Strategies Inc.
> >>
> >>
> >> Amit Shinde wrote:
> >>> That worked! I can get userLogin now but LocalDispatcher with
dispatcher
> >>> attribute is still null. That is not a big deal as I get the 
> >>> LocalDispatcher
> >>> this way -
> >>> LocalDispatcher dispatcher = 
> >>> GenericDispatcher.getLocalDispatcher("local",
> >>> delegator);
> >>> Thanks for all the help,
> >>> Amit Shinde
> >>> -----Original Message-----
> >>> From: tibor katelbach [mailto:oceatoon@gmail.com]
> >>> Sent: Monday, September 18, 2006 7:32 PM
> >>> To: ofbiz-user@incubator.apache.org
> >>> Subject: Re: AJAX and HttpSession
> >>> try
> >>> req.open("POST", "/erp/control/dyna", true);
> >>> the call has to start from the base.
> >>> here's mine
> >>> xhr_object.open("GET",
"/PBBO/catalog/control/getimporterror?date="+new
> >>> Date().getTime(), true);
> >>> Tibor
> >>> On 9/18/06, Amit Shinde <am...@amicontech.com> wrote:
> >>>> Lon,
> >>>>         Heres the URL -
> >>>>
> >>>>
> >>>>
> >>>> Amit
> >>>>
> >>>>
> >>>> -----Original Message-----
> >>>> From: Lon Binder [mailto:lfb@alexanderinteractive.com]
> >>>> Sent: Monday, September 18, 2006 7:18 PM
> >>>> To: ofbiz-user@incubator.apache.org
> >>>> Subject: RE: AJAX and HttpSession
> >>>>
> >>>>
> >>>> Amit,
> >>>>
> >>>> What URL are you requesting?  The app server doesn't know the 
> >>>> difference
> >>>> between plain browser requests and ajax requests.  It's just a 
> >>>> matter of
> >>>> URL construction.
> >>>>
> >>>> - Lon
> >>>>
> >>>>
> >>>> -----Original Message-----
> >>>> From: Amit Shinde [mailto:amit@amicontech.com]
> >>>> Sent: Monday, September 18, 2006 9:41 AM
> >>>> To: ofbiz-user@incubator.apache.org
> >>>> Subject: AJAX and HttpSession
> >>>>
> >>>> Hello,
> >>>>         I was wondering if anyone has played with AJAX. I want to 
> >>>> call a
> >>>> OFBiz service by making an XMLHttpRequest. I have a RequestHandler
that
> >>>> is supposed to process this request. The problem I am facing is of
> >>>> HttpSession.
> >>>> Even though I am logged in, I get userLogin, dispatcher and delegator
> >>>> attributes null. Is there a way where we can get our HttpSession
> >>>> attributes from XMLHttpRequest. Do we need to do any special thing 
> >>>> or is
> >>>> this just a limitation?
> >>>>
> >>>>         Without a valid HttpSession, I obviously cant run the service
> >>>> unless I pass userLoginId in the XMLHttpRequest and get UserLogin
value
> >>>> through delegator.
> >>>> This approach will pose a security hazard nonetheless.
> >>>>
> >>>>         Any insight will be appreciated.
> >>>>
> >>>>
> >>>> Thanks in advance,
> >>>>
> >>>> Amit Shinde
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> > 
> > 
-- 
Kind Regards
Andrew Sykes <an...@sykesdevelopment.com>
Sykes Development Ltd
http://www.sykesdevelopment.com


============================================================================================================================

Tech Mahindra, formerly Mahindra-British Telecom.
 
Disclaimer:

This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review at <a href="http://www.techmahindra.com/Disclaimer.html">http://www.techmahindra.com/Disclaimer.html</a> externally and <a href="http://tim.techmahindra.com/Disclaimer.html">http://tim.techmahindra.com/Disclaimer.html</a> internally within Tech Mahindra.

============================================================================================================================

Re: AJAX and HttpSession

Posted by Andrew Sykes <an...@sykesdevelopment.com>.
Leon,

What technology have you settled on?

- Andrew

On Tue, 2006-09-19 at 08:18 -0700, Leon Torres wrote:
> Great Idea.  Our document is crmsfa based because we're actually using it and 
> have a live demo.  The css and javascript libraries are in place. However, it 
> should be easy to create one for example/ that autocompletes Person based on our 
> implementation.
> 
> I hope the dust settles in AJAX, but I bet there will be several different 
> mainstream approaches, just like there are several different scripting languages 
> that fill the scripting niche.  We're going to have to settle for one, just like 
> we settled on freemarker and bsh.  :-)
> 
> - Leon
> 
> 
> 
> David E Jones wrote:
> > 
> > It would be great to have an example/poc or two in different parts of 
> > the project, or even in the example component, that people can look at 
> > and use as a basis for other parts of the project or customizations or 
> > whatever.
> > 
> > Given the somewhat chaotic nature of the AJAX world, it might be nice to 
> > have multiple PoC bits in place to compare things for making a decision 
> > for other parts.
> > 
> > -David
> > 
> > 
> > On Sep 18, 2006, at 6:23 PM, Leon Torres wrote:
> > 
> >> By the way, we'll be publishing a tutorial for using AJAX to create an 
> >> autocomplete text field sometime this week.
> >>
> >> - Leon Torres
> >> Open Source Strategies Inc.
> >>
> >>
> >> Amit Shinde wrote:
> >>> That worked! I can get userLogin now but LocalDispatcher with dispatcher
> >>> attribute is still null. That is not a big deal as I get the 
> >>> LocalDispatcher
> >>> this way -
> >>> LocalDispatcher dispatcher = 
> >>> GenericDispatcher.getLocalDispatcher("local",
> >>> delegator);
> >>> Thanks for all the help,
> >>> Amit Shinde
> >>> -----Original Message-----
> >>> From: tibor katelbach [mailto:oceatoon@gmail.com]
> >>> Sent: Monday, September 18, 2006 7:32 PM
> >>> To: ofbiz-user@incubator.apache.org
> >>> Subject: Re: AJAX and HttpSession
> >>> try
> >>> req.open("POST", "/erp/control/dyna", true);
> >>> the call has to start from the base.
> >>> here's mine
> >>> xhr_object.open("GET", "/PBBO/catalog/control/getimporterror?date="+new
> >>> Date().getTime(), true);
> >>> Tibor
> >>> On 9/18/06, Amit Shinde <am...@amicontech.com> wrote:
> >>>> Lon,
> >>>>         Heres the URL -
> >>>>
> >>>>
> >>>>
> >>>> Amit
> >>>>
> >>>>
> >>>> -----Original Message-----
> >>>> From: Lon Binder [mailto:lfb@alexanderinteractive.com]
> >>>> Sent: Monday, September 18, 2006 7:18 PM
> >>>> To: ofbiz-user@incubator.apache.org
> >>>> Subject: RE: AJAX and HttpSession
> >>>>
> >>>>
> >>>> Amit,
> >>>>
> >>>> What URL are you requesting?  The app server doesn't know the 
> >>>> difference
> >>>> between plain browser requests and ajax requests.  It's just a 
> >>>> matter of
> >>>> URL construction.
> >>>>
> >>>> - Lon
> >>>>
> >>>>
> >>>> -----Original Message-----
> >>>> From: Amit Shinde [mailto:amit@amicontech.com]
> >>>> Sent: Monday, September 18, 2006 9:41 AM
> >>>> To: ofbiz-user@incubator.apache.org
> >>>> Subject: AJAX and HttpSession
> >>>>
> >>>> Hello,
> >>>>         I was wondering if anyone has played with AJAX. I want to 
> >>>> call a
> >>>> OFBiz service by making an XMLHttpRequest. I have a RequestHandler that
> >>>> is supposed to process this request. The problem I am facing is of
> >>>> HttpSession.
> >>>> Even though I am logged in, I get userLogin, dispatcher and delegator
> >>>> attributes null. Is there a way where we can get our HttpSession
> >>>> attributes from XMLHttpRequest. Do we need to do any special thing 
> >>>> or is
> >>>> this just a limitation?
> >>>>
> >>>>         Without a valid HttpSession, I obviously cant run the service
> >>>> unless I pass userLoginId in the XMLHttpRequest and get UserLogin value
> >>>> through delegator.
> >>>> This approach will pose a security hazard nonetheless.
> >>>>
> >>>>         Any insight will be appreciated.
> >>>>
> >>>>
> >>>> Thanks in advance,
> >>>>
> >>>> Amit Shinde
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> > 
> > 
-- 
Kind Regards
Andrew Sykes <an...@sykesdevelopment.com>
Sykes Development Ltd
http://www.sykesdevelopment.com


Re: AJAX and HttpSession

Posted by Leon Torres <le...@oss.minimetria.com>.
Great Idea.  Our document is crmsfa based because we're actually using it and 
have a live demo.  The css and javascript libraries are in place. However, it 
should be easy to create one for example/ that autocompletes Person based on our 
implementation.

I hope the dust settles in AJAX, but I bet there will be several different 
mainstream approaches, just like there are several different scripting languages 
that fill the scripting niche.  We're going to have to settle for one, just like 
we settled on freemarker and bsh.  :-)

- Leon



David E Jones wrote:
> 
> It would be great to have an example/poc or two in different parts of 
> the project, or even in the example component, that people can look at 
> and use as a basis for other parts of the project or customizations or 
> whatever.
> 
> Given the somewhat chaotic nature of the AJAX world, it might be nice to 
> have multiple PoC bits in place to compare things for making a decision 
> for other parts.
> 
> -David
> 
> 
> On Sep 18, 2006, at 6:23 PM, Leon Torres wrote:
> 
>> By the way, we'll be publishing a tutorial for using AJAX to create an 
>> autocomplete text field sometime this week.
>>
>> - Leon Torres
>> Open Source Strategies Inc.
>>
>>
>> Amit Shinde wrote:
>>> That worked! I can get userLogin now but LocalDispatcher with dispatcher
>>> attribute is still null. That is not a big deal as I get the 
>>> LocalDispatcher
>>> this way -
>>> LocalDispatcher dispatcher = 
>>> GenericDispatcher.getLocalDispatcher("local",
>>> delegator);
>>> Thanks for all the help,
>>> Amit Shinde
>>> -----Original Message-----
>>> From: tibor katelbach [mailto:oceatoon@gmail.com]
>>> Sent: Monday, September 18, 2006 7:32 PM
>>> To: ofbiz-user@incubator.apache.org
>>> Subject: Re: AJAX and HttpSession
>>> try
>>> req.open("POST", "/erp/control/dyna", true);
>>> the call has to start from the base.
>>> here's mine
>>> xhr_object.open("GET", "/PBBO/catalog/control/getimporterror?date="+new
>>> Date().getTime(), true);
>>> Tibor
>>> On 9/18/06, Amit Shinde <am...@amicontech.com> wrote:
>>>> Lon,
>>>>         Heres the URL -
>>>>
>>>>
>>>>
>>>> Amit
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: Lon Binder [mailto:lfb@alexanderinteractive.com]
>>>> Sent: Monday, September 18, 2006 7:18 PM
>>>> To: ofbiz-user@incubator.apache.org
>>>> Subject: RE: AJAX and HttpSession
>>>>
>>>>
>>>> Amit,
>>>>
>>>> What URL are you requesting?  The app server doesn't know the 
>>>> difference
>>>> between plain browser requests and ajax requests.  It's just a 
>>>> matter of
>>>> URL construction.
>>>>
>>>> - Lon
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: Amit Shinde [mailto:amit@amicontech.com]
>>>> Sent: Monday, September 18, 2006 9:41 AM
>>>> To: ofbiz-user@incubator.apache.org
>>>> Subject: AJAX and HttpSession
>>>>
>>>> Hello,
>>>>         I was wondering if anyone has played with AJAX. I want to 
>>>> call a
>>>> OFBiz service by making an XMLHttpRequest. I have a RequestHandler that
>>>> is supposed to process this request. The problem I am facing is of
>>>> HttpSession.
>>>> Even though I am logged in, I get userLogin, dispatcher and delegator
>>>> attributes null. Is there a way where we can get our HttpSession
>>>> attributes from XMLHttpRequest. Do we need to do any special thing 
>>>> or is
>>>> this just a limitation?
>>>>
>>>>         Without a valid HttpSession, I obviously cant run the service
>>>> unless I pass userLoginId in the XMLHttpRequest and get UserLogin value
>>>> through delegator.
>>>> This approach will pose a security hazard nonetheless.
>>>>
>>>>         Any insight will be appreciated.
>>>>
>>>>
>>>> Thanks in advance,
>>>>
>>>> Amit Shinde
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
> 
> 

RE: AJAX and HttpSession

Posted by Sayoke Shome <sa...@techmahindra.com>.
I think that would be great. 

In my project I had to use Ajax pattern and I faced similar problem in
accessing Http Session. Ajax request was simply creating new session. As you
can understand in shopping cart application session is the most crucial
thing.
What I did to access session is got the session token from "Document.Url"
and used the session to call the server so that it taps on the existing
session. It worked but this is called "URLRewritting" which is highly unsafe
method.
My code is :

function sendDataToServer(parameters){
	var url =
"<@o...@ofbizUrl>;JSESSIONID_ofbiz="+getCookie("JSESSI
ONID_ofbiz");
	request.onreadystatechange =  updateOrderSoFar; //updatePage; 
	takeRequest = true;
	try{
	request.open("POST",url,true);
	request.setRequestHeader("Content-type",
"application/x-www-form-urlencoded");
    request.setRequestHeader("Content-length", parameters.length);
    request.setRequestHeader("Connection", "close");
	request.send(parameters);
		}catch(PostNotAllowed) {
//some old versions of Safari browser does not Support POST
		try{
		var uri_get = url+"?" + parameters;
		request.open("GET",uri_get,true);
		request.setRequestHeader("Content-type",
"application/x-www-form-urlencoded");
   		request.setRequestHeader("Content-length",
parameters.length);
    	request.setRequestHeader("Connection", "close");
		request.send(null);
		//alert("Request send to server using Post and url
:"+uri_get);
		}catch(failed){
			alert("Sorry! your browser is not allowing me to
send any request to server.");
		}
	}
}

If you can give me any better Ideas It will be highly helpful.

Sayoke Shome |  Technical Associate | Techmahindra Ltd. |  BIPL, sector V
,saltlake | mobile : 9831105664 

-----Original Message-----
From: David E Jones [mailto:jonesde@undersunconsulting.com] 
Sent: Tuesday, September 19, 2006 6:30 AM
To: ofbiz-user@incubator.apache.org
Subject: Re: AJAX and HttpSession


It would be great to have an example/poc or two in different parts of  
the project, or even in the example component, that people can look  
at and use as a basis for other parts of the project or  
customizations or whatever.

Given the somewhat chaotic nature of the AJAX world, it might be nice  
to have multiple PoC bits in place to compare things for making a  
decision for other parts.

-David


On Sep 18, 2006, at 6:23 PM, Leon Torres wrote:

> By the way, we'll be publishing a tutorial for using AJAX to create  
> an autocomplete text field sometime this week.
>
> - Leon Torres
> Open Source Strategies Inc.
>
>
> Amit Shinde wrote:
>> That worked! I can get userLogin now but LocalDispatcher with  
>> dispatcher
>> attribute is still null. That is not a big deal as I get the  
>> LocalDispatcher
>> this way -
>> LocalDispatcher dispatcher = GenericDispatcher.getLocalDispatcher 
>> ("local",
>> delegator);
>> Thanks for all the help,
>> Amit Shinde
>> -----Original Message-----
>> From: tibor katelbach [mailto:oceatoon@gmail.com]
>> Sent: Monday, September 18, 2006 7:32 PM
>> To: ofbiz-user@incubator.apache.org
>> Subject: Re: AJAX and HttpSession
>> try
>> req.open("POST", "/erp/control/dyna", true);
>> the call has to start from the base.
>> here's mine
>> xhr_object.open("GET", "/PBBO/catalog/control/getimporterror? 
>> date="+new
>> Date().getTime(), true);
>> Tibor
>> On 9/18/06, Amit Shinde <am...@amicontech.com> wrote:
>>> Lon,
>>>         Heres the URL -
>>>
>>>
>>>
>>> Amit
>>>
>>>
>>> -----Original Message-----
>>> From: Lon Binder [mailto:lfb@alexanderinteractive.com]
>>> Sent: Monday, September 18, 2006 7:18 PM
>>> To: ofbiz-user@incubator.apache.org
>>> Subject: RE: AJAX and HttpSession
>>>
>>>
>>> Amit,
>>>
>>> What URL are you requesting?  The app server doesn't know the  
>>> difference
>>> between plain browser requests and ajax requests.  It's just a  
>>> matter of
>>> URL construction.
>>>
>>> - Lon
>>>
>>>
>>> -----Original Message-----
>>> From: Amit Shinde [mailto:amit@amicontech.com]
>>> Sent: Monday, September 18, 2006 9:41 AM
>>> To: ofbiz-user@incubator.apache.org
>>> Subject: AJAX and HttpSession
>>>
>>> Hello,
>>>         I was wondering if anyone has played with AJAX. I want to  
>>> call a
>>> OFBiz service by making an XMLHttpRequest. I have a  
>>> RequestHandler that
>>> is supposed to process this request. The problem I am facing is of
>>> HttpSession.
>>> Even though I am logged in, I get userLogin, dispatcher and  
>>> delegator
>>> attributes null. Is there a way where we can get our HttpSession
>>> attributes from XMLHttpRequest. Do we need to do any special  
>>> thing or is
>>> this just a limitation?
>>>
>>>         Without a valid HttpSession, I obviously cant run the  
>>> service
>>> unless I pass userLoginId in the XMLHttpRequest and get UserLogin  
>>> value
>>> through delegator.
>>> This approach will pose a security hazard nonetheless.
>>>
>>>         Any insight will be appreciated.
>>>
>>>
>>> Thanks in advance,
>>>
>>> Amit Shinde
>>>
>>>
>>>
>>>
>>>
>>>
>>>


============================================================================================================================

Tech Mahindra, formerly Mahindra-British Telecom.
 
Disclaimer:

This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review at <a href="http://www.techmahindra.com/Disclaimer.html">http://www.techmahindra.com/Disclaimer.html</a> externally and <a href="http://tim.techmahindra.com/Disclaimer.html">http://tim.techmahindra.com/Disclaimer.html</a> internally within Tech Mahindra.

============================================================================================================================

Re: AJAX and HttpSession

Posted by David E Jones <jo...@undersunconsulting.com>.
It would be great to have an example/poc or two in different parts of  
the project, or even in the example component, that people can look  
at and use as a basis for other parts of the project or  
customizations or whatever.

Given the somewhat chaotic nature of the AJAX world, it might be nice  
to have multiple PoC bits in place to compare things for making a  
decision for other parts.

-David


On Sep 18, 2006, at 6:23 PM, Leon Torres wrote:

> By the way, we'll be publishing a tutorial for using AJAX to create  
> an autocomplete text field sometime this week.
>
> - Leon Torres
> Open Source Strategies Inc.
>
>
> Amit Shinde wrote:
>> That worked! I can get userLogin now but LocalDispatcher with  
>> dispatcher
>> attribute is still null. That is not a big deal as I get the  
>> LocalDispatcher
>> this way -
>> LocalDispatcher dispatcher = GenericDispatcher.getLocalDispatcher 
>> ("local",
>> delegator);
>> Thanks for all the help,
>> Amit Shinde
>> -----Original Message-----
>> From: tibor katelbach [mailto:oceatoon@gmail.com]
>> Sent: Monday, September 18, 2006 7:32 PM
>> To: ofbiz-user@incubator.apache.org
>> Subject: Re: AJAX and HttpSession
>> try
>> req.open("POST", "/erp/control/dyna", true);
>> the call has to start from the base.
>> here's mine
>> xhr_object.open("GET", "/PBBO/catalog/control/getimporterror? 
>> date="+new
>> Date().getTime(), true);
>> Tibor
>> On 9/18/06, Amit Shinde <am...@amicontech.com> wrote:
>>> Lon,
>>>         Heres the URL -
>>>
>>>
>>>
>>> Amit
>>>
>>>
>>> -----Original Message-----
>>> From: Lon Binder [mailto:lfb@alexanderinteractive.com]
>>> Sent: Monday, September 18, 2006 7:18 PM
>>> To: ofbiz-user@incubator.apache.org
>>> Subject: RE: AJAX and HttpSession
>>>
>>>
>>> Amit,
>>>
>>> What URL are you requesting?  The app server doesn't know the  
>>> difference
>>> between plain browser requests and ajax requests.  It's just a  
>>> matter of
>>> URL construction.
>>>
>>> - Lon
>>>
>>>
>>> -----Original Message-----
>>> From: Amit Shinde [mailto:amit@amicontech.com]
>>> Sent: Monday, September 18, 2006 9:41 AM
>>> To: ofbiz-user@incubator.apache.org
>>> Subject: AJAX and HttpSession
>>>
>>> Hello,
>>>         I was wondering if anyone has played with AJAX. I want to  
>>> call a
>>> OFBiz service by making an XMLHttpRequest. I have a  
>>> RequestHandler that
>>> is supposed to process this request. The problem I am facing is of
>>> HttpSession.
>>> Even though I am logged in, I get userLogin, dispatcher and  
>>> delegator
>>> attributes null. Is there a way where we can get our HttpSession
>>> attributes from XMLHttpRequest. Do we need to do any special  
>>> thing or is
>>> this just a limitation?
>>>
>>>         Without a valid HttpSession, I obviously cant run the  
>>> service
>>> unless I pass userLoginId in the XMLHttpRequest and get UserLogin  
>>> value
>>> through delegator.
>>> This approach will pose a security hazard nonetheless.
>>>
>>>         Any insight will be appreciated.
>>>
>>>
>>> Thanks in advance,
>>>
>>> Amit Shinde
>>>
>>>
>>>
>>>
>>>
>>>
>>>


Re: AJAX and HttpSession

Posted by Leon Torres <le...@oss.minimetria.com>.
By the way, we'll be publishing a tutorial for using AJAX to create an 
autocomplete text field sometime this week.

- Leon Torres
Open Source Strategies Inc.


Amit Shinde wrote:
> That worked! I can get userLogin now but LocalDispatcher with dispatcher
> attribute is still null. That is not a big deal as I get the LocalDispatcher
> this way -
> 
> LocalDispatcher dispatcher = GenericDispatcher.getLocalDispatcher("local",
> delegator);
> 
> 
> Thanks for all the help,
> 
> Amit Shinde
> 
> -----Original Message-----
> From: tibor katelbach [mailto:oceatoon@gmail.com]
> Sent: Monday, September 18, 2006 7:32 PM
> To: ofbiz-user@incubator.apache.org
> Subject: Re: AJAX and HttpSession
> 
> 
> try
> req.open("POST", "/erp/control/dyna", true);
> 
> the call has to start from the base.
> 
> here's mine
> xhr_object.open("GET", "/PBBO/catalog/control/getimporterror?date="+new
> Date().getTime(), true);
> 
> Tibor
> 
> On 9/18/06, Amit Shinde <am...@amicontech.com> wrote:
>> Lon,
>>         Heres the URL -
>>
>>
>>
>> Amit
>>
>>
>> -----Original Message-----
>> From: Lon Binder [mailto:lfb@alexanderinteractive.com]
>> Sent: Monday, September 18, 2006 7:18 PM
>> To: ofbiz-user@incubator.apache.org
>> Subject: RE: AJAX and HttpSession
>>
>>
>> Amit,
>>
>> What URL are you requesting?  The app server doesn't know the difference
>> between plain browser requests and ajax requests.  It's just a matter of
>> URL construction.
>>
>> - Lon
>>
>>
>> -----Original Message-----
>> From: Amit Shinde [mailto:amit@amicontech.com]
>> Sent: Monday, September 18, 2006 9:41 AM
>> To: ofbiz-user@incubator.apache.org
>> Subject: AJAX and HttpSession
>>
>> Hello,
>>         I was wondering if anyone has played with AJAX. I want to call a
>> OFBiz service by making an XMLHttpRequest. I have a RequestHandler that
>> is supposed to process this request. The problem I am facing is of
>> HttpSession.
>> Even though I am logged in, I get userLogin, dispatcher and delegator
>> attributes null. Is there a way where we can get our HttpSession
>> attributes from XMLHttpRequest. Do we need to do any special thing or is
>> this just a limitation?
>>
>>         Without a valid HttpSession, I obviously cant run the service
>> unless I pass userLoginId in the XMLHttpRequest and get UserLogin value
>> through delegator.
>> This approach will pose a security hazard nonetheless.
>>
>>         Any insight will be appreciated.
>>
>>
>> Thanks in advance,
>>
>> Amit Shinde
>>
>>
>>
>>
>>
>>
>>
> 
> 

RE: AJAX and HttpSession

Posted by Amit Shinde <am...@amicontech.com>.
That worked! I can get userLogin now but LocalDispatcher with dispatcher
attribute is still null. That is not a big deal as I get the LocalDispatcher
this way -

LocalDispatcher dispatcher = GenericDispatcher.getLocalDispatcher("local",
delegator);


Thanks for all the help,

Amit Shinde

-----Original Message-----
From: tibor katelbach [mailto:oceatoon@gmail.com]
Sent: Monday, September 18, 2006 7:32 PM
To: ofbiz-user@incubator.apache.org
Subject: Re: AJAX and HttpSession


try
req.open("POST", "/erp/control/dyna", true);

the call has to start from the base.

here's mine
xhr_object.open("GET", "/PBBO/catalog/control/getimporterror?date="+new
Date().getTime(), true);

Tibor

On 9/18/06, Amit Shinde <am...@amicontech.com> wrote:
>
> Lon,
>         Heres the URL -
>
>
>
> Amit
>
>
> -----Original Message-----
> From: Lon Binder [mailto:lfb@alexanderinteractive.com]
> Sent: Monday, September 18, 2006 7:18 PM
> To: ofbiz-user@incubator.apache.org
> Subject: RE: AJAX and HttpSession
>
>
> Amit,
>
> What URL are you requesting?  The app server doesn't know the difference
> between plain browser requests and ajax requests.  It's just a matter of
> URL construction.
>
> - Lon
>
>
> -----Original Message-----
> From: Amit Shinde [mailto:amit@amicontech.com]
> Sent: Monday, September 18, 2006 9:41 AM
> To: ofbiz-user@incubator.apache.org
> Subject: AJAX and HttpSession
>
> Hello,
>         I was wondering if anyone has played with AJAX. I want to call a
> OFBiz service by making an XMLHttpRequest. I have a RequestHandler that
> is supposed to process this request. The problem I am facing is of
> HttpSession.
> Even though I am logged in, I get userLogin, dispatcher and delegator
> attributes null. Is there a way where we can get our HttpSession
> attributes from XMLHttpRequest. Do we need to do any special thing or is
> this just a limitation?
>
>         Without a valid HttpSession, I obviously cant run the service
> unless I pass userLoginId in the XMLHttpRequest and get UserLogin value
> through delegator.
> This approach will pose a security hazard nonetheless.
>
>         Any insight will be appreciated.
>
>
> Thanks in advance,
>
> Amit Shinde
>
>
>
>
>
>
>


Re: AJAX and HttpSession

Posted by tibor katelbach <oc...@gmail.com>.
try
req.open("POST", "/erp/control/dyna", true);

the call has to start from the base.

here's mine
xhr_object.open("GET", "/PBBO/catalog/control/getimporterror?date="+new
Date().getTime(), true);

Tibor

On 9/18/06, Amit Shinde <am...@amicontech.com> wrote:
>
> Lon,
>         Heres the URL -
>
>
>
> Amit
>
>
> -----Original Message-----
> From: Lon Binder [mailto:lfb@alexanderinteractive.com]
> Sent: Monday, September 18, 2006 7:18 PM
> To: ofbiz-user@incubator.apache.org
> Subject: RE: AJAX and HttpSession
>
>
> Amit,
>
> What URL are you requesting?  The app server doesn't know the difference
> between plain browser requests and ajax requests.  It's just a matter of
> URL construction.
>
> - Lon
>
>
> -----Original Message-----
> From: Amit Shinde [mailto:amit@amicontech.com]
> Sent: Monday, September 18, 2006 9:41 AM
> To: ofbiz-user@incubator.apache.org
> Subject: AJAX and HttpSession
>
> Hello,
>         I was wondering if anyone has played with AJAX. I want to call a
> OFBiz service by making an XMLHttpRequest. I have a RequestHandler that
> is supposed to process this request. The problem I am facing is of
> HttpSession.
> Even though I am logged in, I get userLogin, dispatcher and delegator
> attributes null. Is there a way where we can get our HttpSession
> attributes from XMLHttpRequest. Do we need to do any special thing or is
> this just a limitation?
>
>         Without a valid HttpSession, I obviously cant run the service
> unless I pass userLoginId in the XMLHttpRequest and get UserLogin value
> through delegator.
> This approach will pose a security hazard nonetheless.
>
>         Any insight will be appreciated.
>
>
> Thanks in advance,
>
> Amit Shinde
>
>
>
>
>
>
>

RE: AJAX and HttpSession

Posted by Amit Shinde <am...@amicontech.com>.
Lon,
	Heres the URL - 

		req.open("POST", "http://localhost:8080/erp/control/dyna", true); 

Amit


-----Original Message-----
From: Lon Binder [mailto:lfb@alexanderinteractive.com]
Sent: Monday, September 18, 2006 7:18 PM
To: ofbiz-user@incubator.apache.org
Subject: RE: AJAX and HttpSession 


Amit,

What URL are you requesting?  The app server doesn't know the difference
between plain browser requests and ajax requests.  It's just a matter of
URL construction.

 - Lon
 

-----Original Message-----
From: Amit Shinde [mailto:amit@amicontech.com] 
Sent: Monday, September 18, 2006 9:41 AM
To: ofbiz-user@incubator.apache.org
Subject: AJAX and HttpSession 

Hello,
	I was wondering if anyone has played with AJAX. I want to call a
OFBiz service by making an XMLHttpRequest. I have a RequestHandler that
is supposed to process this request. The problem I am facing is of
HttpSession.
Even though I am logged in, I get userLogin, dispatcher and delegator
attributes null. Is there a way where we can get our HttpSession
attributes from XMLHttpRequest. Do we need to do any special thing or is
this just a limitation?

	Without a valid HttpSession, I obviously cant run the service
unless I pass userLoginId in the XMLHttpRequest and get UserLogin value
through delegator.
This approach will pose a security hazard nonetheless.

	Any insight will be appreciated.


Thanks in advance,

Amit Shinde







RE: AJAX and HttpSession

Posted by Lon Binder <lf...@alexanderinteractive.com>.
Amit,

What URL are you requesting?  The app server doesn't know the difference
between plain browser requests and ajax requests.  It's just a matter of
URL construction.

 - Lon
 

-----Original Message-----
From: Amit Shinde [mailto:amit@amicontech.com] 
Sent: Monday, September 18, 2006 9:41 AM
To: ofbiz-user@incubator.apache.org
Subject: AJAX and HttpSession 

Hello,
	I was wondering if anyone has played with AJAX. I want to call a
OFBiz service by making an XMLHttpRequest. I have a RequestHandler that
is supposed to process this request. The problem I am facing is of
HttpSession.
Even though I am logged in, I get userLogin, dispatcher and delegator
attributes null. Is there a way where we can get our HttpSession
attributes from XMLHttpRequest. Do we need to do any special thing or is
this just a limitation?

	Without a valid HttpSession, I obviously cant run the service
unless I pass userLoginId in the XMLHttpRequest and get UserLogin value
through delegator.
This approach will pose a security hazard nonetheless.

	Any insight will be appreciated.


Thanks in advance,

Amit Shinde







AJAX and HttpSession

Posted by Amit Shinde <am...@amicontech.com>.
Hello,
	I was wondering if anyone has played with AJAX. I want to call a OFBiz
service by making an XMLHttpRequest. I have a RequestHandler that is
supposed to process this request. The problem I am facing is of HttpSession.
Even though I am logged in, I get userLogin, dispatcher and delegator
attributes null. Is there a way where we can get our HttpSession attributes
from XMLHttpRequest. Do we need to do any special thing or is this just a
limitation?

	Without a valid HttpSession, I obviously cant run the service unless I pass
userLoginId in the XMLHttpRequest and get UserLogin value through delegator.
This approach will pose a security hazard nonetheless.

	Any insight will be appreciated.


Thanks in advance,

Amit Shinde