Results 1 to 4 of 4

Thread: Error in JSP

  1. #1
    tetrodotoxin is offline Member
    Join Date
    May 2010
    Posts
    3
    Rep Power
    0

    Default Error in JSP

    I get this error when i try to do useBean even using this example:
    Java Tips - How to use JavaBeans and JSP:useBean action in JSP

    Hope someone can help. Thanks.
    I have the class file is in web-inf/classes folder(default)
    even tried to put the servlet mapping but to no avail.


    An error occurred at line: 19 in the jsp file: /index.jsp
    CurrentTimeBean cannot be resolved to a type


    Stacktrace:
    at org.apache.jasper.compiler.DefaultErrorHandler.jav acError(DefaultErrorHandler.java:92)
    at org.apache.jasper.compiler.ErrorDispatcher.javacEr ror(ErrorDispatcher.java:330)
    at org.apache.jasper.compiler.JDTCompiler.generateCla ss(JDTCompiler.java:439)
    at org.apache.jasper.compiler.Compiler.compile(Compil er.java:349)
    at org.apache.jasper.compiler.Compiler.compile(Compil er.java:327)
    at org.apache.jasper.compiler.Compiler.compile(Compil er.java:314)
    at org.apache.jasper.JspCompilationContext.compile(Js pCompilationContext.java:589)
    at org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:317)
    at org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:313)
    at org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:260)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:717)
    at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:191)
    at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:852)
    at org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:588)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:489)
    at java.lang.Thread.run(Unknown Source)

  2. #2
    tetrodotoxin is offline Member
    Join Date
    May 2010
    Posts
    3
    Rep Power
    0

    Default

    any1 can help?
    I create as a normal will have problem, create as a servlet but remove all the servlet methods and the extend till it is like a normal bean class except for the servlet mapping, also got problem. so can guide?

  3. #3
    travishein's Avatar
    travishein is offline Senior Member
    Join Date
    Sep 2009
    Location
    Canada
    Posts
    684
    Rep Power
    5

    Default

    im not entirely sure, but I think some time ago they changed the JSP to require you to use a package for all the things that are used with <jsp:useBean/> tag.

    So, can you try to change your class to be in any package, not the default top level no package. e.g. I usually use "jsp" or "web" as my generic but useless package to stuff all my simple things in.

  4. #4
    tetrodotoxin is offline Member
    Join Date
    May 2010
    Posts
    3
    Rep Power
    0

    Default

    ooo, thanks got it working already.
    I used to develop in JDK 5, don't have the habit of reading updates.

Similar Threads

  1. Replies: 1
    Last Post: 03-10-2010, 01:53 PM
  2. Replies: 1
    Last Post: 12-05-2009, 07:28 AM
  3. Replies: 1
    Last Post: 10-26-2009, 04:38 PM
  4. Replies: 3
    Last Post: 01-23-2009, 08:53 AM
  5. error 530 error authentication required
    By rgale in forum JavaServer Pages (JSP) and JSTL
    Replies: 0
    Last Post: 05-12-2008, 04:28 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •