Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Passing beans to another web application

  Asked By: Alma    Date: May 24    Category: Java    Views: 934
  

I have a set up of 2 web applications in my iPlanet web server,
namely application A and application B and I would like to pass a
bean over to a JSP page in application B.What I did was:

Servlet in Application A:
request.setAttribute("ObjectName",SomeObject);

and in the JSP page in Application B:
(Object)request.getAttribute("ObjectName");

THe Object class resides in both the WEB-INF module of the web
application. However, I get the ClassCastException error each time I
call the JSP in application B. Have I left out anything in other to
pass the bean over and cast it back to the original object class?

Since both application have the Object class in it, I presume that
the class will be loaded once only therefore it should be able to be
cast back to the original class. Am I correct on this?

Does the Object class needs to reside on application B as well? If it
doesn't, how would I be able to compile it?

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Perdita Lopez     Answered On: May 24

I have a set  up of 2 web  applications in my iPlanet web server,
namely application  A and application B and I would like to pass  a
bean over to a JSP page  in application B.What I did was:

Servlet in Application A:
request.setAttribute("ObjectName",SomeObject);

and in the JSP page in Application B:
(Object)request.getAttribute("ObjectName");

THe object  class resides in both the WEB-INF module  of the web
application. However, I get the ClassCastException error  each time  I
call the JSP in application B. Have I left  out anything in other to
pass the bean  over and cast  it back  to the original  object class?

Since both application have the Object class  in it, I presume that
the class will be loaded once only therefore it should be able to be
cast back to the original class. Am I correct  on this?

Does the Object class needs to reside on application B as well? If it
doesn't, how would I be able to compile  it?

 
Didn't find what you were looking for? Find more on Passing beans to another web application Or get search suggestion and latest updates.




Tagged: