Import classes error

Hi
i am new to servlet also and i having compiling my servlet.
this is my code:
import javax.servlet.*;
import javax.servlethttp.*;
import java.io.*;
import java.util.*;
public class Index extends HttpServlet
String path = "http://faculty.cs.tamu.edu/yurttas/";
String builder;
String url;
     //i handling a web form where i get the path
     public void doPost(HttpServletRequest request, HttpServletRespone response)
               throws IOExcepction, ServletException
     Enumeration e = request.getParameterNames();
     while (e.hasMoreElements())
          String name = (String) e.nextElement();
          String builder = builder + request.getParameter(name);
     url = path + builder;
     //starts making the html file
     response.setContentType("text/html");
     PrintWriter out = response.getWriter();
     //head
     out.println("<html>");
     out.println("<head>");
     out.println("<SCRIPT LANGUAGE=JavaScript>");
     out.println("window.location.href =\" " + url + "\" ;");
     out.println("</SCRIPT>");
     out.println("</head>");
     //body
     out.print("<body>");
     out.print("</body>");
     out.print("</html>");
     }//end doPost
and this are my errors:
Index.java:1: package javax.servlet does not exist
import javax.servlet.*;
^
Index.java:2: package javax.servlethttp does not exist
import javax.servlethttp.*;
^
Index.java:11: cannot resolve symbol
symbol : class HttpServlet
location: class Index
public class Index extends HttpServlet
^
Index.java:18: cannot resolve symbol
symbol : class HttpServletRequest
location: class Index
public void doPost(HttpServletRequest request, HttpServletRespone response)
^
Index.java:18: cannot resolve symbol
symbol : class HttpServletRespone
location: class Index
public void doPost(HttpServletRequest request, HttpServletRespone response)
^
Index.java:19: cannot resolve symbol
symbol : class IOExcepction
location: class Index
throws IOExcepction, ServletException
^
Index.java:19: cannot resolve symbol
symbol : class ServletException
location: class Index
throws IOExcepction, ServletException
^
7 errors
chris22@sun [~/web_home/distance/hwk01/] %
i am compiling in a unix machine. What do you recommend me to do??

Hi,
The problem is in your classpath. Set your classpath properly.
bye for now
sat

Similar Messages

  • Urgent Help! Import Class errors

    Hello,
    I have a flash based site (CS4/AS3) with multiple pages and on each page, when click a certain btn, i have a xml image gallery.
    I recently bought a xml gallery and have some problems gettin it to work..and the support team doesnt respond so i'm hoping u can help me. It.s not very complicated but i have some problems understanding some things.
    Here is the documentation of the gallery > https://dl.dropbox.com/u/21765376/Portfolio_Flash_Gallery.pdf. I managed to configure the gallery but have problems embed it to my .fla project.
    This is what i have done so far according to the documentation: i copied the lightBoxLoader to my .fla file; Then created a keyframe on the page that i need to display the gallery and paste this:
    import src.Portfolio;
    stop();
    var myPortfolio:Portfolio;
    if ( stage.loaderInfo.parameters["XmlFilePath"]!=null)
        myPortfolio= new Portfolio(String(stage.loaderInfo.parameters["XmlFilePath"]));
    else
        myPortfolio= new Portfolio("xml/config.xml");
    addChild(myPortfolio);
    When test movie : 1172: Definition src:Portfolio could not be found.
    Then on that as keyframe, clicked the stage and in the prop panel named Class: Portfolio >> 1172: Definition src:Portfolio could not be found.- import src.Portfolio;  /   1137: Incorrect number of arguments.  Expected no more than 0. - myPortfolio= new Portfolio(String(stage.loaderInfo.parameters["XmlFilePath"]));   / 1137: Incorrect number of arguments.  Expected no more  -  myPortfolio= new Portfolio("xml/config.xml");than 0.
    Folders r structured like this:     Desktop(C...)/SITE  >> and here  i have Portfolio .fla,which contains the lightBoxLoader + the gallery folders (images>btns,thumbs,view  | src> Portfolio Actionscript file   |  xml > config )  + my site .fla with necessasry assets.
    I also  modified > Publish settings/Flash/Actionscript settings / Source path - and here put  "../src" .
    I know i/m missing something but dont know what, im not pro at AS3!
    I hope u understand my problem and can give me a solution!
    Please!
    Thank You!.

    It seems that your Portfolio constructor is not supposed to take any arguments.

  • Compilation Error for import classes not found in generated Proxy Class

    Hi,
    We are generating java classes for the COM dll using JCOM com2java compiler.
    We are getting a compilation error for import class not found when compiling the
    generated Proxy java source code. It can't find the com.bea.jcom.Dispatch class that
    the generated Proxy java source code extends. It also can't find com.bea.jcom.Variant
    or com.bea.jcom.Param. These are interfaces or data types or classes used by COM
    library.
    I added weblogic.jar to my class path and the only Dispatch class i found inside
    the weblogic.jar is com.linar.jintegra.Dispatch;
    We have com objects for which we want to develop an EJB client to interface with
    the COM object using JCOM with Native Mode disabled.
    Any help on the compilation error..I tried changing the extends for Dispatch to com.linar.jintegra.Dispatch
    but the other errors are still there.
    To begin with, I think the generated code should not refer to any of the COM data
    types.
    Any help please.
    Thank you in advance,
    Regards,
    Rahul Srivastava
    [email protected]

    Hi,
    I resolved the other errors by changing all references from com.bea.jcom.Variant
    etc to com.linar.jintegra.class name..all were present under the com.linar.jintegra
    package.
    Thank you all anyways,
    Regards,
    rahul
    "Rahul Srivastava" <[email protected]> wrote:
    >
    Hi,
    We are generating java classes for the COM dll using JCOM com2java compiler.
    We are getting a compilation error for import class not found when compiling
    the
    generated Proxy java source code. It can't find the com.bea.jcom.Dispatch
    class that
    the generated Proxy java source code extends. It also can't find com.bea.jcom.Variant
    or com.bea.jcom.Param. These are interfaces or data types or classes used
    by COM
    library.
    I added weblogic.jar to my class path and the only Dispatch class i found
    inside
    the weblogic.jar is com.linar.jintegra.Dispatch;
    We have com objects for which we want to develop an EJB client to interface
    with
    the COM object using JCOM with Native Mode disabled.
    Any help on the compilation error..I tried changing the extends for Dispatch
    to com.linar.jintegra.Dispatch
    but the other errors are still there.
    To begin with, I think the generated code should not refer to any of the
    COM data
    types.
    Any help please.
    Thank you in advance,
    Regards,
    Rahul Srivastava
    [email protected]

  • Import and recognize class error

    The following is a simple welcome.jsp file that I am trying to run on a local J2EE sever. As you can see it tries to import classes one being the FaqCategories.class which is located in the folder Ch03 of the WEB-INF directory. When I call the page up on the browser It gives me that it does not recognize the FaqCategories faqs = new FaqCategories; class error. I am wondering why(Is the import statement wrong? Did I put the class in the wrong directory? Etc... I followed everything the book told me to a que and I still received an error.
    <&@ page errorPage="/WEB-INF/errorPage.jsp"
             import="java.util.Iterator,Ch03.FaqCategories" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
         <title>Java FAQ Welcome Page</title>
       </head>
       <body>
         <h1>Java FAQ Welcome Page</h1>
         Welcome to the Java FAQ
      <%! FaqCategories faqs = new FaqCategories(); %>
      Click a link below for answers to the given topic.
      <%
        Iterator categories = faqs.getAllCategories();
        while(categories.hasNext()) {
           String category = (String) categories.next();
       %>
          <p><a href="<%= replaceUnderscore(category) %>.jsp"><%= category
       %></a></p>
       <%
        %>
       <%@ include file="/WEB-INF/footer.jspf" %>
          </body>
         </html>
          <%!
           public String replaceUnderscore(String s) {
             return s.replace(' ','_');
           %>

    Originally posted by: nadeem.aboobaker.bea.com
    "Walter Harley" <[email protected]> wrote in message
    news:f2jet7$na1$[email protected]..
    > "Nadeem Aboobaker" <[email protected]> wrote in message
    > news:f2j2au$fi6$[email protected]..
    >> Hello all,
    >>
    >> I am having issues creating a plugin as a JAR file, where the plugin
    >> contains a nested JAR file.
    >
    >
    > Hey, Nadeem.
    >
    > Yes, there are a lot of problems with trying to use nested jars in (and
    > out of) Eclipse. You can look at
    > https://bugs.eclipse.org/bugs/show_bug.cgi?id=145001 as a sort of
    > "umbrella" bug report that mentions some of the issues and refers to other
    > bugs. There is more than one limitation at work, so describing the issues
    > succinctly is difficult. As you noticed in the posting from a year ago,
    > the only way to make it work really smoothly is to get rid of the nested
    > jars by expanding them (and even then, there are issues with nested .class
    > files!).
    >
    > If it is at all possible to convert the nested .jar into a separate
    > plug-in (by adding an OSGi-compliant MANIFEST.MF) and make your primary
    > plug-in depend on it, instead of trying to nest the jar within your
    > primary plug-in, that will be your best and most "Eclipse-friendly"
    > answer.
    >
    > Feel free to contact me offline or here on the newsgroup if needed.
    >
    > -walter
    Walter, thanks for the reply. Converting the nested .jar into a sepearate
    plug-in isn't possible for my case. I checked out the Bug report, and also
    the referenced bugs and Wiki page, it was interesting to read all the
    issues. :) In any case, I know that deploying the plugin as a directory
    instead of a jar works, so I will just go with that approach.
    - Nadeem

  • Error when I import classes using directive JSP page

    Hi all!
    I have installed JDeveloper 11g (11.1.1.3.0)
    My applications are located in the C:\dir (JDEV_USER_DIR = C:\dir)
    I Created application "Appliation1". In it i created 2 projects (Project1, in it beans session entity and other java classes; Project2, in it JSP).
    I want import classes from Project1 to Project2 using next directive:
    <%@ page contentType="text/html;charset=windows-1252"
    import="project1.*"%>
    so in Project properties of Project2 set the way to classes in Project1.
    When i run JSP an error occurred:
    Error(4,9): The import project1 cannot be resolved
    Maybe i'm not set correctly the way to the classes
    Thanks in advance.

    angelr, thanks, it helped me)
    In jdeveloper 10g i set address in Project Properties->Libraries and Classpath->Add JAR/Directory;
    and set the way to my classes;
    and it worked.
    in the 11 version seems different

  • Import JavaBean Error : Invalid Class

    previously , i have 3 commandbean class , after that i add another 2 commandbean class,
    i hit the following error,
    Invalid Class -JavaBean not available for import class
    :net/solutions/model/ExternalToGateway
    Jar: c:\documents and settings\yzme\sap\workspace\SmsGatewaywebdynpro\lib\SmsGatewayCommandBean.jar
    Message was edited by:
            yzme yzme
    Message was edited by:
            yzme yzme

    Hi yzme yzme,
    These problems occur when you are not following the specification for the java Beans that the netweaver platform expects:
    Please check the following for eradicating the error:
    1. Is there a setter which doe'snt have a consequent getter for the variable.If so provide it because its considered mandatory from the bean Specs.
    2.If you have used your own methods for fetching and setting the value rather then using the getter setter for the same this will give a generational error on import.
    Above listed mistakes are made by developers ona regular basis. Please go through the java bean specs on sun.java.com for more details
    Regards
    Amit
    Allocate points if found Helpful.

  • Import Statement Error

    Does anyone know what is wrong with these import statement?
    import Reduction;
    import Mapper;
    import ApplyObj;
    import ApplyObjUnary;
    import java.lang.String;
    public class Driver{
    public static Driver me = new Driver();
    public static void main(String[] args){
    int i;
    I places all my *.java file in the same directory as Driver.java
    But when i try to compile Driver.java, it says :-
    C:\assignment1>javac Driver.java
    Driver.java:10: '.' expected
    import Reduction;
    ^
    Driver.java:11: '.' expected
    import Mapper;
    ^
    Driver.java:12: '.' expected
    import ApplyObj;
    ^
    Driver.java:13: '.' expected
    import ApplyObjUnary;
    ^
    4 errors
    I set my class path as
    C:\>SET CLASSPATH = .;C:\j2sdk1.4.0_01;c:\assignment1
    Apparently, the current directory has been set and my assignment1 directory has been set.
    Did i miss out anything? Why does it can't recognize the existence of other class file in the same directory?
    thanks.

    You don't need to import classes that are in the default package (i.e. you didn't put them in a package). And in Java 1.4, you can't import them. Just remove the import statements, you shouldn't need them.

  • Not allowed to import classes without package names?

    Hi,
    I have a few questions on Packages and importing?
    1. Is the following true that it is illegal to import classes in the same package as the current class, will this cause a comilation error? If this is the case where in the Java Language specification is this actually written as I could not find it?
    2. This has probably been answered by question 1 but if I have 2 classes in the same package and if I import 1 of the classes into the other class, is it illegal to import it by just using the class name and not the package name as well, ie
    if the package name is ie.tcd
    and the 2 class names are exp1.class and exp2.class, can I do this in class 2
    package ie.tcd;
    import exp1;
    public class exp2 {
    3. Is it illegal to import classes that are not explicitly part of any package or must a class be part of a package to be imported. I read somewhere that while this was always illegal it is only after jdk 1.4.2 that this is being enforced? If this is the case where in the Java Language specification is this actually written as I could not find it either?
    Thanks very much for any help,
    John

    Was just also wondering, 1 other thing, I am looking
    at someone elses code they have 2 classes (Class A
    and Class B) in the same package (pkg). The person
    imports class A into B:
    package pkg;
    import A;
    public class B {
    Is this legal code (or was it ever)?Not if A is really in pkg.A. If there is an A in the unnamed package it was legal, or at least it was understood by the compiler, and now it isn't (to both).
    Can you import or is there a point in importing a class in the same
    package?Only by naming the package in the import statement. If the current and the import statement are in the same package the import is redundant.
    If there is a point would you import just be
    using the class name (this would be illegal after jdk
    1.4) or should you use the whole package name even
    though it is in the package anyways?As I understand it you must always use the whole package name in imports.

  • Problem importing classes and beans

    Hey there. Im having one major fustrating problem! When I code supporting classes and beans for my JSPs I get a code 500 internal server error when trying to import (via <%@ page import="class" %> and <jsp:useBean/>) Im storing my classes and beans in the WEB-INF folder and the calling JSPs are located in /ROOT/tests/8/jsp.jsp. Im using the following to import a class or bean:
    <%@ import="aClass" %>
    Seen as tho its in the WEB-INF folder I won't have to explicitly refer to where the class is located, just the class name.
    I never had this problem when I was using my hosting service. Its only on my localhost server in which I get the Internal Server error.
    Help appreciated, thx.
    PS: Im quite new to JSP/Java Servlet.

    import (via <%@ page import="class" %> and
    <jsp:useBean/>) Im storing my classes and beans in the
    WEB-INF folder try put your class file in WEB-INF/classes.
    or first put bean in the package, like WEB-INF/classes/packagename/beanclass
    in jsp page:
    <jsp:useBean id="Mybean" class="packagename.beanclass" scope="request" />
    Question: is /ROOT a context entry in your server.xml?
    Which JSP Container (version) you use? Maybe your localhost server's set up is different with your hosting.

  • Cannot import classes

    I have one class calling another, like this:
    import CloseWindowListener;
    import DatabaseSearchControls;
    import java.awt.event.*;
    public class DatabaseSearch {
         public static void main (String[] args) {
              DatabaseSearchControls frame = new DatabaseSearchControls();
              frame.addWindowListener ( new CloseWindowListener() );
              frame.show();
    I get these errors when I compile DatabaseSearch:
    C:\Documents and Settings\Korbel\My Documents\benmay\DatabaseSearch.java:9: '.' expected
    import CloseWindowListener;
    ^
    C:\Documents and Settings\Korbel\My Documents\benmay\DatabaseSearch.java:10: '.' expected
    import DatabaseSearchControls;
    The other 2 files complied correctly and are in the same directory. Anyone ever seen this and know what I am doing wrong?
    Thank you!

    Are you compiling with version 1.4? If so, it is now invalid to import classes that don't belong to a package. It is not necessary to do so anyway, so just remove the import statements. Better yet, follow the Java standard and put each class you write into a named package, using the package statement.

  • Importing classes... HELP!!!

    I'm using JBuilder Enterprise Edition...
    I open a .java file to edit and recompile to test my edit...
    However I keep getting errors that classes imported in the ,java file do not exist...
    I know they do, because I copied them locally to the folder where all the filess I need are located...
    The .java files that compile into .class files are read-only (there are over 100 of them)
    I've pulled them from a server to my local machine...
    Even if I check them out in Visual Source Safe, I still get errors that the imported classes in the source code do not exist...
    how do I fix this issue?

    Looks like I had a copy of JBuilder installed after all. So I selected Project-> Project Properties select the Paths tab then the Required Libraries tab (lower tab), hit the add button, then hit the new button. Fill in the library name and select project to hold the library. Then search your disk for the jar or the directory that contains your classes. Then hit OK a few times.

  • Importing classes in Jsdk 1.4.2

    Hi,
    I have two swing applications that run perfectly well when compiled and run. But then I am trying to include these two programs as two tabbed panes in a third program.
    I try to import classes from the other two programs using a simple import statement. But when I compile it the compiler return an error statement.
    I tried putting a package line in both the programs and tried importing it as a package in the third one and it says invalid package name.
    Can anybody help.
    Thanks in advance.

    OK here is the code. This is a example code from the book Java2 from scratch
    First file
    PortfoilioTotalsPanel.java
    // Import the packages used by this class
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    // PortfolioTotalsPanel Class
    public class PortfolioTotalsPanel extends JPanel
    // Define the dark green color
    public final static Color darkGreen = new Color( 0, 150, 40 );
    // Create our labels
    JLabel lblDollarChange = new JLabel( "Dollar Change:", JLabel.CENTER );
    JLabel lblPercentChange = new JLabel( "Percent Change:", JLabel.CENTER );
    // Constructor
    public PortfolioTotalsPanel()
    // Set the layout manager
    setLayout( new GridLayout( 2, 1 ) );
    // Add the labels to the JPanel
    add( lblDollarChange );
    add( lblPercentChange );
    // setDollarChange( fDollarChange )
    // Set the Dollar Change label to the dollar amount in fDollarChange
    public void setDollarChange( Float fDollarChange )
    // Set color based off of value
    if( fDollarChange.floatValue() > 0 )
    // Green for positive
    lblDollarChange.setForeground( darkGreen );
    else if( fDollarChange.floatValue() < 0 )
    // Red for negative
    lblDollarChange.setForeground( Color.red );
    else
    // Black for no change
    lblDollarChange.setForeground( Color.black );
    // Set the label text
    lblDollarChange.setText( "Dollar Change: $" + fDollarChange.toString() );
    // setPercentChange( fPercentChange )
    // Set the Percent Change label to the percent in fDollarChange
    public void setPercentChange( Float fPercentChange )
    // Set color based off of value
    if( fPercentChange.floatValue() > 0 )
    // Green for positive
    lblPercentChange.setForeground( darkGreen );
    else if( fPercentChange.floatValue() < 0 )
    // Red for negative
    lblPercentChange.setForeground( Color.red );
    else
    // Black for no change
    lblPercentChange.setForeground( Color.black );
    // Set the label text
    lblPercentChange.setText( "Percent Change: " + fPercentChange.toString() + "%" );
    // Main application entry point into this class
    public static void main( String[] args )
    // Create a JFrame object
    JFrame frame = new JFrame( "Portfolio Totals" );
    // Create an PortfolioTotalsPanel Object
    PortfolioTotalsPanel app = new PortfolioTotalsPanel();
    // Set the values of the labels
    app.setDollarChange( new Float( "-150.50" ) );
    app.setPercentChange( new Float( "15" ) );
    // Add our PortfolioTotalsPanel Object to the JFrame
    frame.getContentPane().add( app, BorderLayout.CENTER );
    // Resize our JFrame
    frame.setSize( 600, 100 );
    // Make our JFrame visible
    frame.setVisible( true );
    // Create a window listener to close our application when we
    // close our application
    frame.addWindowListener
         new WindowAdapter()
    public void windowClosing( WindowEvent e )
    System.exit( 0 );
    Second Program
    // ===========================================================================
    // File: StockTablePanel.java
    // Description: Sample file for Java 2 From Scratch
    // ===========================================================================
    // Import the libraries this application will use
    import javax.swing.JTable;
    import javax.swing.table.*;
    import javax.swing.JScrollPane;
    import javax.swing.JFrame;
    import javax.swing.SwingUtilities;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import java.awt.*;
    import java.awt.event.*;
    // Main application class: StockTablePanel
    public class StockTablePanel extends JPanel
    // Create a new Stock Table Model object
    StockTableModel stockTableModel = new StockTableModel();
    // Create a new JTable and associate it with the StockTableModel
    JTable stockTable = new JTable( stockTableModel );
    // Constructor
    public StockTablePanel()
    // Set the size of the table
    stockTable.setPreferredScrollableViewportSize( new Dimension(620, 350) );
    // Set the column widths for the table
    TableColumn column = null;
    for (int i = 0; i < 5; i++)
    column = stockTable.getColumnModel().getColumn( i );
    column.setPreferredWidth( stockTableModel.getColumnWidth( i ) );
    // Create a scroll pane and add the stock table to it
    JScrollPane scrollPane = new JScrollPane( stockTable );
    // Add the scroll pane to our panel
    add( scrollPane, BorderLayout.CENTER );
    // float getDollarChange()
    // Computes the total dollar change for the current portfolio
    public float getDollarChange()
    // Create a variable to hold the total change for all stocks
    float fTotal = 0;
    // Loop through all rows in the table
    for( int i=0; i<stockTable.getRowCount(); i++ )
    // Retrieve the dollar change for this stock
    Float f = ( Float )stockTable.getValueAt( i, 10 );
    // Add that value to our total
    fTotal = fTotal + f.floatValue();
    // Return the total value
    return fTotal;
    // float getPercentChange()
    // Computes the total percentage change for the current portfolio
    public float getPercentChange()
    // Create a couple variables to hold the total the user spent
    // on the stocks and the current value of those stocks
    float fMoneySpent = 0;
    float fMoneyWorth = 0;
    // Loop through all rows in the table
    for( int i=0; i<stockTable.getRowCount(); i++ )
    // Extract some pertinent information for the computations
    Float fLastSale = ( Float )stockTable.getValueAt( i, 2 );
    Float fNumberOfShares = ( Float )stockTable.getValueAt( i, 6 );
    Float fPricePaidPerShare = ( Float )stockTable.getValueAt( i, 7 );
    // Add the amount of money the user spent on this stock
    // to the total spent
    fMoneySpent += fNumberOfShares.floatValue() * fPricePaidPerShare.floatValue();
    // Add the value of this stock to the total value of the
    // stock
    fMoneyWorth += fNumberOfShares.floatValue() * fLastSale.floatValue();
    // Compute the percentage change:
    // TotalValue/TotalSpent * 100% - 100%
    float fPercentChange = ( (fMoneyWorth / fMoneySpent) * 100 ) - 100;
    // Return the percentage change
    return fPercentChange;
    // Main entry point into the StockTableApplication class
    public static void main( String[] args )
    // Create a frame to hold us and set its title
    JFrame frame = new JFrame( "StockTablePanel Application" );
    // Create an instance of our stock table panel
    StockTablePanel stockTablePanel = new StockTablePanel();
    // Add our tab panel to the frame
    frame.getContentPane().add( stockTablePanel, BorderLayout.CENTER );
    // Resize the frame
    frame.setSize(640, 480);
    // Make the windows visible
    frame.setVisible( true );
    // Set up a window listener to close the application window as soon as
    // the application window closes
    frame.addWindowListener
         new WindowAdapter()
    public void windowClosing( WindowEvent e )
    System.exit( 0 );
    // Table Model Class - holds all of our row and column information
    class StockTableModel extends AbstractTableModel
    // Create the columns for the table
    final String[] strArrayColumnNames =
    "Sym",
    "Company Name",
    "Last",
    "Hi",
    "Lo",
    "Vol",
    "#Shares",
    "$Shares",
    "Total",
    "%Change",
    "$Change"
    // Create the rows for the table - hard coded for now!!
    final Object[][] obArrayData =
    // Row One
    "SAMS", // Symbol
    "Sams Publishing", // Company Name
    new Float( 10 ), // Last Sale
    new Float( 12 ), // High
    new Float( 8 ), // Low
    new Double( 2000000 ), // Volume
    new Float( 100 ), // Number of Shares Owned
    new Float( 7.5 ), // Purchase price per share
    new Float( 1000 ), // Total Holdings
    new Float( 33 ), // Percent change (increase!)
    new Float( 250 ) // Dollar change
    // Row Two
    "Good", // Symbol
    "Good Company", // Company Name
    new Float( 50 ), // Last Sale
    new Float( 52 ), // High
    new Float( 45 ), // Low
    new Double( 4000000 ), // Volume
    new Float( 100 ), // Number of Shares Owned
    new Float( 30 ), // Purchase price per share
    new Float( 5000 ), // Total Holdings
    new Float( 33 ), // Percent change (increase!)
    new Float( 250 ) // Dollar change
    // Row Three
    "BAD", // Symbol
    "Bad Company", // Company Name
    new Float( 20 ), // Last Sale
    new Float( 22 ), // High
    new Float( 18 ), // Low
    new Double( 2000000 ), // Volume
    new Float( 500 ), // Number of Shares Owned
    new Float( 50 ), // Purchase price per share
    new Float( 10000 ), // Total Holdings
    new Float( -60 ), // Percent change (increase!)
    new Float( -25000 ) // Dollar change
    // Return the number of columns in the table
    public int getColumnCount()
    return strArrayColumnNames.length;
    // Return the number of rows in the table
    public int getRowCount()
    return obArrayData.length;
    // Get the column name from the strArrayColumnNames array for the "col"-th
    // item
    public String getColumnName( int col )
    return strArrayColumnNames[col];
    // Return the value, in the form of an Object, from the obArrayData object
    // array at position (row, col)
    public Object getValueAt( int row, int col )
         // We will compute columns 8, 9, and 10, so if the column number is
         // below eight, we can just return it without computing or retrieving
         // anything.
         if( col < 8 )
         return obArrayData[row][col];
         // Retrive the necessary values from the object array to compute all
         // of the remaining columns
         Float fLastSale = ( Float )obArrayData[row][2];
         Float fNumberOfShares = ( Float )obArrayData[row][6];
         Float fPurchasePrice = ( Float )obArrayData[row][7];
         switch( col )
         // Total Holdings = Last Sale(2) * Number of Shares Owned(6)
         case 8:
         // Build a new Float object with the product of the two
         Float fTotal = new Float
         // Note, these have to be converted to type "float" to
         // perform the multiplication
         fLastSale.floatValue() * fNumberOfShares.floatValue()
         // Return the result
         return( fTotal );
         // Percent change =
         // (Last Sale Price (2) / Purchase Price (7)) * 100% - 100 %
         case 9:
         Float fPercentChange = new Float
         ((fLastSale.floatValue() / fPurchasePrice.floatValue ()) * 100) - 100
         return fPercentChange;
         // Dollar Change =
         // LastSale*NumberOfShares - PurchasePrice * NumberOfShares
         case 10:
         Float fDollarChange = new Float
         ( fLastSale.floatValue() * fNumberOfShares.floatValue() )
         ( fPurchasePrice.floatValue() * fNumberOfShares.floatValue() )
         return fDollarChange;
         // We have included every case so far, but in case we add another
         // column and forget about it, let's just return its value
         default:
         return obArrayData[row][col];
    // Return the class type, in the form of a Class, for the c-th column in
    // the first (0-th indexed) element of the obArrayData object array
    public Class getColumnClass( int c )
    return getValueAt(0, c).getClass();
    // Return true if the "col"-th column of the table is editable, false
    // otherwise. The following columns are editable:
    // Cell Description
    // 0 Symbol
         // 6 Number of Shares Owned
         // 7 Purchase Price per Share
    public boolean isCellEditable(int row, int col)
         // Check the column number
         if( col == 0 || col == 6 || col == 7 )
         return true;
         else
         return false;
    // Set the value of the (row, col) element of the obArrayData to value
    public void setValueAt(Object value, int row, int col)
         // Symbol
         if( col == 0 )
         // We need a string value - we can convert any
         // value to a string, so just assign it
         obArrayData[row][col] = value;
         // Number of Shares owned
         else if( col == 6 )
         // We need a number - either float or int
         obArrayData[row][col] = new Float( getNumberString( value.toString() ) );
         // Purchase Price per share
         else if( col == 7 )
         // We need a float
         obArrayData[row][col] = new Float( getNumberString( value.toString() ) );
         // Cell is not editable
         else
         return;
         // Notify our parent of the change
         fireTableCellUpdated(row, col);
    // String getNumberString( String str )
    // Read through str and return a new string with the numbers and decimal
    // points contained in str
    public String getNumberString( String str )
    // Get str as a character array
    char[] strSource = str.toCharArray();
    // Create a buffer to copy the results into
    char[] strNumbers = new char[strSource.length];
    int nNumbersIndex = 0;
    // Boolean to ensure we only have one decimal value
    // in our number
    boolean bFoundDecimal = false;
    // Loop through all values of str
    for( int i=0; i<strSource.length; i++ )
    // Check for a digit or decimal point
    if( Character.isDigit( strSource[i] ) )
    strNumbers[nNumbersIndex++] = strSource;
    else if( strSource[i] == '.' && !bFoundDecimal )
    // Append the character to the String
    strNumbers[nNumbersIndex++] = strSource[i];
    // Note that we found the decimal value
    bFoundDecimal = true;
    // Build a new string to return to our caller
    String strReturn = new String( strNumbers, 0, nNumbersIndex );
    // Return our string
    return strReturn;
    // Return the column width of the column at index nCol
    public int getColumnWidth( int nCol )
    switch( nCol )
    case 0:
    case 2:
    case 3:
    case 4:
    case 6:
    case 7:
    case 9:
    return 50;
    case 1:
    return 125;
    default:
    return 75;
    Third one that imports the previous two programs Classes
    // Import the packages used by this class
    import javax.swing.*;
    import javax.swing.event.*;
    import java.awt.*;
    import java.awt.event.*;
    // Import our other components
    import StockTablePanel;
    import PortfolioTotalsPanel;
    // StockTableTabPanel
    public class StockTableTabPanel extends JPanel implements TableModelListener
    // Create our panels
    StockTablePanel stockTablePanel = new StockTablePanel();
    PortfolioTotalsPanel portfolioTotalsPanel = new PortfolioTotalsPanel();
    // Constructor
    public StockTableTabPanel()
    // Set our layout
    setLayout( new BorderLayout() );
    // Initialize the portfolio panel
    updatePortfolioTotals();
    // Add the child panels to our JPanel
    add( stockTablePanel );
    add( portfolioTotalsPanel, BorderLayout.SOUTH );
    // Add our class as a table model listener for the stock table
    // model so that we can update the portfolio totals panel
    // whenever the table changes.
    stockTablePanel.stockTableModel.addTableModelListener( this );
    // TableModelListener: tableChanged
    public void tableChanged(TableModelEvent e)
    // Make sure it is our table that changed
    if( e.getSource() == stockTablePanel.stockTableModel )
    // Call our method to update the portfolio totals
    updatePortfolioTotals();
    // public updatePortfolioTotals
    // Updates the portfolio totals panel labels based off of the values
    // in the stockTablePanel
    public void updatePortfolioTotals()
    // Get the values from the stockTablePanel and send them
    // to the portfolioTotalsPanel
    portfolioTotalsPanel.setDollarChange( new Float( stockTablePanel.getDollarChange() ) );
    portfolioTotalsPanel.setPercentChange( new Float( stockTablePanel.getPercentChange() ) );
    // Main application entry point into this class
    public static void main( String[] args )
    // Create a JFrame object
    JFrame frame = new JFrame( "Stock Table Tab" );
    // Create an StockTableTabPanel Object
    StockTableTabPanel app = new StockTableTabPanel();
    // Add our StockTableTabPanel Object to the JFrame
    frame.getContentPane().add( app, BorderLayout.CENTER );
    // Resize our JFrame
    frame.setSize( 640, 440 );
    // Make our JFrame visible
    frame.setVisible( true );
    // Create a window listener to close our application when we
    // close our application
    frame.addWindowListener
         new WindowAdapter()
    public void windowClosing( WindowEvent e )
    System.exit( 0 );

  • Org.apache.jasper.JasperException Ambigous Class Error

    I included two classes:
    <% @page import = "com.myco.ejb.ThisBean" %>
    <% @page import = "com.myco.ejb.session.ThisBean" %>
    and received an org.apache.jasper.JasperException Ambigous Class Error on the second import. One is a cmp bean, the other is a session bean. I thought Sun wanted us to name our packages like this to aid in the prevention of duplicate class names (i.e., Windoz DLLitus). Shouldn't these classes be unique by the package name?

    No, that's not redundancy. Are you using the fully qualified class name in your jsp:usebean tags?
    like:
    classname="com.mypackage.mybeans.MyBean"
    And are you using the package statement properly in your source?
    In the case that you are using two classes of the same name in one file the compiler has to have a means of distinguishing between the two. The only way for it to do so is to use the fully qualified name of the class in each case in which it is referenced. This means either in the jsp:usebean tag as shown above, or in such a case as:
    com.mypackage.myclasses.MyClass theOb=new com.mypackage.myclasses.MyClass();
    Awkward yes, but ambiguous No.
    In the case where you are using only one class of a given name the import statement will be sufficient for the compiler to know that it is that which you fully qualify in the import statement.
    Remember, all that the import statement does is provide the convenience of pre-clarifying exactly which class you'll be referring to when using the abbreviated class name only. Importing two classes of the same name defeats the purpose.
    Good luck,
    Brad

  • New syntax to import .class Files???

    Using JDK 1.2.2 i coul import my own class files by typing
    import ClassName;
    Using the j2sdk1.4.0 compile I get the Error Message
    `.` expected
    Is there a new synatx for importing .class files???

    Normally I don't help anyone under this username, but since the idiot Kayaman is here being his usual jerk-ness providing no meaningful help whatsoever (as usual), I'll let you in on the fact that 1.4 doesn't let you import un-packaged classes anymore. So just remove the import statement, or change your imported class into some kind of package.

  • PI 711 Installation: Loading of 'SAPNTAB' import package: error but no log

    Hello,
    I'm perfromong an installation of a SAP PI 7.11 ystem on windoows Server 2003 and Oracle 10.2 .
    I've perfromed the installation of the DEV system without particular issue.
    But now when tryning to install the QAS system , I can't finish the installation : Im' stuck in the import ABAP step ...
    It is impossible to import the 'SAPNTAB' package. I couln't find the reason.
    I've tried updating the R3load binary, rebooting the server, restarting the instalaltion from scratch but it didn't help.
    Here I provide you the logs, maybe you can help me
    SAPNTAB.log
    E:\usr\sap\PIQ\SYS\exe\uc\NTAMD64\R3load.exe: START OF LOG: 20110223195542
    E:\usr\sap\PIQ\SYS\exe\uc\NTAMD64\R3load.exe: sccsid @(#) $Id: //bas/711_REL/src/R3ld/R3load/R3ldmain.c#6 $ SAP
    E:\usr\sap\PIQ\SYS\exe\uc\NTAMD64\R3load.exe: version R7.11/V1.4 [UNICODE]
    Compiled Dec 14 2010 22:52:23
    E:\usr\sap\PIQ\SYS\exe\uc\NTAMD64\R3load.exe -i SAPNTAB.cmd -dbcodepage 4103 -l SAPNTAB.log -stop_on_error -loadprocedure fast
    DbSl Trace: ORA-1403 when accessing table SAPUSER
    (DB) INFO: connected to DB
    (DB) INFO: DbSlControl(DBSL_CMD_NLS_CHARACTERSET_GET): UTF8
    (DB) INFO: SVERS deleted/truncated #20110223195543
    sapinst_dev.log
    Syslib info about system call. OS message 109 (The pipe has been ended.
    ) after execution of system call 'ReadFile' with parameter ((read end of child process output pipe)), line (403) in file (synxcpipe.cpp).
    WARNING    2011-02-23 19:56:12.607
               CJSlibModule::writeWarning_impl()
    Execution of the command ""C:\Program Files\sapinst_instdir\NW71\INSTALL\SYSTEM\ORA\STD\AS\sapjvm\sapjvm_5\bin\java.exe" -classpath migmon.jar -showversion -Xmx1024m com.sap.inst.migmon.imp.ImportMonitor -sapinst" finished with return code 103. Output:
    java version "1.5.0_14"
    Java(TM) 2 Runtime Environment, Standard Edition (build 5.1.024)
    SAP Java 64-Bit Server VM (build 5.1.024, Sep  4 2008 23:21:58 - 51_REL - optU - windows amd64 - bas2:106386 (mixed mode))
    Import Monitor jobs: running 1, waiting 28, completed 0, failed 0, total 29.
    Loading of 'SAPNTAB' import package: ERROR
    Import Monitor jobs: running 0, waiting 28, completed 0, failed 1, total 29.
    TRACE      2011-02-23 19:56:12.607
    Function setMessageIdOfExceptionMessage: nw.programError
    ERROR      2011-02-23 19:56:12.607
               CJSlibModule::writeError_impl()
    CJS-30022  Program 'Migration Monitor' exits with error code 103. For details see log file(s) import_monitor.java.log, import_monitor.log.
    import_monitor.log
    TRACE: 2011-02-23 19:55:42 com.sap.inst.migmon.imp.ImportStandardTask preCreate
    Parse of 'C:\Program Files\sapinst_instdir\NW71\INSTALL\SYSTEM\ORA\STD\AS\DDLORA.TPL' template file is started.
    INFO: 2011-02-23 19:55:42 com.sap.inst.migmon.imp.ImportStandardTask preCreate
    Parse of 'C:\Program Files\sapinst_instdir\NW71\INSTALL\SYSTEM\ORA\STD\AS\DDLORA.TPL' template file is successfully completed.
    Primary key creation: after load.
    Index creation: after load.
    INFO: 2011-02-23 19:55:42
    Data codepage 1100 is determined using TOC file 'E:\SAPCD\51036706\DATA_UNITS\EXP1\DATA\REPOSRC.TOC' for package 'REPOSRC'.
    INFO: 2011-02-23 19:55:42
    Version table 'SVERS' is found in STR file 'E:\SAPCD\51036706\DATA_UNITS\EXP3\DATA\SAPNTAB.STR' from package 'SAPNTAB'.
    INFO: 2011-02-23 19:55:42
    Data conversion tables 'DDNTF,DDNTF_CONV_UC,DDNTT,DDNTT_CONV_UC' are found in STR file 'E:\SAPCD\51036706\DATA_UNITS\EXP3\DATA\SAPNTAB.STR' from package 'SAPNTAB'.
    TRACE: 2011-02-23 19:55:42 com.sap.inst.migmon.LoadTask run
    Loading of 'SAPNTAB' import package is started.
    TRACE: 2011-02-23 19:55:42 com.sap.inst.migmon.LoadTask processPackage
    Loading of 'SAPNTAB' import package into database:
    E:\usr\sap\PIQ\SYS\exe\uc\NTAMD64\R3load.exe -i SAPNTAB.cmd -dbcodepage 4103 -l SAPNTAB.log -stop_on_error -loadprocedure fast
    ERROR: 2011-02-23 19:55:45 com.sap.inst.migmon.LoadTask run
    Loading of 'SAPNTAB' import package is interrupted with R3load error.
    Process 'E:\usr\sap\PIQ\SYS\exe\uc\NTAMD64\R3load.exe -i SAPNTAB.cmd -dbcodepage 4103 -l SAPNTAB.log -stop_on_error -loadprocedure fast' exited with return code -1,073,741,819.
    For mode details see 'SAPNTAB.log' file.
    Standard error output:
    sapparam: sapargv(argc, argv) has not been called!
    sapparam(1c): No Profile used.
    sapparam: SAPSYSTEMNAME neither in Profile nor in Commandline
    WARNING: 2011-02-23 19:56:12
    Cannot continue import because not all import packages with data conversion tables are loaded successfully.
    WARNING: 2011-02-23 19:56:12
    1 error(s) during processing of packages.
    INFO: 2011-02-23 19:56:12
    Import Monitor is stopped.
    Edited by: Raoul Shiro on Feb 23, 2011 8:11 PM
    Edited by: Raoul Shiro on Feb 23, 2011 8:12 PM

    Hello,
    Thank you for your answer.
    I already opened a sap cutomer call, they answered that it it not a database issue,
    I restarted the installationfriom scracth , but i still got the same error :
    Here is the full content of the file SAPNTAB.log
    E:\usr\sap\PIQ\SYS\exe\uc\NTAMD64\R3load.exe: START OF LOG: 20110225170643
    E:\usr\sap\PIQ\SYS\exe\uc\NTAMD64\R3load.exe: sccsid @(#) $Id: //bas/711_REL/src/R3ld/R3load/R3ldmain.c#4 $ SAP
    E:\usr\sap\PIQ\SYS\exe\uc\NTAMD64\R3load.exe: version R7.11/V1.4 [UNICODE]
    Compiled Dec 22 2008 00:13:12
    E:\usr\sap\PIQ\SYS\exe\uc\NTAMD64\R3load.exe -ctf I E:\SAPCD\51036706\DATA_UNITS\EXP3\DATA\SAPNTAB.STR C:\Program Files\sapinst_instdir\NW71\INSTALL\SYSTEM\ORA\STD\AS\DDLORA.TPL SAPNTAB.TSK ORA -l SAPNTAB.log
    E:\usr\sap\PIQ\SYS\exe\uc\NTAMD64\R3load.exe: job completed
    E:\usr\sap\PIQ\SYS\exe\uc\NTAMD64\R3load.exe: END OF LOG: 20110225170643
    E:\usr\sap\PIQ\SYS\exe\uc\NTAMD64\R3load.exe: START OF LOG: 20110225170643
    E:\usr\sap\PIQ\SYS\exe\uc\NTAMD64\R3load.exe: sccsid @(#) $Id: //bas/711_REL/src/R3ld/R3load/R3ldmain.c#4 $ SAP
    E:\usr\sap\PIQ\SYS\exe\uc\NTAMD64\R3load.exe: version R7.11/V1.4 [UNICODE]
    Compiled Dec 22 2008 00:13:12
    E:\usr\sap\PIQ\SYS\exe\uc\NTAMD64\R3load.exe -i SAPNTAB.cmd -dbcodepage 4103 -l SAPNTAB.log -stop_on_error -loadprocedure fast
    DbSl Trace: ORA-1403 when accessing table SAPUSER
    (DB) INFO: connected to DB
    (DB) INFO: DbSlControl(DBSL_CMD_NLS_CHARACTERSET_GET): UTF8
    (DB) INFO: SVERS created #20110225170643
    Regards.
    Raoul

Maybe you are looking for

  • Laptop starts randomly(w​ont boot from first time)

    I own HP Pavilion tx1000 for 2 yrs, it was working normal since now. The problem is - laptop starts from second third or more times.  When I switch it on, only led indicators start working and hard drive, but no initial boot and screen blank. Then i

  • BenQ XL2420T 120 HZ / 3D Ready - May I use this with my iMac?

    Hi. My Philips 190B monitor that I have been using with my iMac in Extended Desktop mode recently died so I'm looking for a replacement second monitor. I also own a PS3. Well, actually I own two.  One is sick at the moment. I would like to replace th

  • Urgent: Regarding Join Syntax in Oracle 9i and 10g

    Dear Members Please help me by providing me the synatx of following Join statements for Oracle 9i and 10g: 1.Inner Join 2.Left Outer Join 3.Right Outer Join 4.Self Join 5.Cross Join 6.Full Outer Join N.B. I NEED THIS HELP URGENTLY Regards Praveen Kum

  • Any way to change the Accept-Encoding in apache/jsp?

    I have a jsp page which needs to not be delivered using gzip compression and currently my apache is configured to compress any text content. IS there anyway to diable the gzip encoding through a request, or response command OR an directive at the top

  • Who is Who query

    Hi experts! I have a problem with the query "Who's Who' in ESS. I modified the infoset and added two additional fields. I want those fields to appear in the selection screen and appear ok but when I run the query ignores the values I put in those fie