how to include a user java file into a jsp page

Discussion in 'Software' started by gaurav_kant, Oct 5, 2007.

  1. gaurav_kant

    gaurav_kant

    Joined:
    Sep 26, 2007
    Messages:
    10
    Likes Received:
    0
    :withstup:

    in a jsp program,
    i have a ReadAndPrintXMLFile.java in src folder. and arose.jsp is in main project folder(outside WEB-INF folder). Tramp.class is placed in WEB-INF/classes/ReadAndPrintXMLFile.class .

    now in .java file, 1 public static fun() named function exists. i m calling this function in my jsp page inside scriptlet. like this

    <%

    Vector sup=ReadAndPrintXMLFile.fun();

    %>

    class paths & all i think right. but i dont know y this error is comming



    An error occurred at line: 26 in the jsp file: /ShowFile.jsp
    ReadAndPrintXMLFile cannot be resolved
    23: <th width="100">Status</th>
    24: <%
    25: //ReadAndPrintXMLFile fl=null;
    26: Vector sup=ReadAndPrintXMLFile.fun();
    27: Iterator itr= sup.iterator();
    28: boolean change=false;
    29: while(itr.hasNext()) {


    Stacktrace:
    at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:85)
    at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
    at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:435)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:298)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:277)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:265)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:299)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
    at java.lang.Thread.run(Unknown Source)




    :bored: please help me out
     
    gaurav_kant, Oct 5, 2007
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.