• Post Reply Bookmark Topic Watch Topic
  • New Topic

Supporting Classes in Weblogic..Where to put ?  RSS feed

 
Badal Kotecha
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I m facing one problem while using one simple class "Customer" which i m using in JSP the code in JSP is as follows
<%<br /> //System.out.println(session.getAttribute("customer"));<br /> Customer customer = (Customer) session.getAttribute("customer");<br /> if (customer == null)<br /> {<br /> String destinationPage = "/CustomerSearch.jsp";<br /> %><jsp:forward page='<%= destinationPage %>' />
<%<br /> }<br /> if (session.getAttribute("message") != null)<br /> {<br /> out.println(session.getAttribute("message") + "<br /> ");<br /> session.removeAttribute("message");<br /> }<br /> if (((Boolean) session.getAttribute("isNewCustomer")).booleanValue())<br /> {<br /> out.println("Customer not found. <br /> ");<br /> out.println("You can <a href=\"javascript:goBack()\" rel="nofollow">search again</a>, ");<br /> out.println("or insert a new customer : ");<br /> }<br /> else<br /> out.println("Existing Customer: <br /> ");<br /> %>

My Customer class is under package jsw.c03
Can anybody would help me about where to put this package under weblogic directory structure and does it need to do any changes in Weblogic.properties file.
I tried it by keeping the package in serverclasses dirctory but didnt worked..
Plz help me its urgent...
BADAL
 
Rahul Mahindrakar
Ranch Hand
Posts: 1869
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Badal,
We have a forum dedicated specifically to weblogic. You may get an apporpriate reply there.
 
sandy gupta
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Badal,
I dun think that u wud need to have the file in the classpath in case u specify the class file relative address in the jsp use tag itself .....or u can put the class/package name in the import tag and use the class name to create an object there...
HTH
Sahil
p.s:like
import x.y.*;
where u have u'r class file
and
class_name obj=new class_name();
 
Badal Kotecha
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thx a lot sahil!
yesterday i worked extensively on it at at last resolved the problem. Actually what i was doing is one of my servlet is populating my class data members and my jsp is accessing the same instance of the class from the session, and i was directly getting it from session in java code, later i tried it using useBean tag and it worked. May be the problem was because earlier i haven't mentioned virtual path for the class.
Anyway thx a lot once again
Badal(Clouds)
Originally posted by sandy ind:
Badal,
I dun think that u wud need to have the file in the classpath in case u specify the class file relative address in the jsp use tag itself .....or u can put the class/package name in the import tag and use the class name to create an object there...
HTH
Sahil
p.s:like
import x.y.*;
where u have u'r class file
and
class_name obj=new class_name();

 
Mad Sric
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi clouds,
If you are accessing some class via Session, I faced class cast exception. By chance do you have some of that sort??
If so try serializing the class it may solve your problem,
You may use statefull EJB either to solve the problem.
Srikishore and Madhavi.
 
Matt Midcap
Sheriff
Posts: 440
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Srikishore and Madhavi aka "Mad Sric",
Thank you for your post.
Please see out naming requirements here http://www.javaranch.com/name.jsp . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name.
Sorry, a name consisting of two people is not allowed.
Please choose a new name which meets the requirements.
Thanks,
Matt
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!