Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Getting CSClient object
Mohamed
Hello,
The example programs inside customer_samples_src folder
(i.e com.corp.custom.CurrentUserServlet.java) has the following code snippet to get the CSClient object.
// get the cs client
CSClient client = (CSClient)request.getAttribute( "iw.csclient");
But I am always getting null in my CGI task. I am not sure why ?
Also there are several ways to get the CSClient object ? When can I use a particular approach among many ? In other words, I can get the CSClient object using the request.getAttribute (ofcourse it is not working for me ), I can get the CSClient object using the CSFactory class, I can get the CSClient object using CSFactory and the session parameter passed in the Servlet Request object... etc.
So basically I have two questions.
1) Why I am getting null when I try to construct the CSClient object using the requet.getAttribute("iw.csclient") ?
2) Which approach is better to construct the CSClient object considering many ways to construct the CSClient object.
Thanks & Regards,
Mohamed
Find more posts tagged with
Comments
vpatel
If this
CSClient client = (CSClient) request.getAttribute("iw.csclient");
is consistently NOT working for you then perhaps there is something wrong with your TS/CSSDK instance. Did you install everything properly without any error? This has always worked for me.
Alternatively, you can use CSLocalFactory to get a client. You can probably get it based on the session Id or a specific username (i.e. trusted client).