I tried this and it works with EJBs deployed in
Sybase Enterprise Application Server using
JSWDK as JSP Engine

For some reason even I import java.naming.*
it wont let me use java.naming.Context in the code.
Ive to explicitly import java.naming.Context

---- Code -------

<%@ page import =
"java.lang.Object,org.omg.CORBA.*,javax.naming.*,javax.naming.Context,Cart.*"
%>

------ rest of code ------

<%
java.util.Properties props = new java.util.Properties();
props.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY,
"com.sybase.ejb.InitialContextFactory");
props.put(javax.naming.Context.PROVIDER_URL,
"iiop://myhost:9000");
                props.put(javax.naming.Context.SECURITY_PRINCIPAL,
     "jagadmin");
props.put(javax.naming.Context.SECURITY_CREDENTIALS, "");

Context ctx = new InitialContext(props);

CartHome home =
        (CartHome)PortableRemoteObject.narrow
        (ctx.lookup("CARTHOMEJNDINAME"), CartHome.class));
CartOrder order = null;

order = (CartOrder)home.create("1");

%>


Hope this helps.

Camilla Straubel wrote:
>
> Hi,
>
> I wonder if someone can help me.
> I�m going to call a EJB from a JSP-page. What will the code look like?
>
> Regards
> Camilla
> --
> ***********************
>
> Camilla Straubel
> Frontec Konsulter GBG
>
> ***********************
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> FAQs on JSP can be found at:
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html

--
Himagiri Mukkamala - EA Server Engineering,
Sybase Inc.,     510.922.5477

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
FAQs on JSP can be found at:
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html

Reply via email to