What is @param ctx context

For those who ventured too far - just hope they know their way back :)

Moderator: neilg

What is @param ctx context

Postby sunilverma » Thu Nov 17, 2005 4:04 pm

Hi All

I found that ctx is a Propreties object which is passed in various methods including constructor of PO class which is responsible for creating persisting object.

Here is code from PO.java

public PO (Properties ctx)
{
this (ctx, 0, null, null);
} // PO

Can some one please help me in finding out where these Properties are set or coming from ?

Thanx in advance

Regards,
Sunil
sunilverma
 
Posts: 6
Joined: Mon Nov 14, 2005 6:33 pm
Location: Chandigarh

Postby new_soft » Thu Nov 17, 2005 7:44 pm

Hi Sunil,
the ctx variable is defined in WebSessionCtx:
private WebSessionCtx (HttpServletRequest request)
{
log.info (request.getContextPath() + " (" + request.getRemoteAddr()
+ " - " + request.getLocale() + ") #" + counter);
ctx = new Properties();
setLanguage(request);

HttpSession session = request.getSession(false);

// Add Servlet Init Parameters (webStore/src/web/WEB-INF/web.xml)
ServletContext sc = session.getServletContext();
Enumeration en = sc.getInitParameterNames();
while (en.hasMoreElements())
{
String key = (String)en.nextElement();
String value = sc.getInitParameter(key);
ctx.setProperty(key, value);
log.config (key + "=" + value);
}

setWStore (request.getContextPath());
ctx = getDefaults ();

// ServerContext - dev2/wstore
ctx.put(CTX_SERVER_CONTEXT, request.getServerName() + request.getContextPath());
// Make Context directly availabe to jsp's
session.setAttribute("ctx", ctx);
//
log.fine("#" + ctx.size());
} // WebSessionCtx


But There is another context variable wich are defined in Env.java : it's the variable where compiere save the context of one client.

Hope that help
Best Regards,

Khaled Najeh.
new_soft
 
Posts: 28
Joined: Tue Dec 21, 2004 9:29 pm
Location: TUNISIA

Postby sunilverma » Thu Nov 17, 2005 9:25 pm

Thanks Khaled

I was a great help

Regards
Sunil
sunilverma
 
Posts: 6
Joined: Mon Nov 14, 2005 6:33 pm
Location: Chandigarh

Postby sunilverma » Thu Nov 17, 2005 9:28 pm

Oops!

That was 'slip of fingure' I missed the 't'

Thanks again

Regards

Sunil
sunilverma
 
Posts: 6
Joined: Mon Nov 14, 2005 6:33 pm
Location: Chandigarh

Postby new_soft » Thu Nov 17, 2005 11:30 pm

Hi,
:lol:
But let us know if it's the right answer or not? If it solve your problem?
Best Regards,

Khaled Najeh.
new_soft
 
Posts: 28
Joined: Tue Dec 21, 2004 9:29 pm
Location: TUNISIA


Return to Strictly Technical

Who is online

Users browsing this forum: No registered users and 1 guest

cron