Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Call Servlet from Fex file

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Call Servlet from Fex file
 Login/Join
 
Member
posted
How would I call a custom servlet from a fex procedure?

This message has been edited. Last edited by: Kerry,


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 7 | Registered: December 29, 2011Report This Post
<JG>
posted
in it's very simplest form

 
-HTMLFORM BEGIN
<html>
  <head>
  </head>
   <body onLoad="window.location.href='http://www.ibi.com'">
   </body>
</html>
-HTMLFORM END
 


The href can be anything you want and can be a variable substituted at run time.
 
Report This Post
Member
posted Hide Post
This will work. However, I will need to store the
<host>
and
<port>  
properties of the URL in an environment specific properties file and call those properties in the HTMLFORM fex.

 <body onLoad="window.location.href='http://<host>:<port>/servlet'">
  


How would I do this?

This message has been edited. Last edited by: berkh1dj,


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 7 | Registered: December 29, 2011Report This Post
<FreSte>
posted
Create a file with the environment specific properties:
(this file could be database driven [iow. generated dynamically by a fex] )

-* --- hostinfo.fex
-SET &HOST = 'http://www.ibi.com';
-SET &PORT = ':80';


... and then call this in your HTML-form like this:

-INCLUDE hostinfo
-RUN
 
-HTMLFORM BEGIN
<html>
  <head>
  </head>
   <body onload="window.location.href='!IBI.AMP.HOST;!IBI.AMP.PORT;'">
   </body>
</html>
-HTMLFORM END
 
Report This Post
Member
posted Hide Post
That's what I needed. Thanks!


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 7 | Registered: December 29, 2011Report This Post
Member
posted Hide Post
How would I pass parameters from the fex file to the servlet using the method described above?

This does not seem to work:
 

-SET &HOST = 'http://www.ibi.com';
-SET &PORT = ':80';
-SET &PARAM1 = 'x';
-SET &PARAM2 = 'y';

<body onLoad="window.location.href='!IBI.AMP.HOST;!IBI.AMP.PORT;/servlet?param1=!IBI.AMP.PARAM1;¶m2=!IBI.AMP.PARAM2;'">



Please let me know what I am doing wrong.

Thanks!


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 7 | Registered: December 29, 2011Report This Post
<FreSte>
posted
Hi,

I think my previous answer put you on the wrong track; there was a little error in it.

The line
... and then call this in your HTML-form like this:


should be

... and then call this in your FEX like this:



So, you example should look like this (assuming it's all in 1 FEX):

-SET &HOST = 'http://www.ibi.com';
-SET &PORT = ':80';
-SET &PARAM1 = 'x';
-SET &PARAM2 = 'y';

-HTMLFORM BEGIN
<html>
<body onLoad="window.location.href='!IBI.AMP.HOST;!IBI.AMP.PORT;/servlet?param1=!IBI.AMP.PARAM1&|param2=!IBI.AMP.PARAM2;'">
...
</body>
</html>
-HTMLFORM END


Note the &|param2 in the <body ... line. If you would not use the pipe-sign ( =| ), WebFOCUS 'thinks' that &param2 is a defined variable within
this FEX which isn't.

Hope this helps,

-Fred-

This message has been edited. Last edited by: <FreSte>,
 
Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Call Servlet from Fex file

Copyright © 1996-2020 Information Builders