Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

CORBA+JSP+Websphere Application Design

Posted on 2001-08-02
12
Medium Priority
?
651 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 400 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
 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

886 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