Hi all,I have a jsp file locate somewhere in websphere server. The use of this code is to retrieve data from Oracle db server by pass in id and return the result in string format.And now I have a template (tpl) in TeamSite server. Besides execute the jsp on run time (ie: when user browse the web page), I want to execute the jsp to get the information from Oracle when user press generate button in DCT.Any way to do???Thanks.TerenceP.S.: TeamSite 6.5 SP2 on Win Server 2003.TeamSite cms, Oracle and Websphere are installed into 3 servers.
$url = "Your WAS/JSP Url";my $ua = LWP::UserAgent->new();$ua->agent('MSIE Compatible');my $request = HTTP::Request->new( 'GET', $url );my $response = $ua->request( $request );if ($response->is_success) { # Process $response->content;}else { # Process Failure}
You can certainly code http request from your presentation template. For example:$url = "Your WAS/JSP Url";my $ua = LWP::UserAgent->new();$ua->agent('MSIE Compatible');my $request = HTTP::Request->new( 'GET', $url );my $response = $ua->request( $request );if ($response->is_success) { # Process $response->content;}else { # Process Failure}
The JSP operates when rendered - the PT operates when executed.The PT could certainly generate JSP code which when rendered will do what you want, otherwise you need different code (java or, my preference, perl) within the PT to connect to the DB for you.
May I ask, does this method is called HTTP Client???And does the TeamSite have HTTP Client installed already or I need to install by myself???Thx
ISCBorisB,Thank you very much, and I will try in this way.As I really don't have any idea to execute the jsp in PT during generation.There is another question I would like to ask.Suppose my JSP will return a string to me.Then, how can I get the return string ???Thx.Terence
Then, how can I get the return string ?