Using Beans in jsp....PLEASE HELP ME STUCK BADLY From 9 days

Thread Solved

Join Date: Aug 2008
Posts: 1
Reputation: Harsimran is an unknown quantity at this point 
Solved Threads: 0
Harsimran Harsimran is offline Offline
Newbie Poster

Using Beans in jsp....PLEASE HELP ME STUCK BADLY From 9 days

 
0
  #1
Aug 1st, 2008
Hi ,everybody i am trying to use beans in jsp.....but i am stucked in first step...
i have copied code from somewhere ......here beans uses a package .Beans is compiled successfully and called bean by this tag in jsp

<jsp:useBean id="MyConnectionBean" scope="session" class="UserPack.ConnectionBean"/>

Here UserPack is package of bean
now i placed this jsp and a folder Userpack containig ConnectionBean.class in Root of Tomcat 6.0
Now when running this jsp file from browser it shows some errors......
First time it shows these errors
----------------------------------------------------
org.apache.jasper.JasperException: org.apache.jasper.JasperException: /MainPage.jsp(9,0) The value for the useBean class attribute UserPack.ConnectionBean is invalid org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:565)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:354)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause

org.apache.jasper.JasperException: /MainPage.jsp(9,0) The value for the useBean class attribute UserPack.ConnectionBean is invalid.
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:406)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:147)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1200)
org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1155)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2392)
org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
org.apache.jasper.compiler.Generator.generate(Generator.java:3397)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:210)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:314)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.2 logs.

On refreshing the page it shows
----------------------------------------------------
org.apache.jasper.JasperException: org.apache.jasper.JasperException: org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:565)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:354)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause

org.apache.jasper.JasperException: org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:160)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:326)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause

org.apache.jasper.JasperException: Unable to load class for JSP
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:600)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:148)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:326)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause

java.lang.ClassNotFoundException: org.apache.jsp.MainPage_jsp
java.net.URLClassLoader$1.run(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(Unknown Source)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:134)
org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)
org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:598)
org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:148)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:326)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

note The full stack trace of the root cause is available in the Apache Tomcat/6.0.2 logs.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,189
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 483
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: Using Beans in jsp....PLEASE HELP ME STUCK BADLY From 9 days

 
0
  #2
Aug 2nd, 2008
@now i placed this jsp and a folder Userpack containig ConnectionBean.class in Root of Tomcat 6.0

Wrong placement. Web project structure under Tomcat is as follows
PATH_TO_TOMCAT_FOLDER/webapps/YOUR_PROJECT_NAME/
  • *.html, *.jsp
  • can have folder img (for images) and css (for cascading style sheets)
  • WEB-INF
    • web.xml
    • lib - for all additional JAR files required by your project
    • classes
      • beans
Therefore you place your UserPack folder in place of beans folder and put that ConnectionBean inside that folder

More documentation can be found on Tomcat website
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 8
Reputation: nikhildoomra is an unknown quantity at this point 
Solved Threads: 2
nikhildoomra nikhildoomra is offline Offline
Newbie Poster

Re: Using Beans in jsp....PLEASE HELP ME STUCK BADLY From 9 days

 
0
  #3
Aug 7th, 2008
hey dont put the beans folder...
instead put the folder naming same as ur package...

--classes
----|--package_name (folder)
--------|--class files
--------|--java files

try this it would definitly work..
Last edited by nikhildoomra; Aug 7th, 2008 at 4:24 am.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,189
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 483
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: Using Beans in jsp....PLEASE HELP ME STUCK BADLY From 9 days

 
0
  #4
Aug 7th, 2008
The name of the folder that holds Beans does not matter, it is by your preferences!
Leaving Java files in folder after server deployment is irresponsible of you...
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 8
Reputation: nikhildoomra is an unknown quantity at this point 
Solved Threads: 2
nikhildoomra nikhildoomra is offline Offline
Newbie Poster

Re: Using Beans in jsp....PLEASE HELP ME STUCK BADLY From 9 days

 
0
  #5
Aug 7th, 2008
u r running on ur own server , i suppose not...
i think u r running it on local server, so dnt try to act smart...
that i mentioned at the time of compilation...
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,189
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 483
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: Using Beans in jsp....PLEASE HELP ME STUCK BADLY From 9 days

 
0
  #6
Aug 7th, 2008
1) Start using proper English it is one of the forum rules
2) You did not mention anything, just went on rants that the poster should not put his content in bean folder
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 8
Reputation: nikhildoomra is an unknown quantity at this point 
Solved Threads: 2
nikhildoomra nikhildoomra is offline Offline
Newbie Poster

Re: Using Beans in jsp....PLEASE HELP ME STUCK BADLY From 9 days

 
0
  #7
Aug 7th, 2008
i think i used proper english ...
if u didnt understand then go to primary school to learn english...
nd for ur kind information if u would do what i stated ... then u wont face ny problem...
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,189
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 483
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: Using Beans in jsp....PLEASE HELP ME STUCK BADLY From 9 days

 
0
  #8
Aug 7th, 2008
Personal attacks on forum members are not tolerated
Sort your dictionary as there are no English words as u, nd, ur, ny, dnt, r but for sure you, and, your, any, don't, are
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Join Date: Aug 2008
Posts: 8
Reputation: nikhildoomra is an unknown quantity at this point 
Solved Threads: 2
nikhildoomra nikhildoomra is offline Offline
Newbie Poster

Re: Using Beans in jsp....PLEASE HELP ME STUCK BADLY From 9 days

 
0
  #9
Aug 7th, 2008
just cut the crap off... these are short forms... there is sumthing named as voice... nd these short forms are based on voice.. so try to recognize the sounds.. i was just here to solve ur prob nt to argue with u...
instead of thanking u r arguing..
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 4,189
Reputation: peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of peter_budo has much to be proud of 
Solved Threads: 483
Moderator
Featured Poster
peter_budo's Avatar
peter_budo peter_budo is offline Offline
Code tags enforcer

Re: Using Beans in jsp....PLEASE HELP ME STUCK BADLY From 9 days

 
0
  #10
Aug 7th, 2008
Please read the whole post. It was not my problem but other member's! I just provided solution.
Please read the forum rules
We strongly encourage all posts to be in full-sentence English. Please do not use "leet" speak or "chatroom" speak.
Learn to see in another's calamity the ills which you should avoid.
Publilius Syrus
(~100 BC)

LJC - London Java Community, Graduate & Undergraduate Software Development Community, JAVAWUG (Java Web User Group), The London Android Group
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC