Again keep in mind that directly binding to corba components from JSP pages are
extremely expensive. It is better to have a pool of already established connections to
corba components and then just request a connection from the pool so that the
expensive bind is avoided.
Just FYI
>>> [EMAIL PROTECTED] 8/1/00 11:46 >>>
It can be done using different techniques , from JSP directly or through a bean
Here is some sample code that implements direct calling of corba components from
JSP
Replace all the variables marked ....._x with your appropriate names
Santosh
<%@page import="org.omg.CORBA.ORB"%>
<%@page import="org.omg.CosNaming.NamingContext"%>
<%@page import="org.omg.CosNaming.NamingContextHelper"%>
<%@page import="org.omg.CosNaming.NameComponent"%>
<%@page import="package_x.*"%>
<html>
<h1>Calling Corba Components from JSP</h1>
<body>
<%
java.util.Properties props = new java.util.Properties();
props.put("org.omg.CORBA.ORBClass","com.sybase.CORBA.ORB");
props.put("com.sybase.CORBA.NameServiceURL","iiop://server_x:port_x");
ORB orb = ORB.init((String[]) null, props);
String returnvalue_x = new String("");
component_x iJagComponent=null;
try {
NamingContext context = NamingContextHelper.narrow(
orb.resolve_initial_references("NameService"));
NameComponent[] name = { new NameComponent("package_x/component_x","") };
SessionManager.Factory factory =
SessionManager.FactoryHelper.narrow(context.resolve(name));
iJagComponent =
component_xHelper.narrow(factory.create("user_x","password_x"));
}//end of try block
catch (org.omg.CORBA.ORBPackage.InvalidName aException) { }
catch (org.omg.CosNaming.NamingContextPackage.NotFound aException) {
}
catch (org.omg.CosNaming.NamingContextPackage.CannotProceed aException) {
}
catch (org.omg.CosNaming.NamingContextPackage.InvalidName aException) {
}
try
{
returnvalue_x = iJagComponent.methodname_x();
out.print(returnvalue_x);
}
catch (Exception aException)
{
out.print(aException.getMessage());
}
%>
</body>
</html>
Karanjit Singh <[EMAIL PROTECTED]> on 08/01/2000 10:50:39 AM
Please respond to A mailing list about Java Server Pages specification and
reference <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
cc: (bcc: Santosh Daryani/IT/Aon Consulting)
Subject: Corba and JSP integration
Dear Members,
Iam goin to work on accessing database thru corba objects from my jsp
pages, if anyone has worked on this then pls put some light on this. I mean
to say where should i took connection, in some bean or in jsp page itself ?
Thx in advance,
Karan
________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets