How to use self-defined class in a jsp page

Hello:
I defined a class for displaying purpose, which is in the different folder(WEB-INF/classes) from my JSP page.
In my JSP page, I want to create an instance of my class and display something, while I get the following error: "
org.apache.jasper.JasperException: Unable to compile class for JSP
An error occurred at line: 12 in the jsp file: /htmls/templateIntro.jsp
Generated servlet error:
[javac] Compiling 1 source file
/home/jiao/jsp_webserver/tomcat/work/Standalone/localhost/syllabus/htmls/templateIntro_jsp.java:72: cannot resolve symbol
symbol : class Display
location: class org.apache.jsp.templateIntro_jsp
Display display=new Display(out);"
How can I solve this problem? Should I redefine my classpath or there are some other actions I should take.
T.I.A.
Oriental Spirit

Here is what I have done:
1) in Display.java, add one line "package tools;" on the top, and compile it to
create Display.class.
2) create a new folder at
/home/jiao/jsp_webserver/tomcat/webapps/syllabus/WEB-INF/classes
named tools and then put the Display.class into the newly created folder.
3) in my jsp page, add " import="tools.*"
But it still doesn't work.
Any ideas? T.I.A.

Similar Messages

  • How to use custome tag lib in the JSP page?

    How to use custome tag lib in the JSP page?...with JDeveloper

    http://www.oracle.com/webapps/online-help/jdeveloper/10.1.2/state/content/navId.4/navSetId._/vtTopicFile.working_with_jsp_pages%7Cjsp_ptagsregistering~html/

  • How can i call java class file in jsp page

    Hai,
    i wants to call .class file in jsp page.
    my class file is in C:\jsdk\bin.
    Thanks

    I'm not entirely sure what you mean by "calling a class file", but I'm going to assume that you want to do something like the following in your page:
    <%
    MyClass myClass = new MyClass();
    myClass.someMethod();
    %>etc
    If that's the case, then all you have to do is make sure that the class is in the servlet engine's classpath. You'll probably also need to include an appropriate import statement at the top of the page.
    Hope that helps.

  • How to use an BPM Instance Variable in JSP page

    Hi All,
    I am using the JSP Presentation, but i don't know how to use an Instance variable in JSP page, that instance already declared in the process. And Can u explain the syntax that to include the JS file into jsp page
    Regards
    Vasu.
    Edited by bpmvasu at 04/03/2007 10:43 PM

    Hi Mariano,
    I'm using JSP presentation too. In "Interactive Component Call" active i'm using "Use JSP presentation", but i only can define one instance variable, i need to add more instance variables. In "Advanced" option of this task, i have the argument mapping .. but i don't understand how to use it.
    I have a instance variable called "genders" of the type String[Int] (Associative Array) and i'm mapping this instance variable in "Arguments Show In" option of the advanced option of JSP presentation. In JSP presentation i have the code:
    <select <f:fieldName att="person.gender"/>>
                   <c:forEach var="gender" begin="0" items="${genders}" varStatus="status">
                        <c:choose>
                             <c:when test="${person.gender == gender}">
                                  <option value="<c:out value="${gender}"/>" selected="true"><c:out value="${gender}"/></option>
                             </c:when>
                             <c:otherwise>
                                  <option value="<c:out value="${gender}"/>"><c:out value="${gender}"/></option>
                             </c:otherwise>
                        </c:choose>
                   </c:forEach>
              </select>And in my screenflow i have the code:
    genders[0] = "Male"
    genders[1] = "Female"But when i run my application, i have the error: "The task could not be successfully executed. Reason: 'java.lang.ClassCastException: java.lang.Integer'."
    What's the problem?

  • How to use a session, created in a jsp page, in a php page

    Hello, forgive me for the newbie question.
    Here is my problem:
    I want to have a jsp page create a session, set some session variables and then redirect to a php page which will access those same session variables.
    I have the redirection worked out, but I can't seem to find out how to use the jsp session in my php script.
    Is this possible at all, and if so, how does it work?

    Note that javascript runs on the client side, and JSP runs on the server. JSP and the session objects are NOT available to javascript in reaction to the user.
    If this function is called only when the page is first created, not when the user interacts with the page, or if you want that value to be constant with respect to the javascript, then you can do this:
    <%
      String someValue = (String)session.getAttribute("theAttributeName");
    %>
    <script type="text/javascript">
         Calendar.setup({inputField:"f_date_dfFirstPmtDate",
                                              button:"f_trigger_dfFirstPmtDate",
                                             singleClick:true,
                                              ifFormat:<%=someVale%>});
    </script>

  • Can anyone tell me how to use Tiles framework in an existing JSP page

    I want to seperate my portal area using tiles. I'm looking for example on how I go about that.

    This book doesn't have information on how to use tiles in legacy JSP page. Let me rephase the question again:
    How do I place Tiles tags to an existing JSP page to seperate the areas in a page?

  • How to use user-defined packages in JAX-RPC web service

    I am trying to use Object of my class located in my package in jax-rpc webservice,the code is
    package supercomputer;
    import Hello.*;
    public class SuperImpl implements SuperIF
    public String sendParam(String data)
    Temp ob=new Temp();
    int i=ob.get1(10000);
    return data+"returned by supercomputer";
    Temp is located in Hello package,I have jar the Hello package as Hello.jar and has set its classpath in targets.xml of Ant tool.
    The code compiles well and service is deployed successfully,but when i try to call the service from the client its gives me following error.
    [echo] Running the supercomputer.SuperClient program....
    [java] java.rmi.ServerException: Missing port information
    [java] at com.sun.xml.rpc.client.StreamingSender._raiseFault(StreamingSender.java:357)
    [java] at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:228)
    [java] at supercomputer.SuperIF_Stub.sendParam(SuperIF_Stub.java:60)
    [java] at supercomputer.SuperClient.main(Unknown Source)
    I dont know if it deploys why it gives error on client side.
    Please tell how to use user-defined packages and class in jax-rpc service code ,i am not talking about passing user-defined parameters i am just talking about making objects of user defined classes in jax-rpc service.I think there is some problem in classpath.
    Please guide me in doing that.
    Thanks,
    Farrukh

    Farrukh,
    I don't know if your error is about a missing class from your custom package, ... what track did you followed to say that?
    To use your package in the implementation of you web service, you should only follow the rules of making a web application: put your package jar in your \lib directory inside WEB-INF/ or your package classes unjared in classes (also in WEB-INF/).
    As I already said, I have doubts that your error should be originated from a missing class from your package, but:
    -try to see the logs (errors?) when you deploy your web service that could give a hint about the problem.
    -try to see if you can access your endpoint through your browser to see if there is a online status
    -display your config/WSDL file, and the steps you did to build your web service.
    regards,
    Pedro Salazar.

  • How to use the different class for each screen as well as function.

    Hi Experts,
    How to use the different class for each screen as well as function.
    With BestRegards,
    M.Thippa Reddy.

    Hi ThippaReddy,
    see this sample code
    Public Class ClsMenInBlack
    #Region "Declarations"
        'Class objects
        'UI and Di objects
        Dim objForm As SAPbouiCOM.Form
        'Variables
        Dim strQuery As String
    #End Region
    #Region "Methods"
        Private Function GeRate() As Double
                Return Double
        End Function
    #End Region
    Public Sub SBO_Appln_MenuEvent(ByRef pVal As SAPbouiCOM.MenuEvent, ByRef BubbleEvent As Boolean)
            If pVal.BeforeAction = True Then
                If pVal.MenuUID = "ENV_Menu_MIB" Then
                End If
            Else ' Before Action False
                End If
        End Sub
    #End Region
    End Class
    End Class
    Rgds
    Micheal
    Vasu Anna Regional Feeling a???? Just Kidding
    Edited by: micheal willis on Jul 27, 2009 5:49 PM
    Edited by: micheal willis on Jul 27, 2009 5:50 PM

  • How to use the implementation class in propetty pallete

    Hi,
    I am using forms 10g....I have to insert horizontal scroll bar in text item..
    I have only class files instead of jar files ...how cani place the class file instead of jar file...
    How to use the implementation class in property palette to display the PJC
    Thanks,
    Ansaf.

    The Implementation Class must reflect the full name of the class. For instance, if the full class name is : xx.yyy.zz.class_name, then put this in the Implementation Class property of the corresponding item.
    Also, the class must be stored in the equivalent directory structure, so that, in my example: <DEV_HOME>/forms/java/xx/yyy/zz
    Francois

  • How to import user defined class in UIX page?

    Does anyone know how to import user defined class in UIX page so that the class can be called in the javascript in the UIX ?
    Thks & Rgds,
    Benny

    what you are referring to is not javascript.
    it is JSP scriptlets. These are very different.
    In order to keep a strict separation between View and Controller, it is not possible to run arbitrary java code from within your UIX code.
    However, you can run java code from within a UIX event handler; see:
    http://otn.oracle.com/jdeveloper/help/topic?inOHW=true&linkHelp=false&file=jar%3Afile%3A/u01/app/oracle/product/IAS904/j2ee/OC4J_ohw/applications/jdeveloper904/jdeveloper/helpsets/jdeveloper/uixhelp.jar!/uixdevguide/introducingbaja.html
    event handler code is run before the page is rendered.

  • How to use self-signed Certificate or No-Check-Certificate in Browser ?

    Folks,
    Hello. I am running Oracle Database 11gR1 with Operaing System Oracle Linux 5. But Enterprise Manager Console cannot display in Browser. I do it in this way:
    [user@localhost bin]$ ./emctl start dbconsole
    The command returns the output:
    https://localhost.localdomain:1158/em/console/aboutApplication
    Starting Oracle Enterprise Manager 11g Database Control ... ...
    I open the link https://localhost.localdomain:1158/em/console/aboutApplication in browser, this message comes up:
    The connection to localhost.localdomain: 1158 cannot be established.
    [user@localhost bin]$ ./emctl status dbconsole
    The command returns this message: not running.
    [user@localhost bin]$ wget https://localhost.localdomain:1158/em
    The command returns the output:
    10:48:08 https://localhost.localdomain:1158/em
    Resolving localhost.localdomain... 127.0.0.1
    Connecting to localhost.localdomain|127.0.0.1|:1158... connected.
    ERROR: cannot verify localhost.localdomain's certificate, issued by `/DC=com/C=US/ST=CA/L=EnterpriseManager on localhost.localdomain/O=EnterpriseManager on localhost.localdomain/OU=EnterpriseManager on localhost.localdomain/CN=localhost.localdomain/[email protected]':
    Self-signed certificate encountered.
    To connect to localhost.localdomain insecurely, use `--no-check-certificate'.
    Unable to establish SSL connection.
    A long time ago when I installed Database Server Oracle 11gR1 into my computer, https://localhost.localdomain:1158/em in Browser comes up this message:
    Website certified by an Unknown Authority. Examine Certificate...
    I select Accept this certificate permanently. Then https://localhost.localdomain:1158/em/console/logon/logon in Browser displays successfully.
    But after shut down Operating System Oracle Linux 5 and reopen the OS, https://localhost.localdomain:1158/em/console/logon/logon in Browser returns a blank screen with nothing, and no more message comes up to accept Certificate.
    My browser Mozilla Firefox, dbconsole, and Database Server 11gR1 are in the same physical machine.I have checked Mozilla Firefox in the following way:
    Edit Menu > Preferences > Advanced > Security > View Certificates > Certificate Manager > Web Sites and Authorities
    In web sites tab, there is only one Certificate Name: Enterprise Manager on localhost.localdomain
    In Authorities tab, there are a few names as indicated in the above output of wget.
    My question is: How to use self-signed certificate and no-check-certificate in Mozilla Firefox for EM console to display ?
    Thanks.

    Neither problem nor solution do involve Oracle DB
    root cause of problem & fix is 100% external, detached, & isolated from Oracle DB.
    This thread is OFF TOPIC for this forum.

  • How to use RMI Stub class in programming?

    Hi all,
    I'm new on RMI.
    Is there anyone can explain to me how to use RMI Stub class which is generated by invoking rmic command?
    For my testing, I can only invoke rmi object nethod via its remote interface. Then what is stub used for when we are coding?
    I do appreciate anyone's help.
    Thanks very much,
    Xianyi.Ye

    When the remote object binds itself to the registry, what is actually bound is the stub.
    So when the client does a registry lookup, what it gets is the stub. However from the client's point of view it is just some mystery object that implements the remote interface.
    So you never have to use it directly, it is all automatic.

  • How to use Two main windows with in a page in script ?

    Hi any body explain me...
    How to use Two main windows with in a page in script ?
    with  header data in one main window,
    & Item data in other main window.

    HI..,
    u need to go for <b>SPLITTING THE MAIN WINDOW</b> !!!
    Main windows in page windows allow you to format text in multiple columns. Define an area in the page window, in which to position the main windows.
    Here is the procedure !!
    -->Create a page window and assign it to a page.
    Choose <b>Edit --> Main windows</b>.
    A dialog box appears.
    -->Enter values in the fields <b>Area width</b> and A<b>rea height</b> in accordance with the input guidelines for main windows.
    -->Enter values in the fields <b>Spacing</b> and Number in the <b>Horizontal group</b> if you want to use multiple columns. You can ignore the fields in the Vertical group.
    Determine how many columns and line areas are required for label printing. Then enter the corresponding values in the fields in the <b>Horizontal and Vertical groups</b>.
    -->The value in the field Left margin varies from main window to main window if multiple columns are used. The following applies:
    <b>
    Left margin of current column + Window width + Horizontal spacing = Left margin of next column</b>
    In label printing, the field Upper margin also varies from main window to main window:
    <b>
      Upper margin of current main window +  Window height + Vertical spacing = Upper margin of next main window</b>
    -->Enter a value in the field Start position.
    This is a counter. Enter a starting value which is equal to or greater than 1.
    -->The main windows are added to the list.
    -->Save your form.
    reward if it helps u...
    sai ramesh

  • How to create links and how to use that links to go to other pages?

    my question is....how to create links...i mean by using make link option.....when we do right click on a word,etc in the design view.....and my other question is.....how to use that links to go to other pages.....i mean when i click on a link...it takes me to another web page.....

    Please do not post the same subject to more than one forum.

  • UIX/JSP - How to use the UIX Controller with UIX/JSP

    After reading the UIX Developers Guide I am under the impression that I could use the UIX Controller with UIX/JSP pages. Is this correct and are there any available examples?
    Bill G...

    It's correct, but I'm afraid we don't have much (read as "any")
    documentation on how to do that - besides reading through the
    gobs of Javadoc and guessing how to put it together.
    Half of the problem is solved by registering JspPageDescriptions
    on a PageBroker (e.g., UIXPageBroker) to tell the UIX Controller
    to use a JSP to render a particular page, instead of a UIX XML
    document.
    The other half is getting the JSP to send requests back to
    the UIX Controller. Depending on how you've chosen to name
    your pages, create either a DefaultPageEncoder or ExtensionPageEncoder
    inside your JSP, and use that to create destination URLs.

Maybe you are looking for

  • YouTube links on a new Portfolio site

    I'm new to Muse, and I'm creating a small, simple porfolio site with samples of my writing and video work. On one page, I want to place some sample YouTube videos . If I want to place embedded YouTube players on the page, what kind of widget should I

  • No scroll bar in "to" field?

    I am the VP of our local adult soccer league, and I often have to send messages to fairly large distribution lists. The "to" box expands, and the scroll wheel on my mouse scrolls the addresses up and down, but there is no scroll bar on the window/box

  • How to create a File Save link inside a flash animation

    I have a .swf file the ends with " View or Download Catalog " - I need to know how to prompt the user to Choose a location to save the file locally. Your help is greatly appreciated.

  • How to edit the starting time for clips in properties?

    Hello there , I'm testing the CS5 Audition right now and find it great except for one thing: In the properties for each clip there is a starting time. But it just can't be edited! I can change the starting time of the whole session – yes. But not the

  • How do i sort events within events on iPhoto

    I have a lot of events that have to do with one main event in iPhoto. I wanted to make one big event that I would click to then open all the specific event folders within it, is there any I can do this?