Calling my Java class from JSP page

Hello, I am trying to call my Java class from my JSP page passing parameters to it and getting back a collection of result sets. Can someone tell me what I might be doing wrong:
JSP code to call Java class:
<%
String strEssUser = "test";
String strProcessingMonth = "JUL";
String strProcessingYear = "2002";
strQueryList=new ListReturn(strEssUser.toString(), strProcessingMonth.toString(), strProcessingYear.toString());
%>
I get this error when I try to run this JSP page using tomcat:
C:\Program Files\Apache Tomcat 4.0\work\Standalone\localhost\em\jsp\Test_0005fSummarySBU_0005fscreen$jsp.java:77: Class org.apache.jsp.ListReturn not found.
strQueryList=new ListReturn(strEssUser.toString(), strProcessingMonth.toString(), strProcessingYear.toString());
I'm not sure if this problem is the way I am calling the Java class, or if I have a problem in the Java code itself. Can anyone help?

Ok, I get a very strange error now:
org.apache.jasper.JasperException: Unable to compile class for JSPerror: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi).
What is this??? Anyone?

Similar Messages

  • Calling java class from jsp page

    Dear Friends.
    I wrote jsp page and java class.
    Am calling java class from jsp page. after processing result,
    I have to refresh jsp page from java class.
    processing time may take 5 minutes or 1 minute etc. that depends on user.
    Can It be possible ? if possible , How ?

    Ok, I get a very strange error now:
    org.apache.jasper.JasperException: Unable to compile class for JSPerror: An error has occurred in the compiler; please file a bug report (http://java.sun.com/cgi-bin/bugreport.cgi).
    What is this??? Anyone?

  • How to load java class from jsp page?

    hi all!
    Does anyone know how to load java class from jsp page?
    I try to load java class from jsp page.
    Is it possible to load java class fom jsp page?
    thanks and have a good day!

    What I mean is How to load/open java class file from jsp page?
    I think we can open Applet from jsp page by using
    <applet code=helloApplet.class width=100 height=100>
    </applet>
    but, how to open java class which is an application made by Frame?
    thanks and have a good day

  • Using java class from JSP page

    I have a class that connects to the database and return the result in form of array of objects, now I wrote a tester and I was able to print the result on the console but when it came to JSP how can I use this class I am a bit confused, how can I declare an array of objects and save the result that comes from the class method
    note: my class is not a bean it is a service class that contain methods to retreive different information from the database.
    I would apritiate any help but please make it in sequence for example declaring an array to hold the result then call the method that returns the array of objects..etc
    please help, I am really confused and don't know what to write
    thank you

    You can access a class in the same way as a bean, after all a bean is just a class that follows a set of rules.
    You need to put your classes in packages to access them.
    I have 2 packages, params and DTO. I set the class that returns the Data Transfer Object, or array of objects up as I would a bean
    <jsp:useBean id="DTO" scope="request" class="params.DTO" />
    I think you skip the above declaration and access it directly in code using
    params.DTO();
    but setting it up as I would a bean allows me to simply use
    DTO();
    DTO is the class that passes back the array of objects.
    Objects themselves I have in a seperate package, also called DTO (sorry if this is confusing, made sense at the time :-) ) You dont need them in seperate packages, just helped me keep DTO objects seperate from business logic classes......
    Now before I use params.DTO() I declare a variable of the Object type DTO() returns
    <%! DTO.workSheet[] ws; %>
    So, ws is the object type that will be returned by params.DTO()
    Then to get my array of objects back from params.DTO() :-
    ws = DTO.workSheet(day);
    or if you dont like the bean declaration
    ws = params.DTO.workSheet(day);
    You need to put your packages under WEB-INF/Classes when using Tomcat
    So I have
    Tomcat 5.0\webapps\myApplication\WEB-INF\classes\params
    Tomcat 5.0\webapps\myApplication\WEB-INF\classes\DTO
    Under which reside the classes

  • How can I call a java class from within my program?

    I was wondering if there's a platform independent way to call a java class from my program.

    Here's my scenario. I'm working on a platform independent, feature rich, object-oriented command prompt program. The way I'm designing it is that users can drop classes they write into my bin directory and gain access to the class through my program. For example, they drop a class named Network.class in the bin directory. They would type Network network at my command prompt and gain access to all the methods available in that class. They can then type system.echo network.ipaddress() at my prompt and get the system's ip address. I have it designed that there's a server running in the background and the clients connect to my port. Once connected the end-user can enter their user name and password and gain access to the system. When they type a command they actually call another java program which connects to my server using a seperate thread. They can then communicate back and forth. I have it set that everything has a process id and it's used to keep track of who called what program. Once the program is done it disconnects and closes. Rather than getting into the nitty gritty (I didn't want to get into heavy detail, I know how everything will work) I'm really interested in finding out how I can call a java program from my program. I don't want it to be part of the app in any way.

  • How to call a Java class from another java class ??

    Hi ..... can somebody plz tell me
    How to call a Java Class from another Java Class assuming both in the same Package??
    I want to call the entire Java Class  (not any specific method only........I want all the functionalities of that class)
    Please provide me some slotuions!!
    Waiting for some fast replies!!
    Regards
    Smita Mohanty

    Hi Smita,
    you just need to create an object of that class,thats it. Then you will be able to execute each and every method.
    e.g.
    you have developed A.java and B.java, both are in same package.
    in implementaion of B.java
    class B
                A obj = new A();
                 //to access A's methods
                 A.method();
                // to access A's variable
                //either
               A.variable= value.
               //or
               A.setvariable() or A.getvariable()

  • Calling a Java Class from PL/SQL

    Hai,
    I need a technique of calling a class file and invoke its
    methods written in Java by PL/SQL for my intranet development.
    PLease let me know if you have really experienced and won.
    Thanks
    JOhnson

    First, to call a Java class from PL/SQL the class needs to be
    deployed to the database. you can check the 8i documentation for
    the instructions for loading Java into the database(LoadJava).
    The document contains information on how to load the Java and
    call it from PL/SQL. The following links should help.
    Loading Java:
    http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/
    java.817/a83728/03write6.htm
    Invoking a Java Method in the database:
    http://otn.oracle.com/docs/products/oracle8i/doc_library/817_doc/
    java.817/a83728/04jserv2.htm
    Gary (JDev Team)

  • I want to call External Java class from the PL/SQL

    Hi,
    I am using Oracle Apps R11i (11.5.7), I wanted to call external Java class from the PL/SQL. This external Java class is residing in another application server.
    How do I do this.
    I know one way. Develop C routine in Oracle Apps to call external java class and call this C routine from the PL/SQL.
    Is there any simple method available? or any other method?
    Thanks in advance.
    -Venkat

    First of all, this is a Java application you're talking about, right (i.e. it has a main() function)? It's not just a class that you're trying to instantiate is it? If it's an application, you obviously have to start a new virtual machine to run it (rather than using the virtual machine built into the database like stored java). I'm a little leary of your mention of an "application server" as this would more commonly mean that a virtual machine is already over there running with access to this class. In which case, you'd typically interface with SOAP or some other RPC API.
    All that aside, as long as you have physical disc access (through NFS or whatever) to the class file, you could use a java wrapper class with a system call to do this. In fact, there is a thread in just the last day or so on this very forum that has the code to do just that (see " Invoking OS Commands from PL/SQL"). However, it's worth noting that the virtual machine will be running on the database server in this case and not the application server.

  • How do you call a java class from the main method in another class?

    Hi all,
    How do you call a java class from the main() method in another class? Assuming the two class are in the same package.
    Thanks
    SI
    Edited by: okun on May 16, 2010 8:40 PM
    Edited by: okun on May 16, 2010 8:41 PM
    Edited by: okun on May 16, 2010 8:47 PM

    georgemc wrote:
    To answer your impending question, either the method you're calling has to be static, or you need an instance of that other class to invoke it against. Prefer the latterAnd to your impending question after that: no, don't use the Singleton pattern.

  • How to: Calling a java class from asp?

    Hello all i have a problem to call a Java class from a asp
    Here what I do:
    [JavaSays.java]
    package JavaCom;
    public class JavaSays
    public String Hello()
    return "Hello world" ;
    then
    javareg /register /class:JavaCom.JavaSays /progid:JavaCom.JavaSays
    md c:\winnt\Java\TrustLib\JavaCom
    copy JavaSays.class c:\winnt\Java\TrustLib\JavaCom
    --Asp
    --TestJavaCom.asp
    <html>
    <body>
    <h1>Simple Test</h1>
    <% Set ObjPrueba = Server.CreateObject("JavaCom.JavaSays") %>
    <%= ObjPrueba.SimpleFn(5) %>
    <hr>
    </body>
    </html>
    when i try to run my asp
    it tell me that:
    Error type : Server Objetc, ASP 0177 (0x80040111)
    ClassFactory can not find the class
    any idea???
    thanks.

    I think the OP wants to use a class file as a COM object. I've never done that, but this URL:
    http://support.microsoft.com/default.aspx?scid=KB;EN-US;q167941&
    seems to indicate that you should have placed the class file into the c:\winnt\Java\TrustLib\ sub directory before you ran the JAvaReg bat file - I would re-run JavaReg and bounce IIS and associated services and see if that works out.
    Good Luck
    Lee

  • Calling a java class from asp

    Hello all i have a problem to call a Java class from a asp
    Here what I do:
    [JavaSays.java]
    package JavaCom;
    public class JavaSays
    public String Hello()
    return "Hello world" ;
    then
    javareg /register /class:JavaCom.JavaSays /progid:JavaCom.JavaSays
    md c:\winnt\Java\TrustLib\JavaCom
    copy JavaSays.class c:\winnt\Java\TrustLib\JavaCom
    --Asp
    --TestJavaCom.asp
    <html>
    <body>
    <h1>Simple Test</h1>
    <% Set ObjPrueba = Server.CreateObject("JavaCom.JavaSays") %>
    <%= ObjPrueba.SimpleFn(5) %>
    <hr>
    </body>
    </html>
    when i try to run my asp
    it tell me that:
    Error type : Server Objetc, ASP 0177 (0x80040111)
    ClassFactory can not find the class
    any idea???
    thanks.

    any idea???Yes, you are in the wrong forum, this is a Java forum, you have an ASP question, so i suggest you visit an ASP forum/site

  • Calling a java class in JSP in Weblogic 5.1

    Hi
    I am trying to call a java class in a jsp page. But it is giving an error:
    Compilation of 'C:\weblogic\myserver\classfiles\jsp_servlet\_knet\_buy.java' failed:
    C:\weblogic\myserver\classfiles\jsp_servlet\_knet\_buy.java:79: cannot access jsp_servlet._knet.e24PaymentPipe
    probably occurred due to an error in /knet/buy.jsp line 25:
    e24PaymentPipe pipe = new e24PaymentPipe();
    Is this a problem bcos of the wrong path of the class file which i am calling?
    Please help this is urgent

    Hello All
    As I tried to deploy the easiest project (dummy.war) on WebLogic 8.1.5, There is only one class (without package) Login.class
    *********** Listing of the dummy WAR ***********
    META-INF/
    META-INF/MANIFEST.MF
    WEB-INF/
    WEB-INF/classes/
    WEB-INF/classes/Login.class
    WEB-INF/web.xml
    index.jsp
    login.jsp
    ************ Output of deployment from Admin Console****************
    Log:     
         A log of the task's activities.
    [Deployer:149033]preparing application dummy on intranetAdmin
    [Deployer:149033]prepared application dummy on intranetAdmin
    [Deployer:149033]activating application dummy on intranetAdmin
    [Deployer:149033]failed application dummy on intranetAdmin
    [Deployer:149034]An exception occurred for task [Deployer:149026]
    Deploy application dummy on intranetAdmin.:
    Exception:weblogic.management.ApplicationException: start() failed.
    Module: dummy Error: weblogic.management.DeploymentException:
    [HTTP:101216]Servlet: "index" failed to preload on startup in Web application:
    " dummy ".
    weblogic.servlet.jsp.CompilationException: Compilation of D:\apps\wlsapp\
    INTRAN~1\.\intranetAdmin\.wlnotdelete\extract\intranetAdmin_ dummy _ dummy
    \jsp_servlet\__index.java failed.
    D:\apps\wlsapp\INTRAN~1\.\intranetAdmin\.wlnotdelete\extract\
    intranetAdmin_dummy_dummy\jsp_servlet\__index.java:22: '.' expected
    import Login; //[ /login.jsp; Line: 8]
    ^
    1 error
    at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:478)
    at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:246)
    at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:196)
    at weblogic.servlet.internal.WebAppServletContext.preloadServlet(WebAppServletContext.
    java:3430)
    at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext.
    java:3387)
    at weblogic.servlet.internal.WebAppServletContext.preloadServlets(WebAppServletContext
    .java:3373)
    at weblogic.servlet.internal.WebAppServletContext.preloadResources(WebAppServletContext.java:3356)
    at weblogic.servlet.internal.WebAppServletContext.setStarted(WebAppServletContext.java:
    6208)
    at weblogic.servlet.internal.WebAppModule.start(WebAppModule.java:864)
    at weblogic.j2ee.J2EEApplicationContainer.start(J2EEApplicationContainer.java:2134)
    at weblogic.j2ee.J2EEApplicationContainer.activate(J2EEApplicationContainer.java:2175)
    at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.
    activateContainer(SlaveDeployer.java:2520)
    at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.doCommit(SlaveDeployer
    .java:2438)
    at weblogic.management.deploy.slave.SlaveDeployer$Task.commit(SlaveDeployer.java:2155)
    at weblogic.management.deploy.slave.SlaveDeployer$Task.checkAutoCommit(SlaveDeployer.java:2254)
    at weblogic.management.deploy.slave.SlaveDeployer$Task.prepare(SlaveDeployer.java:2149)
    at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.
    java:2401)
    at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:
    883)
    at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:591)
    at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:500)
    at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:224)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:183)
    Caused by: java.io.IOException: Compiler failed executable.exec
    at weblogic.utils.compiler.CompilerInvoker.compileMaybeExit(CompilerInvoker.java:470)
    at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:328)
    at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:336)
    at weblogic.utils.compiler.CompilerInvoker.compile(CompilerInvoker.java:321)
    at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:451)
    ... 22 more
    - with nested exception:
    [java.io.IOException: Compiler failed executable.exec]
    I put this class into a dummy package named sample, changed package declaration within this class and changed import statement within jsp pages like this :
    <%@ page import="sample.Login " %>
    <jsp:useBean id="logUsr" scope="session" class="sample.Login" />
    When I did like this, everything is ok. No more exception.
    If my application has so many java classes under WEB-INF/classes/ without creating package, it may be so inconvenience.
    Please kindly let me know why this exception (class not found exception) occurred.
    And what is the solution? I cannot deploy the application successfully yet.
    many thanks,
    Zin Ko Win

  • Tag to take a java class in JSP page

    Hi,
    � need to get a tag to get a java class for example Test.java into a JSP page like MyJSP.jsp so that � can ,after doing this, call its methods, variables etc.
    Thank you !

    � know a way to do th�s us�ng JRun but the programme � have (NETBEANS IDE 3) does not accept �t.

  • Is there an easy way to call a java class from an applet?

    Does anyone know of an easy way to call a server based java class from an applet? Has anyone done it or came across it? If yes how/where?
    Cheers, Chris.

    I'm not sure about the issue. Are you talking about "servelets"? "RMI"? Take a look at those issues.

  • Calling a java class from abap/bsp

    Hello,
    I am still learning ABAP. I need to call a java class (a chart drawing library) from ABAP or from a BSP. What is the best way to do that ?
    Basically I would create an object, pass data from a database and then get some binary data from that object (an image).
    Hope you can help me
    Sincerely,
    Olivier Matt

    /people/gregor.wolf3/blog/2004/08/26/setup-and-test-sap-java-connector-outbound-connection
    check the above  link and this forum too
    Call Java Class and Methods from ABAP

Maybe you are looking for

  • SAP NETWEAVER COMPOSITION ENVIRONMENT 7.1 EHP1 - System doesn't start

    Hello,<br> <br> after i get the message the installation was succesfully and i start the server the proces jstart.exe<br> <br> doesn't start completely.<br> <br> in the trace file dev_jstart in find this error message:<br> <br> F  Starting process: D

  • Lenovo Hard Disk Issue - Felt bad about the service

    This email is regards to the complaint on Lenovo All in desktop i purchased which is still there in warranty.  I purchased All in one desktop on 25/02/2014 in one of the outlet of Reliance Digital, Bangalore,India. Below is the detail of the product

  • Spray Paint Effect in Illustrator

    Recently I accidentally started to make a spray paint effect over one of my layers in illustrator and I was wondering if anyone knew how to do it so I can use it again?

  • Is the Trial Version a Trap?

    I have installed the trial version of iwork 09 and registered it with Apple. The new features are nice but I am not sure if my usage justifies spending another 70 € so soon after having purchased iwork 08 in November. The problem now is that even hav

  • WANT TO DOWNLOAD BUT CAN'T!!!!

    My ipod 4g won't let me press the free button on vine when I'm trying to download it