How to import my own package in my jsp?

I am doing aproject now. I have finished the java source file and complied them successfully. I want to package all of them and import this package in my jsp files. I copy all the .java and .class files to tomcat/webapps/projsp/WEB-INF/classes/ directory. I also write one line in my jsp file as following:
<%@ page language= "java" import="java.sql.*,java.util.*,java.io.*,induction.*" %>
My package named induction. I guess the problem is abput the class path. I don't know how can system find the package of mine. Hopefully, someone can help me!
Below is The error information when I run my jsp:
Internal Servlet Error:
org.apache.jasper.JasperException: Unable to compile Note: sun.tools.javac.Main has been deprecated.
/usr/local/tomcat/work/DEFAULT/projsp/jsp/geography_1.java:9: Package induction not found in import.
import induction.*;
^
1 error, 1 warning
at org.apache.tomcat.facade.JasperLiaison.javac(JspInterceptor.java:898)
at org.apache.tomcat.facade.JasperLiaison.processJspFile(JspInterceptor.java:733)
at org.apache.tomcat.facade.JspInterceptor.requestMap(JspInterceptor.java:506)
at org.apache.tomcat.core.ContextManager.processRequest(ContextManager.java:968)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:875)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:833)
at org.apache.tomcat.modules.server.Http10Interceptor.processConnection(Http10Interceptor.java:176)
at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:494)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:516)
at java.lang.Thread.run(Thread.java:536)

Hi!
Yes! You should create induction subdirectory in classes or
archive induction subdirectory in a jar file and store it in lib
subdirectory.
Bye

Similar Messages

  • Import my own package??!!!

    hello guys,
    I'm having a litle difficulties importing my own package.
    here is my example:
    I have a folder on C:\Users\User\Desktop\test2 in wich u can find a file called "hello.java" and another folder called "hi" which contains a file "hello2.java"
    in the file hello.java i want to create an instance of "hello2" so it is clear that i have to import from hello.java the package containing hello.class
    SO WHAT I DID IS THE FOLLOWING:
    first in enviroment variable i added to my CLASSPATH the path C:\Users\User\Desktop and in the file " hello.java" i wrote at the top:Import test2.hi.hello2
    it is still not working.
    i read somewhere that my package should have the following form: fr.inria.itey which i did not understand.
    can u plz give from my example what is my package name? and finally how to solve the issue
    thank you in advance for your help

    Hi ralfph.
    I suggest using an IDE such as eclipse. It has an auto complete utility that allows autogeneration of import code which is guaranteed to be correct.
    Based on your post, I'm not sure if it is a typo but you mentioned you wrote at the top "Import test2.hi.hello2".
    I would like to know if you got a compile error as "Import" should be typed as import with a small i.

  • How to import a tcl package in Java

    Hi,
    I want to convert an existing tcl file into a java source file. In my existing tcl file, some tcl packages have been imported, using the syntax
    package requires XML
    where "XML" is the name of a tcl package.
    But I am not sure how to import this tcl package in my Java code. Also, how can i call tcl procedures from Java code. The tcl package file contains a set of tcl procedures.
    Please let me know that
    1> How can I import/call a tcl package in a Java code.
    2> How can I call a tcl procedure in a Java code. The tcl procedure is contained in the tcl package file.

    I have searched the url provided by you. But I couldn't find anything relevant to my requirements.
    They have basically explained about how to call a Java program from a tcl code using java::call command
    But they haven't provided anything related to importing tcl package files inside java source.
    Please let me know your opinion on this issue.

  • Make and import my own package

    i create a class named Example in a package named test..after i compile Example.java with my IDE a C:/myfolder/test direcotry is created...
    now i have a class named Nothing in the following directory:
    C:/Documents and Settings/myclasses
    i want to import the test package in my Nothing class..how does the import command should be?? thanks...

    well there are differnt ways to do what you want...
    one way i use is assume Example is your class package
    all you do is you add that package into whichever
    project your currently working on them import it like
    post #1That method is not very practical when you have a
    large library of class files that you don't want to
    copy and paste into every single project that you
    need to use to them for.
    That's why learning about the classpath, as suggested
    in replies #4 and #7, is very beneficial.The method of adding the package to your project is the IDE's way of determining the classpath. But, this hides the idea of classpath from the coder. This is why it is recommended that beginners don't use IDEs--it hides valuable concepts from the coder, who then doesn't know what to do when they have a problem when they have to use just the JDK or a different IDE.

  • How to import all Support Packages simulteneily support Package Manager EBP

    Can any body tel me how to apply all support package sumultanesoly by using support Package Manager EBP/CRM option in SPAM.
    I could not able to select all pactche at a time.It selecting one patch at a time only
    Regards
    G Sasikanth Reddy

    I solved my self by selecting highest level of patch so that its dependencies can also add to the queue.
    Regards
    Sasikanth Reddy

  • How to Import a DTS Package, while keeping version History in Destination Intact

    Hi Guys,
    Not sure if this is the right forum for my question. But I couldn't find any other DTS forum to post my query.
    Basically, I have my Production Environment in SQL 2008R2 and it contains few DTS [NOT SSIS!!!!] packages in Management > Legacy. One of those packages, Let's say is, 'PackageA.dts'.
    Now for the PackageA, we have versions of last couple of years (almost 11 versions we have for this package), recently in Test Environment (again, SQL 2008R2) we made Lot of changes to that Package and now we want bring that package from Test Env. to Production.
    But a) we prefer not to 'open it in Prod then make all individual changes one by one' rather we just need to kind of overwrite/replace our existing Production Package   b) also, we don't want to loose version  history for the Existing PackageA.dts
    in Production, so anytime we can rollback when required.
    Any Idea if I can? [Please don't post non relevant answer like, convert DTS to SSIS. Sorry if I sound rude, really will appreciate if some one can try helping me.]  
    Regards, Avik M.

    Hi ArthurZ... "...No deletions, just import, it overrides the prod package" --- Is that the
    case? If so, it could have resolved my issue I guess. But that's not happening...
    If I don't delete and try to import same named package, I get below error::
    TITLE: Object Explorer
    DTS Package 'PackageA' already exists with a different ID in this category. (Microsoft OLE DB Provider for SQL Server)
    Regards, Avik M.
    EDIT: Also, I found another Post : dts-package-already-exists-with-different-id-in-this-category which
    says, we need to basically delete the existing Package to import same named package. -- Just opposite of what you mentioned ArthurZ. So what's the conclusion?
    I need to understand why the same package that I'm bringing from a different server is not just creating a new version if that package name already exists?
    Any workaround Microsoft?

  • How to import a java class in a JSP

    Hi All,
    I have a java class file called myTest.class (i made after compilation of myTest.java). I have a JSP page that uses this java class file.
    These 2 files are in same folder called c:/test
    and iam importing this java class file into my jsp file and that too at the start of this jsp file:
    <%@page import="myTest" %>
    BUt iam getting an error ..............when iam running this JSP page:
    /opt/bea81sp2/user_projects/domains/wliDomain/./Managed2/.wlnotdelete/extract/Managed2_myTest_myTest/jsp_servlet/__test.java:20: '.' expected
    probably occurred due to an error in /test.jsp line 5:
    <%@page import="myTest" %>
    Please advise how to solve this problem
    -sangita

    Don't bother with the import
    when iam not importing this class file into my JSP, then on my JSP, the class file is not found.
    Here is my code: and these 2 class file are in c:/test
    import org.apache.tools.ant.taskdefs.Ant;
    import org.apache.tools.ant.taskdefs.Property;
    import org.apache.tools.ant.types.*;
    import org.apache.tools.ant.*;
    import org.apache.tools.ant.taskdefs.ExecTask;
    import org.apache.tools.ant.types.Commandline;
    import java.io.File;
    * Creates an Ant project to run an Ant build
    * @author myself
    * @version 1.0
    public class RunTest extends Ant {
        String applicationName;
        String buttonClicked;
        String boxName;
        String targetName;
        public void applicationName(String applicationName){
         this.applicationName = applicationName;
        public void boxName(String boxName){
         this.boxName = boxName;
        public void buttonClicked(String buttonClicked){
         this.buttonClicked = buttonClicked;
      public RunTest() {
    public void goTest() {
         if(this.buttonClicked.equalsIgnoreCase("deploy") && this.applicationName.equalsIgnoreCase("scsmail") && this.boxName.equalsIgnoreCase("testnet")){
           this.targetName = "deploy-scsmail-testnet";
         if(this.buttonClicked.equalsIgnoreCase("undeploy") && this.applicationName.equalsIgnoreCase("scsmail") && this.boxName.equalsIgnoreCase("testnet")){
           this.targetName = "undeploy-scsmail-testnet";
        Project project = new Project();
        project.init();
        System.out.println("printing 1 ....");
        ExecTask exec = new ExecTask();
        exec.setProject(project);
        exec.setExecutable("/opt/bea/weblogic81/server/bin/ant.bat");
         exec.setDir(new java.io.File("/export/home/beamon/bin"));
         Commandline.Argument arg = exec.createArg();
         // arg.setLine("-f scsmail.xml test -listener org.apache.tools.ant.XmlLogger -logfile D:/antProject/src/log.xml");
         arg.setLine("-f build.xml "+ targetName + " -listener org.apache.tools.ant.XmlLogger -logfile /export/home/beamon/bin/log.xml");
         System.out.println("printing 2....");
        //exec.setOutput(new File("D:/antProject/logs/prob.txt"));
        exec.execute();
        System.out.println("printing 3....");
    -----------------------the JSP page is called as test.jsp
    <%@page contentType="text/html" %>
    <%@page import="java.io.*" %>
    <%@page import="java.util.*" %>
    <%@page import="java.net.*" %>
    <%@page import="RunTest" %>
    <HTML>
    <TITLE>TESTING ANT GUI</TITLE>
    <HEAD>
    <META HTTP-EQUIV="Refresh" CONTENT="3000" >
    <meta http-equiv="Cache-Control" content="no-cache">
    </HEAD>
    <BODY BGCOLOR="silver" TEXT="333333">
    <table border=0>
    <tr align="left"><td align="left"><FONT SIZE="-1"><B>  Test Page <FONT SIZE="-1"><B></td></tr>
    </table>
    <hr></center>
    <form action="./test.jsp" method="POST" name="testForm">
    <table>
    <tr>
    <td>
    <select name="appName" size=1>
    <option value="">Select Application Name
    <option value="scsmail">scsMail
    <option value="clientmanager">ClientManager
    </select>
    </td>
    <td>
    <select name="boxName" size=1>
    <option value="">Select Box Name
    <option value="testnet">TestNet
    <option value="production">Production
    </select>
    </td>
    </table>
    <table>
    <input type="submit" name="deploy" value="deploy">
    <input type="submit" name="undeploy" value="undeploy">
    </table>
    <%
       RunTest rt = new RunTest();
       rt.applicationName(request.getParameter("appName"));
        String deployButton = "";
        deployButton=request.getParameter("deploy");
        String undeployButton = "";
        undeployButton=request.getParameter("undeploy");
        if(!deployButton.equalsIgnoreCase("")){
            rt.buttonClicked(request.getParameter("deployButton"));
        if(!undeployButton.equalsIgnoreCase("")){
            rt.buttonClicked(request.getParameter("undeployButton"));
       rt.boxName(request.getParameter("boxName"));
        rt.goTest();
    %>
    </form>
    </table>
    </BODY>
    </HTML>

  • How to import ADF JS packages inside another javascript

    Hi,
    I need to import the ADF Faces javascript packages inside another javascript,
    to be able, inside this javascript, to access the page components.
    How can I do this ?

    You can't embed one jspx inside other, you need to use jsf page fragments for this.
    Approach 1:
    - Create a page fragment for the second page(second.jsff)
    - Include this in first.jspx page using jsp:inpclude tag as in sample below:
    <!-- first.jspx -->
        <af:document id="d1">
          <af:form id="f1">
            <af:outputText value="First Page"/>
            <af:commandLink text="Include Second" id="includeLink" partialSubmit="true">
              <af:setActionListener from="true" to="#{requestScope.includeSecond}"/>
            </af:commandLink>     
            <af:panelGroupLayout visible="#{requestScope.includeSecond eq true}"
                                 partialTriggers="includeLink">
              <jsp:include page="/second.jsff"/>
            </af:panelGroupLayout>  
          </af:form>
        </af:document>Approach 2:
    - Create a bounded taskflow with page fragments and drop a view and generate second.jsff for this view
    - Drop this taskflow as region inside first.jspx and set the visible property as given above in sample code to show only on clicking commandImageLink
    Sireesha

  • How to import  my own class in jsp file

    I have a jsp file in jsp\ directory and a class in web-inf\classes\ directory. How do I import the class in jsp so i can use it in my jsp file. Thanks,

    This is your lucky day, wennie.
    The correct forum to post this is:
    [http://forums.sun.com/forum.jspa?forumID=45]

  • How to import my own template to iPages

    I have a blank letterhead that I created that I want to be able to use over and over using iPages. However, I can't import the document to iPages. I tried scanning it as a .pdf file and iPages didn't recognize. I tried scanning it as a .jpeg file too. Can I get this blank letterhead into iPages so that I can send it to different people whenever I want?

    Hi Lynda,
    Where (what application) did you create the template?
    If you want to use it in Pages, and did not create it in Pages, my suggestion would be to open a blank Pages document, then use Copy/Paste to move the elements of the letterhead into that blank document. Re-construct the letterhead there, then Save the result as a Template.
    That will put it into the Template Chooser (in the My Templates section), ready for your use.
    Regards,
    Barry

  • How to import Hana exported package into Hana cloud portal?

    Hi All,
    Am new to hana cloud portal, But I have followed open sap courses,
    We have developed hana project in hana server using eclipse.
    Now this project we want to move into hana cloud portal,
    I have exported the project and views into delivery unit and schema exported separately.
    We have account in the cockpit(https://account.hana.ondemand.com)
    In this i want to import the project, Please provide me the steps to follow.
    Is there any possibility without adding system in the eclipse, I want to import the project in the cockpit itself.
    Thanks,
    Preethi

    Hi Preethi,
    The right place to post your question would be SAP HANA Cloud Platform Developer Center.
    Regards,
    Ifat.

  • How to import and display an applet from JSP

    i m using netbeans 5.0
    i have class named myapplet.class
    and jsp named myjsp.jsp
    now i want to access(import) this myapplet.class from jsp
    also i want to display this applet from this jsp
    i am able to do either thing but not both
    so please help me it is so urgent and important for me bcoz
    i have to complete my project as early as possible
    Thanks in advance

    my jsp source file page path is D:\Reliance
    project\WebApplication3\web\
    and classes path is D:\Reliance
    project\WebApplication3\build\web\WEB-INF\classes\
    so problem is that if i want to use myapplet.class
    then i have to put my class in D:\Reliance
    project\WebApplication3\build\web\WEB-INF\classes\
    location
    but at that time i am not able to display this applet
    on my jsp
    if i put my myapplet.class in
    D:\Reliance project\WebApplication3\web\ then i m
    able to display
    applet but not able to access(import) this class
    hope you will got the problem!!!
    thanks for your reply !!!try to set the path of your applet on jsp something like this
    "WEB-INF/classes/myclass.class"

  • Wana build my own package - how to do that?

    hey,
    i download the Firefox 3 Beta 3 from Mozilla server http://www.mozilla.com/en-US/products/d … lang=en-US
    my question is how can i install it? i need to create PKGBUILD file?
    what should i know more?
    thanks.

    To learn how to make your own packages read the wiki:
    http://wiki.archlinux.org/index.php/Makepkg
    http://wiki.archlinux.org/index.php/ABS
    http://wiki.archlinux.org/index.php/PKGBUILD
    For FF3, libgnome is an optional dependancy (I think).  FF3 attempts to look native on all platform and Gnome was chosen for linux. FF2 already used GTK.
    Last edited by Allan (2008-03-02 22:28:12)

  • Rookie trying to make my own package

    Reading in a real good book - "Thinking in Java" by Bruce Eckel. Really helping me to understand better a lot of the stuff that I had in my Java course at school.
    Got to a section where he's showing how to make your own packages. I'll lift directly:
    Consider, for
    example, creating an alias for System.out.println(�) to reduce
    typing. This can be part of a package called tools:
    //P.java
    // The P.rint & P.rintln shorthand.
    package com.bruceeckel.tools;
    public class P {
    public static void rint(String s) {
    System.out.print(s);
    public static void rintln(String s) {
    System.out.println(s);
    You can use this shorthand to print a
    String either with a newline (P.rintln(�)) or without a
    newline (P.rint(�)).
    So, I cut and pasted right into the text editor I use to practice with, saved and compiled it in a subdirectory off of one of the directories in the CLASSPATH, followed with a little test program:
    //ToolTest.java
    import com.bruceeckel.tools.*;
    public class ToolTest {
    public static void main(String[] args) {
    P.rintln("Available from now on!");
    P.rintln("" + 100); // Force it to be a String
    P.rintln("" + 100L);
    P.rintln("" + 3.14159);
    Here's the result of the compile:
    C:\Thinking in Java\com\bruceeckel\tools>javac ToolTest.java
    ToolTest.java:3: Package com.bruceeckel.tools not found in import.
    import com.bruceeckel.tools.*;
    ^
    1 error
    C:\Thinking in Java\com\bruceeckel\tools>
    At first I tried doing it on my own, making up my own package name, creating my own little source files, but got the same error. So I cut and pasted directly from the book, thinking surely it would work if I used Eckel's own code. Nope.
    Any clue what's going wrong? I've checked the CLASSPATH carefully, it includes
    C:\Thinki~1
    Thanks
    Felecha

    Your classpath should include "C:\Thinking in Java", not C:\Thinki~1.
    Also, your ToolTest.java should be in some other folder than "C:\Thinking in Java\com\bruceeckel\tools" - javac may act weird when it can find the to-be-imported classes in both the current folder and the classpath.
    If ToolTest.java had been in the folder "C:\Thinking in Java" you wouldn't have needed to modify the classpath.

  • How to use  third party package in java application

    hi, i am a student , new to java world can any of u tell me how to import third party package in our java application.
    i want to know how CLI is done in java.
    i am going thru this link http://www.codezoo.com/pub/component/5574
    not able to get anything.
    please please help me

    There are two steps -
    1. Import the classes you need from the package(s) using the Java import statement in your classes that need access to them.
    2. include the 3rd part code (one or more .jar files and/or root directories holding the code's package tree and .class files) to your javac and java class path and optionaly to the class path found in your .jar's manifest file.

Maybe you are looking for