i am need to acess the context request. someone knows how to do this?
|
What is context request?
|
I want to access HttpServletRequest into service, but in a service i receive a DispatchContext dctx and Map context.
|
Request and Response objects are not available in services. To use
them you have to write a event in java / mini-lang. There are many examples in OOTB OFBiz. - Vikas On Sep 12, 2008, at 5:14 PM, jjmbconquista wrote: > > I want to access HttpServletRequest into service, but in a service i > receive a DispatchContext dctx and Map context. > > > Bilgin Ibryam wrote: >> >> What is context request? >> >> >> > > -- > View this message in context: http://www.nabble.com/how-to-acess-context-request--tp19441418p19454159.html > Sent from the OFBiz - User mailing list archive at Nabble.com. > |
In reply to this post by jjmbconquista
the HttpServletRequest is when you go through the controller from a webpage.
What info are you looking for? jjmbconquista sent the following on 9/12/2008 4:44 AM: > I want to access HttpServletRequest into service, but in a service i > receive a DispatchContext dctx and Map context. > > > Bilgin Ibryam wrote: >> What is context request? >> >> >> > |
I need to build a page *. ftl with information that are spread over several classes java. I have a look in ofbiz and files *. bsh is used to construct the context.
example: file.bsh orderId = request.getParameter("orderId"); if (orderId == null) orderId = parameters.get("orderId"); context.put("orderId", orderId); file.ftl <html> ${orderId}</html There is some class in ofbiz that store such information in a context to be displayed in the *.ftl file? <quote author="BJ Freeman"> the HttpServletRequest is when you go through the controller from a webpage. What info are you looking for? jjmbconquista sent the following on 9/12/2008 4:44 AM: > I want to access HttpServletRequest into service, but in a service i > receive a DispatchContext dctx and Map context. > > > Bilgin Ibryam wrote: >> What is context request? >> >> >> > |
If I get you right then populateContextForRequest method is of your
interest. - Vikas On Sep 12, 2008, at 6:02 PM, jjmbconquista wrote: > > I need to build a page *. ftl with information that are spread over > several > classes java. I have a look in ofbiz and files *. bsh is used to > construct > the context. > > example: > > file.bsh > > orderId = request.getParameter("orderId"); > if (orderId == null) orderId = parameters.get("orderId"); > context.put("orderId", orderId); > > file.ftl > > <html> > > <h1> ${orderId} </h1> > > </html > > There is some class in ofbiz that store such information in a > context to be > displayed in the *.ftl file? > > > BJ Freeman wrote: >> >> the HttpServletRequest is when you go through the controller from a >> webpage. >> What info are you looking for? >> >> jjmbconquista sent the following on 9/12/2008 4:44 AM: >>> I want to access HttpServletRequest into service, but in a >>> service i >>> receive a DispatchContext dctx and Map context. >>> >>> >>> Bilgin Ibryam wrote: >>>> What is context request? >>>> >>>> >>>> >>> >> >> >> > > -- > View this message in context: http://www.nabble.com/how-to-acess-context-request--tp19441418p19454870.html > Sent from the OFBiz - User mailing list archive at Nabble.com. > |
In reply to this post by jjmbconquista
as a side note bsh is for Version 4.0 and Trunk now uses groovy scripts.
if you look at them they have import, just like java. so you can pull in classes you need to process you data and put in a context. There are plenty of examples. any list, map, object name you create can be put in the context which is passed to the ftl's then in the ftls you call that list, map and/or object name and process it. jjmbconquista sent the following on 9/12/2008 5:32 AM: > I need to build a page *. ftl with information that are spread over several > classes java. I have a look in ofbiz and files *. bsh is used to construct > the context. > > example: > > file.bsh > > orderId = request.getParameter("orderId"); > if (orderId == null) orderId = parameters.get("orderId"); > context.put("orderId", orderId); > > file.ftl > > <html> > > <h1> ${orderId} </h1> > > </html > > There is some class in ofbiz that store such information in a context to be > displayed in the *.ftl file? > > > BJ Freeman wrote: >> the HttpServletRequest is when you go through the controller from a >> webpage. >> What info are you looking for? >> >> jjmbconquista sent the following on 9/12/2008 4:44 AM: >>> I want to access HttpServletRequest into service, but in a service i >>> receive a DispatchContext dctx and Map context. >>> >>> >>> Bilgin Ibryam wrote: >>>> What is context request? >>>> >>>> >>>> >> >> > |
Free forum by Nabble | Edit this page |