Solved

CORBA+JSP+Websphere Application Design

Posted on 2001-08-02
12
617 Views
Last Modified: 2013-12-22
Hi All,

What all I have to consider for designing an internet application invloving CORBA objects, Websphere and JSP.

Please share some good reference also.


Thanks,
rsKathait
0
Comment
Question by:rskathait
  • 5
  • 5
  • 2
12 Comments
 
LVL 2

Expert Comment

by:Veroland
ID: 6348331
First, I wont do the Corba calls in the JSP's.
Look at http://www-106.ibm.com/developerworks/patterns/

It has some good starting points in designing apps for WebSphere.

Are you going to host the Corba server or just be the client?

There is a lot more info that we need before really being able to say anything. However, the model view controller architecture is always a good starting point.

Take a look at the WebSphere Developer Domain as well.

http://www7b.boulder.ibm.com/wsdd/

It is very good
Mav

0
 
LVL 1

Author Comment

by:rskathait
ID: 6354643
Hi,

I will go through the patterns site.

I am putting some more facts about my requirement.

1. I will be using CORBA server mainly.
2. I need a browser client, that's why I asked for JSPs.
3. WHy you don't do COrba call in JSP.
4. Why do you recomment MVC architecture.
5. I will prefer to avoide CORBA client across the firewall, thats why I am asking for JSP.

I am doubling the points so that I can invite some more experts to the thread.

I have the similar posting at following link.

http://groups.google.com/groups?q=JSP%2BCORBA&hl=en&safe=off&rnum=2&selm=3c86375a.0108030420.72510340%40posting.google.com


Thanks,
rsKathait
0
 
LVL 2

Expert Comment

by:Veroland
ID: 6354960
Well, it is hard to code business logic and application flow control into a JSP. It is possible, but it is a nightmare to maintain.

JSP's are good for displaying data, and it's easy, if you use it for display purposes.

Servlets are better for controlling the screen and process flow of you application.

For scalability and maintainability purposes it is a lot easier having a seperate set of classes (EJB's, beans, rmi server etc. whatever makes sense) to handle all the corba calls. This way you have the corba layer not so finely contained in the application and can change/update ot much easier without effecting the rest of your application.

Normannly your servlets will call these Corba objects and pass the objects to the JSP's which then display them.

Hope this helps.
Mav
0
 
LVL 1

Author Comment

by:rskathait
ID: 6355037
Hi Mav,

You are right as far as theory is there. But I do not like to use servlet with JSPs (I prefer to use one of them at one time).

As far as I know, JSP and servlet are synonyms. I simply say put the presentation to JSP, business logic to beans (in my case CORBA object) as per MVC architecture. SO no place for servlets. Use JSP+CORBA objects.

So in point 3 and 4, I wanted to ask that is it must to have servlet or a bean class to instantiate CORBA. Is there a way to instanciate CORBA object from JSP?

Now, I will formulate my doubt as
1. Is there a way to instanciate CORBA object from JSP without using an intermediate bean or servlet?

My other requirement are
1. I will be using CORBA server mainly.
2. I need a browser client, that's why I asked for JSPs.
3. I will prefer to avoide CORBA client across the firewall, thats why I am asking for JSP.
4. I had a lot of presentation so I will avoid servlet alone.

So what do the experts recommend.


Thanks,
rsKathait



0
 
LVL 2

Accepted Solution

by:
Veroland earned 100 total points
ID: 6355155
rsKathait,

Your server side code is Java in JSP's. Hence, you should be able to do anything in a JSP that you can do in a normal bean/servlet etc. I know of some big applications that have been developed using only JSP's, not servlets. Even though I dont like it, it has been done.

You connect to Corba just the same as from normal beans etc.

So, if you do connect to Corba from JSP's I will get the connection to the Orb and the namingContext in one of the first JSP's that gets called and then store the references on the HttpSession. This will bypass the need to reconnect to them every time you use them. Connecting to the Orb and namingContext is *very* slow. You only want to do it one if possible.

Just beware on storing a lot of data on the HttpSession, if the HttpSession becomes to large your application performance drops a lot.

Just bear in mind, you can only connect to Corba with server code in JSP's. JSP's use javascript on the client side and javascript can not connect to a Corba Orb.

Mav
0
 
LVL 1

Author Comment

by:rskathait
ID: 6355173
Thanks Mav,

Can you share some code for calls to CORBA in JSP?

Do you know how Websphere Server Enterprise Edition helps in this scenario? Also pls share some sample code for this also?


Cheers,
rsKathait
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 2

Expert Comment

by:Veroland
ID: 6355253
Here is some code to connect to an orb. I havent done it in a JSP, but it should be close to the same.

protected ORB orb = null;
protected NamingContext namingContext = null;

// Connecting to the orb
        if (orb == null) {
            Properties props = new Properties();
            props.put("org.omg.CORBA.ORBClass", "com.gemstone.PortableServer.ORB");
            props.put("com.gemstone.CORBA.InhibitClientRetry", "false");
            props.put("com.gemstone.CORBA.RequestTimeout", "60");
            props.put("org.omg.CORBA.ORBInitialHost", "corbaServerName";
            props.put("org.omg.CORBA.ORBInitialPort",corbaServerInitialPort;
            orb = ORB.init(new String[0], props);
        }

// Connecting to the name service
          if (namingContext == null) {
               org.omg.CORBA.Object ns = getOrb().resolve_initial_references(corbaServerNamingContextName);
               namingContext = NamingContextHelper.narrow(ns);


// To connect to the objects
                 String s = {"rootObjectname", "CorbaObjectName"};
          org.omg.CORBA.Object o = null;
          NameComponent[] path = new NameComponent[namePath.length];
          for (int i = 0; i < s.length; i++) {
               path[i] = new NameComponent(s[i], "");
          }
          o = getNameService().resolve(path);

// Then you just have to cast the object
corbaObject  =      corbaObjectHelper.narrow(o, "corbaObject"}));


Hope this helps
As far as I know WAS Advanced should be enough for this, you dont need the enterprise version.

Ps. In this example I am connecting to a gemostone orb from within WAS.

Mav
0
 
LVL 1

Author Comment

by:rskathait
ID: 6355395
Thanks, It looks that my problem is solved. I will be testing it.

I will be award the points to you once I test the solution. Please be patient, it may take some time.

Meanwhile you cn also help me on CORBA deploymnet in WAS 3.5 AE/EE or WAS 4.0 AE. Refer to the following thread:

http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=java&qid=20162645


Rgds,
rsKathait
0
 

Expert Comment

by:ssaluja
ID: 6355405
Hi All
In response to above , I have a query:

Will a Corba client(in this case a JSP) get a reference to Remote Interface or can it also get reference to Home Interface as in case of EJBs.

Apart from the above query  I also have following issues:

1.Does the application server(Websphere App Server ) provide the facility of instance Pooling of corba Server Objects(as in case of EJB container providing instance pooling of stateless session beans)
2. How is Corba Object actaully deployed on the WAS

Thanks
Sanjay
0
 

Expert Comment

by:ssaluja
ID: 6355406
Hi All
In response to above , I have a query:

Will a Corba client(in this case a JSP) get a reference to Remote Interface or can it also get reference to Home Interface as in case of EJBs.

Apart from the above query  I also have following issues:

1.Does the application server(Websphere App Server ) provide the facility of instance Pooling of corba Server Objects(as in case of EJB container providing instance pooling of stateless session beans)
2. How is Corba Object actaully deployed on the WAS

Thanks
Sanjay
0
 
LVL 2

Expert Comment

by:Veroland
ID: 6355421
ssaluja, a jsp as a client can get the reference to an Home and Remote Interface. The way we prefer doing it is to store the EJBHandle on the HttpSession with the getHandle method on EJB's.

As far as I know WAS does not support native connection pooling for Corba objects, but I have implemented a group of stateless session beans that handle my Corba references and in this way the corba connections are created and destroyed by the container creating and destroying instances of my EJBs.

I did have some serious fun with the Corba connection timeouts etc this way.
0
 
LVL 1

Author Comment

by:rskathait
ID: 6504612
Thanks for your sincere efforts.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
custom annotations 9 32
session migration servlets 2 26
factorial example 4 35
How  Can  I  resolve   this  Error "java.sql.SQLException: Invalid column index" 4 25
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now