Output problem in array, code included.

Been hacking away at a starting java class for a few months now, and never had to resort to asking you guys for help.
However, i missed class all week due to work conflicts, so i couldn't question my professor on this problem. Oddly, the actual array bits i'm fine with, but the output has me stalled.
The program is ment to square the numbers 1-10, and then it wants me to output the square and the original number on the same line (It also wanted me to use Math.pow to get the squares, but that gave me a whole slew of syntax errors i couldn't figure out, so i did it the easy way).
I'm not sure how to do this, have tried quite a few things, but i'm fairly certain i'm just missing something obvious, any tips would be helpful.
import javax.swing.*;
public class J6E1 {
   public static void main( String args[] )
      int []  Data = new int [11];
      for (int x=1; x<Data.length; x++)
          Data[x]  =  (x*x);
      for  (int x=1; x<Data.length;x++)
               System.out.println(Data[x] );
      System.exit(0);
}

So for a given x, you have stored x*x value in Data[x].
What about printing both x and Data[x] then?

Similar Messages

  • Need to isolate error with output with valid input (code included)

    Hey guys, this code will be a bit lengthy as I am posting from two separate Java files: Rectangle.java and RectangleTest.java - Basically I am stumped as to why even valid input keeps resulting in this message: System.out.println("\nThis is a SQUARE, not a Rectangle...Quiting...\n"); . Why am I getting this output? I seriously cant figure this out, and really what I am trying to do is take user input for four sets of coordinates, store them, do some simple math with them to determine if the object they form is a Rectangle and not a square. In the long run I am probably doing the whole thing wrong.
    Here is the Rectangle.java code:
    public class Rectangle {
         private int x1,x2,x3,x4,y1,y2,y3,y4;
         private int length;
         private int width;
         public Rectangle ()
              this.x1 = 0;
              this.y1 = 0;
              this.x2 = 0;
              this.y2 = 0;
              this.x3 = 0;
              this.y3 = 0;
              this.x4 = 0;
              this.y4 = 0;
         public Rectangle ( int x1, int x2, int x3, int x4, int y1, int y2, int y3, int y4)
              this.setX1(x1);
              this.setX2(x2);
              this.setX3(x3);
              this.setX4(x4);
              this.setY1(y1);
              this.setY2(y2);
              this.setY3(y3);
              this.setY4(y4);
              // First set x1, y1
              if (x1 > 0 && x1 < 20)
                   setX1(x1);
              else
                   this.x1 = 0;
              if (y1 > 0 && y1 < 20)
                   setY1(y1);
              else
                   this.y1 = 0;
              // Second set x2,y2
              if (x2 > 0 && x2 < 20)
                   setX2(x2);
              else
                   this.x2 = 0;
              if (y2 > 0 && y2 < 20)
                   setY2(y2);
              else
                   this.y2 = 0;
              // Third set x3,y3
              if (x3 > 0 && x3 < 20)
                   setX3(x3);
              else
                   this.x3 = 0;
              if (y3 > 0 && y3 < 20)
                   setY3(y3);
              else
                   this.y3 = 0;
              // Last set x4,y4
              if (x4 > 0 && x4 < 20)
                   setX4(x4);
              else
                   this.x4 = 0;
              if (y4 > 0 && y4 < 20)
                   setY4(y4);
              else
                   this.y4 = 0;
         }// exit constructor
         // Enter methods
         public int getArea()
              return length * width;
         public int getPerimeter()
              return (2*length) + (2*width);
         public boolean isSquare()
              if (length == width)
                    return true;
              else return false;
         public boolean isRectangle()
              if (length != width && length > width)
                    return true;
              else return false;
         // Enter Setters and Getters
         public void setLength(){
              this.length = ((x2-x1)^2 + (y2-y1)^2);
         public int getLength(){
              return length;
         public void setWidth(){
              this.width = ((x4-x1)^2 + (y4-y1)^2);
         public int getWidth(){
              return width;
         public void setX1(int x1) {
              this.x1 = x1;
         public int getX1() {
              return x1;
         public void setX2(int x2) {
              this.x2 = x2;
         public int getX2() {
              return x2;
         public void setX3(int x3) {
              this.x3 = x3;
         public int getX3() {
              return x3;
         public void setX4(int x4) {
              this.x4 = x4;
         public int getX4() {
              return x4;
         public void setY1(int y1) {
              this.y1 = y1;
         public int getY1() {
              return y1;
         public void setY2(int y2) {
              this.y2 = y2;
         public int getY2() {
              return y2;
         public void setY3(int y3) {
              this.y3 = y3;
         public int getY3() {
              return y3;
         public void setY4(int y4) {
              this.y4 = y4;
         public int getY4() {
              return y4;
    Code for RectangleTest.java:
    import java.util.Scanner;
    public class RectangleTest {
         public static void main(String[] args)
              int choice;
              int xFirst, xSecond, xThird, xFourth, yFirst, ySecond, yThird, yFourth;
              Scanner input = new Scanner(System.in);  // Scans or reads the inputs from the keyboard of user
              do {
                   System.out.print("\nTo START Enter '1'; ");
                   System.out.print("\nOr to QUIT Enter '0'; ");
                   choice = input.nextInt();
                   if (choice == 1)
                  // First Set
                  System.out.println("\nPlease enter the FIRST set of Coordinates\n");
                  System.out.print("Enter X1: ");
                  xFirst = input.nextInt();
                  System.out.print("Enter Y1: ");
                  yFirst = input.nextInt();
                  // Second Set
                  System.out.println("\nPlease enter the SECOND set of Coordinates\n");
                  System.out.print("Enter X2: ");
                  xSecond = input.nextInt();
                  System.out.print("Enter Y2: ");
                  ySecond = input.nextInt();
                  // Third Set
                  System.out.println("\nPlease enter the THIRD set of Coordinates\n");
                  System.out.print("Enter X3: ");
                  xThird = input.nextInt();
                  System.out.print("Enter Y3: ");
                  yThird = input.nextInt();
                  // Third Set
                  System.out.println("\nPlease enter the FOURTH set of Coordinates\n");
                  System.out.print("Enter X4: ");
                  xFourth = input.nextInt();
                  System.out.print("Enter Y4: ");
                  yFourth = input.nextInt();
                  // Instantiating the Rectangle class to test it
                  Rectangle rectangle1 = new Rectangle(xFirst, xSecond, xThird, xFourth, yFirst, ySecond, yThird, yFourth);
                  int lengthRectangle1 = rectangle1.getLength();
                  int widthRectangle1 = rectangle1.getWidth();
                  int area = rectangle1.getArea();
                  int periRect = rectangle1.getPerimeter();
                  // Check Shape type
                  if (rectangle1.isRectangle())
                       System.out.println("\nThis is a valid Rectangle\n");
                  else if (rectangle1.isSquare());
                        System.out.println("\nThis is a SQUARE, not a Rectangle...Quiting...\n");
         }while (choice != 0);
         System.out.println("Bye for now!");
    }

    NPP83 wrote:
    Essentially, I am trying to achieve the following:
    1. Store the Cartesian coordinates for the four corners of a Rectangle
    2. Verify that the supplied coordinates (by the user) do infact make a Rectangle and not a Square.
    Since I don't physically have a Length and Width, but just points, I have to use a little math to create a Length and Width and I came up with ((x2-x1)^2 + (y2-y1)^2) to find the length of one side. I thought I would store this as the way to set the Length/Width (setLength & setWidth), but I havent been able to find a way to bridge the user's input in the main() method of the test program to use the values in this formula. Even then, I am not sure if this simple step would at all help validate the object created by the four sets of points is a Rectangle. I thought that a Rectangle might be created by simply by deductive math where if the Length > Width or Length < Width and Width != Length then I would have a what I was looking for.One side is (X2 - X1) the next side is (Y3 - Y2) the 3rd and 4th sides are: (X4 - X3) and (Y4 - Y1).
    Edited by: morgalr on Mar 29, 2010 3:40 PM -- the following comment added:
    You should check out getBounds, it may be what you are looking for.

  • JTable listener problem,  plz. help  code included

    hi,
    I need help in this JTable. If you run the following code you'll see when you double click in any cell scrollbars will appear if the text is too large for the JTextArea. What I want is when any cell is selected and if the text is too large to fit in the JTextArea I want the scrollbars to appear then. And if I double click in any cell I want some other action to take place. Here is the example code that I got from net and I am trying to play arround with this code. Please run the following code and see what I mean:
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import java.util.*;
    import javax.swing.table.*;
    import javax.swing.border.*;
    public class MyMultiRowTableTest extends JFrame
    public MyMultiRowTableTest()
    addWindowListener(new WindowAdapter()
    public void windowClosing(WindowEvent we)
    System.exit(0);
    getContentPane().setLayout(new BorderLayout());
    getContentPane().add(initComponents(), BorderLayout.CENTER);
    protected Container initComponents()
    JPanel mainPanel = new JPanel(new BorderLayout());
    Vector vRows = new Vector();
    Vector vColumns = new Vector();
    vColumns.add("Column1");
    vColumns.add("Column2");
    for (int i=0; i<20; i++)
    Vector vRow = new Vector(2);
    vRow.add(""+(i+1)+". abcdefghijklmnopqrstuvwxyzabcdefghijk" +
    "lmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmno" +
    "pqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstu" +
    "wxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdef" +
    "ghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrs"+
    "tuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghi" +
    "jklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz"+
    "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrs"+
    "tuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz");
    vRow.add("asldfjasldfjal�dfjal�jdfal");
    vRows.add(vRow);
    JTable myTable = new JTable(vRows, vColumns);
    for (int i=0; i<myTable.getColumnCount(); i++)
    TableColumn tc = myTable.getColumn(myTable.getColumnName(i));
    if (tc!=null)
    tc.setCellRenderer(new MultiLineCellRenderer());
    tc.setCellEditor(new MultiLineCellEditor());
    myTable.setRowHeight(80);
    mainPanel.add(new JScrollPane(myTable));
    return mainPanel;
    public static void main(String[] args)
    JFrame frame = new MyMultiRowTableTest();
    frame.setSize(800,600);
    frame.setLocation(200,200);
    frame.setVisible(true);
    }//end of the class MyMultiRowTableTest
    class MultiLineCellEditor extends DefaultCellEditor
    protected JTextArea myEditingComponent;
    public MultiLineCellEditor()
    super(new JTextField());
    myEditingComponent = new JTextArea();
    myEditingComponent.setLineWrap(true);
    myEditingComponent.setWrapStyleWord(true);
    myEditingComponent.setOpaque(true);
    myEditingComponent.addKeyListener(new KeyAdapter()
    public void keyPressed(KeyEvent ke)
    if ((ke.getKeyCode()==ke.VK_ENTER) && (ke.getModifiers() == ke.CTRL_MASK))
    stopCellEditing();
    public Object getCellEditorValue()
    return myEditingComponent.getText();
    public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected,
    int row, int column)
    Component result = super.getTableCellEditorComponent(table,
    value, isSelected, row, column);
    myEditingComponent.setFont(table.getFont());
    myEditingComponent.setText(""+value);
    if (value instanceof String)
    result = new JScrollPane(myEditingComponent);
    return result ;
    }//end of the class MultiLineCellEditor
    class MultiLineCellRenderer extends JTextArea implements TableCellRenderer
    protected final static Border emptyBorder = BorderFactory.createEmptyBorder(1,2,1,2);
    protected final static Border focusBorder = UIManager.getBorder("Table.focusCellHighlightBorder");
    public MultiLineCellRenderer()
    setLineWrap(true);
    setWrapStyleWord(true);
    setOpaque(true);
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected,
    boolean hasFocus, int row, int column)
    if (isSelected)
    setForeground(table.getSelectionForeground());
    setBackground(table.getSelectionBackground());
    else
    setForeground(table.getForeground());
    setBackground(table.getBackground());
    setFont(table.getFont());
    if (hasFocus)
    setBorder(focusBorder);
    if (table.isCellEditable(row, column))
    setForeground( UIManager.getColor("Table.focusCellForeground") );
    setBackground( UIManager.getColor("Table.focusCellBackground") );
    else
    setBorder(emptyBorder);
    if(value==null)
    myEditingComponent.setText("");
    return new JScrollPane
    (myEditingComponent);
    setText((value == null) ? "" : value.toString());
    return this;
    }//end of the class MultiLineCellRenderer
    If you see when you double click in the first column the scrollbars will appear as the text is too large. But what I need is that when the cell is selected the scrollbars should appear and when I doubleclick in the cell I want some other action to take place. Please help I really don't understand how this cellrenderer and celleditor works. Any help is really appreciated. And thank you in advance.

    hi friend
    i tried to solve your problem , but i couldn't clear myself with program logic u used. but your problem can be solved by trying with the following lines.you need to explore the right place in your logic.
    int v=ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS;
    int h=ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS;
    if (value instanceof String)
    result = new JScrollPane(myEditingComponent,v,h);
    return result ;
    in the meanwhile i will try with your code as soon i will get time.
    reply me back if it solves the problem
    bye

  • J Option Pane Output Problem

    Hi guys,
    I am new to Java and I am having trouble compiling this program via which I can calculate the number of months to pay off a loan.
    I am not sure why it is not compiling and would really appreciate some solutions or suggestions
    Thanks a lot.
    import javax.swing.JOptionPane;
    public class Final
    public static void main(String[] args)
    String LoanAmount;
    String Months;
    String AnnualInterestRate;
    String MonthlyPayments;
    double balance;               
    double interest;
    double payment;
    int months=1;
    LoanAmount=JOptionPane.showInputDialog("Enter Loan Amount:");
    AnnualInterestRate=JOptionPane.showInputDialog("Enter Interest Rate:");
    MonthlyPayments=JOptionPane.showInputDialog("Monthly Payments:");
    balance=Double.parseDouble(LoanAmount);
    interest=Double.parseDouble(AnnualInterestRate);
    payment=Double.parseDouble(MonthlyPayments);
    months=Integer.parseInt(Months);
    while (balance>0)
    {balance=(balance+(interest/12)*(balance))-payment;
    months=months+1;
    JOptionPane.showMessageDialog(null, "Number of Months ", +months);
    Edited by: Java1001 on Sep 15, 2009 11:45 PM

A: J Option Pane Output Problem

Use code tags to post codes -- [code]CODE[/code] will display asCODEOr click the CODE button and paste your code between the {code} tags that appear.
You are passing 3 parameters -- a null, a String and an int -- to the JOptionPane#showMessageDialog method. In the [_API_|http://java.sun.com/javase/6/docs/api/javax/swing/JOptionPane.html], do you find a variant of this method that accepts these three parameters?
db

Use code tags to post codes -- [code]CODE[/code] will display asCODEOr click the CODE button and paste your code between the {code} tags that appear.
You are passing 3 parameters -- a null, a String and an int -- to the JOptionPane#showMessageDialog method. In the [_API_|http://java.sun.com/javase/6/docs/api/javax/swing/JOptionPane.html], do you find a variant of this method that accepts these three parameters?
db

  • How to output last 4 arrays from a For Loop?

    Hi People,
    I am almost at the end of my tether. I really hope someone could please help me.
    Any input would be welcome. VI attached.
    VI explanation:
    I initialize an array.
    The random number generator simulates my camera input.
    Depending on which iteration it is, the data is added into one of four output arrays.
    'x-y*floor(x/y)' gives a remainder value of 0, 1, 2 or 3.
    'Case Selector' just adds 1 to 'x-y*floor(x/y)' to get case 1, 2, 3 or 4.
    Shots 1, 5, 9 etc are added to Array 1 (Case 1).
    Shots 2, 6, 10 etc are added to Array 2 (Case 2).
    Shots 3, 7, 11 etc are added to Array 3 (Case 3).
    Shots 4, 8, 12 etc are added to Array 4 (Case 4).
    Averaged Output displays the averaged value i.e. the total value divided by the number of shots saved in that array ('Set (IQ+1)').
    My problems are:
    1) I would like to output only the last 4 sets of data from the Averaged Output 1, 2, 3 and 4 to 4 different files (i.e. save as .csv what is displayed onscreen in indicators 'Averaged Output 1', 2, 3 and 4 at the end of all iterations.
    Where should I place my file save diagram disable so that it does this?
    Putting it outside the main For Loop with auto-indexing on gives me one file with all previous data. (This is not feasible as my number of shots should number in the thousands)
    Putting it outside the main For Loop with auto-indexing off gives me only the last set of data. (I need the output for 4 Arrays, not just the last run)
    Putting it inside the main For Loop (as shown) gives me the same number of files as number of iterations. (Again not feasible due to large number of files that will be generated and slow camera capture)
    For the sake of fast camera capture, I would like these 4 files to only output once all the image captures are complete.
    2) Would preferably like to name the file once and for the programme to append '(1)', '(2)', '(3)' and '(4)' to filename of the appropriate 'Averaged Output' Arrays but file path controls are another big headache for me.
    3) P.s. is initializing one array enough to avoid using Memory Manager? Or should I initialize 4 arrays?
    I am using Labview 2010.
    Thanks so much,
    Jaslyn
    Solved!
    Go to Solution.
    Attachments:
    Help Understanding Arrays and file paths (10).vi ‏26 KB

    Thanks so much Lennard!!
    Hi JKSH,
    I've been busy trying to complete the dang code, but for completeness so that other users can learn too, I shall answer your queries. Thanks for looking in.
    First, what do you mean by "add"? Your code in your case strcuture sums your input values, so your array size doesn't change. However, you also said "Putting it outside the main For Loop with auto-indexing on gives me one file with all previous data. (This is not feasible as my number of shots should number in the thousands)" -- it sounds like you are expecting an array with thousands of elements. So, what should "Output Array N" look like?
    Ans: Output Array N should be a 4x4 array of the summation of all the numbers generated during every 4th iteration.
    i.e. if random number 1=1, random number 2=2, etc, And 'No of iterations' is 12,
    Output Array 1 should be 1+5+9:
    15 15 15 15
    15 15 15 15
    15 15 15 15
    15 15 15 15
    (Note: Most of your arrays are 4x4, but in Case #2 you created 128x128. I prersume this is a typo?)
    Ans: Kind of, I'm using a 4x4 array of randomly generated numbers as an example but my actual data will be the 128x128 pixel output of a camera. And during actual experimentation, 'No of Iterations' will number in the thousands.
    Second, why do you add your "simulated camera input" to the "Initialized Array"? You can add it direcly to the previous output inside your case structure.
    Ans: See answer to question 3
    Third, have a look at shift registers: http://www.ni.com/gettingstarted/labviewbasics/shiftregisters.htm. Use them instead of Feedback Nodes to make your code tidier.
    Ans: I did try.. But I can't seem to add shift registers to the case structure, only the for loops outside. Are you sure it can be done..?
    jaslyn wrote:
    1) I would like to output only the last 4 sets of data from the Averaged Output 1, 2, 3 and 4 to 4 different files (i.e. save as .csv what is displayed onscreen in indicators 'Averaged Output 1', 2, 3 and 4 at the end of all iterations.
    Where should I place my file save diagram disable so that it does this?
    For the sake of fast camera capture, I would like these 4 files to only output once all the image captures are complete.
    You will need to call "Write to Text File.vi" 4 times to write 4 files. So, you should finish your loop, then call this VI 4 times.
    Ans: How do I get it to extract the data from each of the 4 cases in my case structure?
    jaslyn wrote:
    2) Would preferably like to name the file once and for the programme to append '(1)', '(2)', '(3)' and '(4)' to filename of the appropriate 'Averaged Output' Arrays but file path controls are another big headache for me.
    You can create strings first, then convert them into paths: http://zone.ni.com/reference/en-XX/help/371361G-01/glang/string_to_path/
    Thanks
    jaslyn wrote:
    3) P.s. is initializing one array enough to avoid using Memory Manager? Or should I initialize 4 arrays?
    I'm not sure what you're asking; can you please clarify what you mean by "avoid using Memory Manager"? But anyway, you've actually initialized FIVE arrays: 1 outside the loop, and 1 inside each case.
    I've read that to avoid fluctuations in memory usage, it is a good idea to initialize arrays to their expected size before the start of data collection. That was just what I was trying to do.

  • Macbook mini DVI to DVI output problems

    hi
    I've been using a samsung syncmaster 22" with my macbook for about a year now with no problems using the mini DVI to DVI connection
    then earlier this week i used a different DVI cable to plug my playstation 3 into the screen, when i plugged the computer DVI cable back into the screen lots of red/pink pixels have taken over the screen and when the desk is nudged red lines flash up
    i thought it might be either the DVI cable or the mini DVI to DVI adapter and replaced both to no avail, i have also tested all the cables on other screens/with other computers, and tested the screen with my playstation. Screen and cables all work fine so i think it must be some kind of output problem, but cant work out what it could be seeing as nothing would have happened to the port on the actual computer whilst changing connections on the samsung screen
    sorry for the long winded post, really wanna know what the problem is here

    Hi cbeth,
    welcome to macbook forum.
    For your friend macbook, try to press F7 back and forth to switch between mirror and expanded mode.
    Try to update your macbook hardware firmware and software using software updater and repair permission after that...application/utilities/disk utility/repair permission.
    Also reset your PRAM and PMU.
    Open your friend system preference / display and try to compare and set yours similar to hers, including resolution, color depth, refresh rate.
    Good Luck.

  • Test.jsp not able to display the output from the java code.

    when i try to invoke http://localhost/papz/test.jsp
    I dont see anything. The page is blank. And there are no error messages in any log files. When i click on view source in IE i get to see the entire source code, including the jave code.
    <html>
    <head>
    <title>Test</title>
    <body>
    <%
    out.println("Hello World");
    %>
    asdfasdfasdf
    </body>
    </html>
    i added in the asdfasdf to see whehter it will be printed or not... It does print that stuff out.
    when i try to invoke the login.jsp page, i get the dialog box "save this file to disk"
    Any clues whats going on...?
    I followed the instructions...over and over again... but it doesnt seem to help.
    win nt 4.0
    apache 1.3.12
    jserv 1.1.1
    Pls help. Thanks

    Hi,
    Have you solved your problem?
    I4m trying to do the same, but I installed portal 30, then portal to go, and when I try to run test.jsp I get the following error:
    Request URI:/papz/test.jsp
    Exception:
    java.lang.NoSuchMethodError: oracle.jsp.util.JspUtil: method
    stripTarget(Ljava/lang/String;C)Ljava/lang/String; not found
    Thanks
    Pablo Lopera
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by NewBie:
    when i try to invoke http://localhost/papz/test.jsp
    I dont see anything. The page is blank. And there are no error messages in any log files. When i click on view source in IE i get to see the entire source code, including the jave code.
    <html>
    <head>
    <title>Test</title>
    <body>
    <%
    out.println("Hello World");
    %>
    asdfasdfasdf
    </body>
    </html>
    i added in the asdfasdf to see whehter it will be printed or not... It does print that stuff out.
    when i try to invoke the login.jsp page, i get the dialog box "save this file to disk"
    Any clues whats going on...?
    I followed the instructions...over and over again... but it doesnt seem to help.
    win nt 4.0
    apache 1.3.12
    jserv 1.1.1
    Pls help. Thanks<HR></BLOCKQUOTE>
    null

  • Problem in Server side includes using Tomcat

    Problem in Server side includes using Tomcat:
    I am trying out small programs in servlet.
    I get one example program for server side includes from net.
    The code is:
    <HTML>
    <HEAD><TITLE>Times!</TITLE></HEAD>
    <BODY>
    <P>
    The current time in London is!!! :
    <SERVLET CODE="CurrentTime" codebase="../servlet">
    <PARAM NAME="zone" VALUE="GMT">
    </SERVLET>
    </P>
    </BODY>
    </HTML>
    I placed this test.shtml file in tomcat-home/webapps/ROOT folder and i kept the servlet in WEB-INF/classes folder.
    I renamed the servlets-ssi.jar and i removed the comments for SSI in web.xml file.
    When i run the servlet separately, i am getting the correct result. But if i run shtml file with the URL : http://localhost:8080/Test.shtml,
    i am getting the result as:
    The current time in London is!!! :
    It is not invoking servlet program.
    CAN ANYONE HELP ON THIS!
    Thanks.

    Thanks...as u said I tried putting dir & found that
    my file was saved as Ch1Servlet.java.txt instead for
    Ch1Servlet.java......So that was a problem.Now I'm
    able to compile.Oh, yeah. Notepad will do that to you. I think when you save in Notepad if you put quotes around the name "Whatever.java" then it won't add the .txt.
    But on compiling I'm getting the following error
    package java.servlet.* does not exist
    package java.servlet.http.* does not exist
    package java.io.* does not exist
    Do u the reason for this??? The servlet stuff is java[b]x.servlet. For the io stuff, I don't know, I'd have to see your code. Either you have a typo or a corrupt installation.

  • Output of piped array only showing one result

    I thought what I was doing was pretty simple, but I am a bit stumped on what is happening here. First, I have an XML document I am importing. Here is a sample of the XML
    <Sites>
    <Site Url="http://sharepoint/personal/joe" />
    <Site Url="http://sharepoint/personal/mary" />
    <Site Url="http://sharepoint/personal/nick" />
    <Site Url="http://sharepoint/personal/walter" />
    </Sites>
    The output I want to achieve through PowerShell is just a list of the user names: joe, mary, nick, and walter
    Here is my PowerShell
    [xml]$MySites = Get-Content C:\Sites.xml
    $MySites.Sites.Site | Select Url | Out-String | % { $_.Substring($_.LastIndexOf("/")+1)}
    This code only outputs 'walter'. If I remove the last part of the pipe and just run this
    [xml]$MySites = Get-Content C:\Sites.xml
    $MySites.Sites.Site | Select Url | Out-String
    then the output is everything as expected, but as the full URL. I have also tried changing the code a bit to this
    [xml]$MySites = Get-Content "C:\Sites.xml"
    $Users = $MySites.Sites.Site | Select Url | Out-String
    foreach ($user in $Users) {
    $user.Substring($user.LastIndexOf("/")+1)
    But this still just gives me 'walter'.
    Any ideas why a substring would change the output of an array like this?

    You aren't creating an array. You are giving the variable a string. Pipe $Users to Get-Member to see that it is a string.
    Here is an alternate way to do what you want
    Split-Path (([xml](Get-Content "C:\Sites.xml")).Sites.Site.Url) -Leaf

  • Problem with php code. Please help!

    Hello!
    I'm using the following syntax to bring content into my
    websites' layout template:
    Code:
    <?php //check in the root folder first
    if(file_exists('./' . $pagename . '.php'))
    include './' . $pagename . '.php';
    //if it wasn't found in the root folder then check in the
    news folder
    elseif(file_exisits('./news/' . $filename . '.php'))
    include './news/' . $pagename . '.php';
    // if it couldn't be found display message
    else
    echo $pagename . '.php could not be found in either the root
    folder or the news folder!';
    } ?>
    What it's essentially saying is, if you can't find the .php
    file in the _root folder, look for it in the /news/ folder.
    It works perfectly if loading something from the _root folder
    but I get an error if I need to bring something from the /news/
    folder.
    Can anyone see any potential problems with my code?
    Thank you very much and I hope to hear from you.
    Take care,
    Mark

    I've never seen the code written like that before, but I'm
    assuming it's
    legal?
    Perhaps try:
    <?php
    $newsroot = $_SERVER['DOCUMENT_ROOT']."/news";
    if (!file_exists("$pagename.php")) {
    elseif (!file_exists("$newsroot/$pagename.php")) {
    else
    Or the other thing you can try is replacing the elseif
    statement with:
    elseif (!file_exists("news/$pagename.php"))
    If not - I'm sure Gary will be on here soon...
    Shane H
    [email protected]
    http://www.avenuedesigners.com
    =============================================
    Proud GAWDS Member
    http://www.gawds.org/showmember.php?memberid=1495
    Delivering accessible websites to all ...
    =============================================
    "Spindrift" <[email protected]> wrote in
    message
    news:e5mled$272$[email protected]..
    > Hello!
    >
    > I'm using the following syntax to bring content into my
    websites' layout
    > template:
    >
    > Code:
    >
    > <?php //check in the root folder first
    > if(file_exists('./' . $pagename . '.php'))
    > {
    > include './' . $pagename . '.php';
    > }
    > //if it wasn't found in the root folder then check in
    the news folder
    > elseif(file_exisits('./news/' . $filename . '.php'))
    > {
    > include './news/' . $pagename . '.php';
    > }
    > // if it couldn't be found display message
    > else
    > {
    > echo $pagename . '.php could not be found in either the
    root folder or
    > the
    > news folder!';
    > } ?>
    >
    > What it's essentially saying is, if you can't find the
    .php file in the
    > _root
    > folder, look for it in the /news/ folder.
    >
    > It works perfectly if loading something from the _root
    folder but I get an
    > error if I need to bring something from the /news/
    folder.
    >
    > Can anyone see any potential problems with my code?
    >
    > Thank you very much and I hope to hear from you.
    >
    > Take care,
    >
    > Mark
    >

  • Problems with symlinks and include directives

    Any files that are included with an include directive from a file that is
              contained in a directory that is reached via a soft link do not work
              (resource not found error) if the link begins with "../".
              directory structure is like this:
              docroot/protected/symlinked_dir/subdir1a/subdir2a
              docroot/protected/symlinked_dir/subdir1b/subdir2b
              if a file in subdir2a tries to include a file in subdir2b then the resource
              is not found.
              however if I copy the symlinked directory over then it works.
              to avoid touching the symlink during the include I changed the structure to:
              docroot/protected/symlinked_dir/dummydir/subdir1a/subdir2a
              docroot/protected/symlinked_dir/dummydir/subdir1b/subdir2b
              The same problem remained. However includes in the same directory and in
              child directories work just fine.
              Is this a known bug in Weblogic or a misconfiguration of the treatment of
              symlinks?
              Thanks,
              Chris Eppstein
              

    Hi, Thanks for looking at the code.
    By messing up I mean the CSS seems to break down a bit.  The navigation moves down, the sidebar moves down and across to the right and the whole page moves across to the right side of the browser and the log in form on the top of the page breaks up and there are gaps on the page where they shouldn't be.
    It only does it in Explorer.
    Thanks again for you help.
    Ben.

  • Problems with JSF and included subviews

    Hi everybody,
    I' ve got a problem with JSF and included subviews which makes me going
    crazy. I've got no clue why my web-pages are represent wrongly. The only
    tip I've got is that it must be connected with the kind I do include my JSF-pages.
    When I use <%@file="sub.jsp"%> my pages are are represent right. When I use <jsp:include page="Sub.jsp" /> or <c:import url="Sub.jsp" /> ( mark: the usage of flush="true" or flush="false" doesn't matter )
    my pages are represent wrongly.
    The usage of tags like f:facet or f:verbatim were also included but didn't point to an solution.
    I searched the whole Sun Developer Forum and some other web-sites for any solution for my problem but the given hints and clues didn't help. Now I'm trying to post my problem directly in Sun's Forum in hope to get help.
    My environment is the following:
    JAVA JDK 1.5 Update 4
    Tomcat 5.5.9
    JSLT 1.1
    Sun JSF 1.1
    Win 2K
    Here's my code:
    Main.jsp
    <%@ page language="java"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <%
              String path = request.getContextPath();
              String basePath = request.getScheme() + "://" + request.getServerName()
                        + ":" + request.getServerPort() + path + "/";
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
         <base href="<%=basePath%>">
         <meta http-equiv="pragma" content="no-cache">
         <meta http-equiv="cache-control" content="no-cache">
         <meta http-equiv="expires" content="0">   
         <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
         <meta http-equiv="description" content="This is my page">
         <link rel="stylesheet" href="stil.jsp" type="text/css" />
    </head>
    <body>
         <f:view>
              <h:form>
                   <div class="table">
                        <div class="tr">
                             <h:outputText styleClass="tdleft" value="value 1"/>
                             <h:outputText styleClass="tdinfo" value="value 2"/>
                        </div>
                        <div class="tr">
                             <h:outputText styleClass="tdleft" value="value 3"/>
                             <h:outputText styleClass="tdinfo" value="value 4"/>
                        </div>
                   </div>
              </h:form>     
              <jsp:include page="Sub.jsp" />
         </f:view>
    </body>
    </html>Sub.jsp
    <%@ page language="java"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
    <f:subview id="subview">
         <h:form>
              <div class="table">
                   <div class="tr">
                             <h:outputText styleClass="tdleft" value="value 11"/>
                             <h:outputText styleClass="tdinfo" value="value 22"/>
                   </div>
                   <div class="tr">
                        <h:outputText styleClass="tdleft" value="value 33"/>
                        <h:outputText styleClass="tdinfo" value="value 44"/>
                   </div>
              </div>
         </h:form>
    </f:subview>stil.jsp
    <%@page contentType="text/css"%>
    <%
        String  schwarz     = "#000000",
                grau1       = "#707070",
                grau2       = "#c0c0c0",
                grau3       = "#e0e0e0",
                grau4       = "#e8e8e8",
                grau5       = "#fdfdfd",
                blau        = "#0000dd",
                tuerkis     = "#00cfff";
        String  liniendicke = "1px",
                linienart   = "solid";
        String allgemeineTextFarbe           = schwarz;
        String allgemeineHintergrundFarbe    = grau3;
        String infoTextFarbe                 = blau;
        String fieldsetRandFarbe             = blau;
        String fieldsetRandDicke             = liniendicke;
        String fieldsetRandArt               = linienart;
        String hrLinienFarbe                 = blau;
        String hrLinienDicke                 = liniendicke;
        String hrLinienArt                   = linienart;
        String inputAktivHintergrundFarbe    = grau5;
        String inputReadonlyHintergrundFarbe = grau4;
        String inputPassivHintergrundFarbe   = grau4;
        String inputPassivFarbe              = schwarz;
        String inputRandFarbe1               = grau1;
        String inputRandFarbe2               = grau5;
        String inputRandDicke                = liniendicke;
        String inputRandArt                  = linienart;
        String inputButtonHintergrundFarbe   = grau3;
        String legendenFarbe                 = blau;
        String linkFarbe                     = blau;
        String linkAktivFarbe                = tuerkis;
        String linkBesuchtFarbe              = blau;
        String linkFocusFarbe                = tuerkis;
        String objectGitterFarbe             = grau5;
        String objectGitterDicke             = liniendicke;
        String objectGitterArt               = linienart;
        String tabellenGitterFarbe           = grau5;
        String tabellenGitterDicke           = liniendicke;
        String tabellenGitterArt             = linienart;
    %>
    <%-- ----------------------------------------------- --%>
    <%-- Textdarstellung mittels der Display-Eigenschaft --%>
    <%-- in den Tags div und span                        --%>
    <%-- ----------------------------------------------- --%>
    *.table {
        display:table;
        border-collapse:collapse;
    *.tbody {
        display:table-row-group;
    *.tr {
        display:table-row;
    *.td,*.tdright,*.tdleft,*.tdinfo,*.th {
        display:table-cell;
        padding:3px;
        vertical-align:middle;
    *.td,*.th {
        text-align:center;
    *.tdright {
        text-align:right;
    *.tdleft {
        text-align:left;
    *.tdinfo {
        color:<%=infoTextFarbe%>;
        text-align:right;
    *.th {
        color:<%=infoTextFarbe%>;
        font-weight:bold;
    }thanks in advance
    benjamin

    Hello Zhong Li,
    many thanks for your post, but it didn't work.
    My problem is that the JSF-Components im my included or imported
    JSP-Pages does not accept any kind of style or styleClass for
    designing. The components take over the informations for colors
    but not for alignment.
    When I take a look at the generated JAVA-Source in $TOMCAT/WORK/WEBAPP for my sub.jsp ( sub.java )
    it seems that the resulting HTML-page would be presented correctly.
    But later when I start the application via Firefox or Mozilla the html-sourcecode is totally wrong.
    In my example I create a simple grid with 2 rows and 2 columns.
    Both columns contains JSF-Outtext-Components and are included with div-tags.
    The generated Sub.java shows that the text would be setted in the div-tags. Unfortunately the html-sourcecode represented by my browser shows that jsf-text is not setted in the tags but in the <h:form> tags. The div-tags are neither rounded by <h:form> nor containing the JSF-OutText-Components.
    Any clue?
    Many thanks Benjamin
    Here is the html-code from Firefox:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
         <base href="http://polaris21:8080/webtest/">
         <meta http-equiv="pragma" content="no-cache">
         <meta http-equiv="cache-control" content="no-cache">
         <meta http-equiv="expires" content="0">   
         <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
         <meta http-equiv="description" content="This is my page">
         <link rel="stylesheet" href="stil.jsp" type="text/css" />
    </head>
    <body>
         <form id="_id0" method="post" action="/webtest/Main.faces" enctype="application/x-www-form-urlencoded">
              <div class="table">
                   <div class="tr">
                        <span class="tdleft">value 1</span>
                        <span class="tdinfo">value 2</span>
                   </div>
                   <div class="tr">
                        <span class="tdleft">value 3</span>
                        <span class="tdinfo">value 4</span>
                   </div>
              </div>
              <input type="hidden" name="_id0" value="_id0" />
         </form>     
          <form id="SUB:_id5" method="post" action="/webtest/Main.faces" enctype="application/x-www-form-urlencoded">
               <span class="tdleft">value 11</span>
              <span class="tdinfo">value 22</span>
              <span class="tdleft">value 33</span>
              <span class="tdinfo">value 44</span>
              <input type="hidden" name="SUB:_id5" value="SUB:_id5" />
         </form>
         <div class="table">
              <div class="tr">
              </div>
              <div class="tr">
              </div>
         </div>
    </body>
    </html>

  • Problem creating array... help!!!

    Hi everyone, Im currently trying to do a project and I am a little suck. Could anyone please help?
    I have two classes. The first class is Ticket, which is an int array of 6, the other class is called TicketArray, which is an array of objetcs tickets. The ints stored on the tickets are read from an ASCII file on TicketArray class, and send samehow to the ticket object, which is later store on the TicketArray. I've got this far:
    public class Ticket
       private int token;
       public void main(String args[], int theToken)
       int num[];
       num = new int[5];
       token = theToken;
       }and the next class is
    import java.io.*;
    import java.util.*;
    public class TicketArray;
      static BufferedReader fileInput;
        public static void main(String args[]) throws IOException  //exception there in case the file cannot be found.
            String first;
            StringTokenizer tokenizer;
            int num1, index=0; int theToken;
            String [] t = new String[30];
            fileInput = new BufferedReader(new FileReader("Lotto.dat"));
            first = fileInput.readLine();
            tokenizer = new StringTokenizer(first);
            int numberOfTokens = tokenizer.countTokens();
            while (first!= null)
                int t[] = new t[5]
                int a = new Ticket(int t[], num);  //// PROBLEM HERE
                while (tokenizer.hasMoreTokens())
                    for (index = 0; index< s.length; index++)
                    theToken = Integer.parseInt(tokenizer.nextToken());
                    s[index] = theToken;
                    System.out.println(t[i] + " " + numberOfTokens);
                t[index] = new String(first);
                index++;
                first = fileInput.readLine();
            fileInput.close();
            System.out.println("File read and closed");

    and then i saw you do this
    t[index] = new String(first);
    t is an int array, so you are trying to assign a string to an int, which also wont work.
    Edited by: mkoryak on Nov 16, 2007 2:33 PM
    also you say this:
    int num[];
    num = new int[5];
    this initializes an int array of 5 and then throws it away as soon as the constructor main method returns. i dont think you want that. you should the declairation up top where the int token is.
    ok, so you dont have a constructor for the ticket class that matches the one you are trying to use.
    i think you may need to go back to the examples, you have more problems in this code then there is lines of code.
    Edited by: mkoryak on Nov 16, 2007 2:34 PM

  • Topic code includes unexpected changes after editing

    I am using RH8 and converting FrameMaker files to WebHelp (I am linking to the FrameMaker book). If I use RoboHelp to edit a topic, either through the HTML view or the Design view, the HTML code includes changes that I did not explicitly make. For example, the initial generated code had <li style="list-style: decimal;">, but if I make any type of edit to the file, this changes to <li type="1">. This is a problem because Internet Explorer does display the numbers unless I use the Compatibility View setting. Why is this happening?
    I did find that when I directly edit a topic in NotePad, the results are what I want, but it would be nice to use the Design view toolbar to make the final adjustments I need.

    Just offering possibilities.  Just because there are two symbols in the library doesn't mean you have them separately planted on the stage.  One could be planted inside the other.  And their visual proximity to each other wouldn't matter in any case.
    When you are editing the circle and can clearly see the dquare, are you able to select the square?

  • A big problem in JSF1.1dynamic include

    hi, i have a problem about JSF dynamic include as follow:
    i use Eclipse3.2.1 JSF1.1.3 and TomCat5.5
    I use a bean call "Control" to save the path which i gonna include. I have a selectItem in the first page, when user select the selectitem, valueChangeListener try to Listener what the user choose and link to different page. i put my link in a subview like follow
    <jsp:useBean id="con" scope="session" class="sources.bean.Control" />
    <h:form>
    <f:subview id="footer">
    <table align="center" border="2" bgcolor="yellowgreen">
    <c:import url="${con.link}"/>
    </table>
    </f:subview>
    </h:form>
    I know when i use subview, i should use <f:verbatim> </f:verbatim> to close all non JSF tag. i do it as well, but when i try to use <h:inputText> tag. it show me a SelectBooleanCheckBox and didn't get any error message. why?? i really can't understand.
    I try to use a form tag to close the inputText in the include pages, it show me some errors message as below:
    ���d�I: Servlet.service() for servlet jsp threw exception
    java.lang.IllegalArgumentException: Expected submitted value of type Boolean for Component : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /new.jsp][Class: javax.faces.component.html.HtmlForm,Id: _idJsp0][Class: javax.faces.component.UINamingContainer,Id: footer][Class: javax.faces.component.html.HtmlSelectBooleanCheckbox,Id: _idJsp12]}
         at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getBooleanValue(RendererUtils.java:151)
         at org.apache.myfaces.shared_impl.renderkit.html.HtmlCheckboxRendererBase.encodeEnd(HtmlCheckboxRendererBase.java:60)
         at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
         at javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java:495)
         at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:363)
         at org.apache.myfaces.shared_impl.taglib.UIComponentBodyTagBase.doEndTag(UIComponentBodyTagBase.java:54)
         at org.apache.jsp.pages.lic.LIC3320_jsp._jspx_meth_f_verbatim_3(LIC3320_jsp.java:358)
         at org.apache.jsp.pages.lic.LIC3320_jsp._jspService(LIC3320_jsp.java:97)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
         at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
         at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
         at org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireString(ImportSupport.java:296)
         at org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTag(ImportSupport.java:161)
         at org.apache.jsp.new_jsp._jspx_meth_c_import_0(new_jsp.java:311)
         at org.apache.jsp.new_jsp._jspx_meth_f_subview_0(new_jsp.java:285)
         at org.apache.jsp.new_jsp._jspx_meth_h_form_0(new_jsp.java:191)
         at org.apache.jsp.new_jsp._jspx_meth_f_view_0(new_jsp.java:146)
         at org.apache.jsp.new_jsp._jspService(new_jsp.java:110)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
         at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)
         at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
         at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
         at org.apache.myfaces.webapp.MyFacesServlet.service(MyFacesServlet.java:74)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    2007/7/30 ���� 12:05:22 org.apache.catalina.core.ApplicationDispatcher invoke
    ���d�I: Servlet.service() for servlet jsp threw exception
    java.lang.IllegalArgumentException: Expected submitted value of type Boolean for Component : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /new.jsp][Class: javax.faces.component.html.HtmlForm,Id: _idJsp0][Class: javax.faces.component.UINamingContainer,Id: footer][Class: javax.faces.component.html.HtmlSelectBooleanCheckbox,Id: _idJsp12]}
         at org.apache.myfaces.shared_impl.renderkit.RendererUtils.getBooleanValue(RendererUtils.java:151)
         at org.apache.myfaces.shared_impl.renderkit.html.HtmlCheckboxRendererBase.encodeEnd(HtmlCheckboxRendererBase.java:60)
         at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:536)
         at javax.faces.webapp.UIComponentTag.encodeEnd(UIComponentTag.java:495)
         at javax.faces.webapp.UIComponentTag.doEndTag(UIComponentTag.java:363)
         at org.apache.myfaces.shared_impl.taglib.UIComponentBodyTagBase.doEndTag(UIComponentBodyTagBase.java:54)
         at org.apache.jsp.pages.lic.LIC3320_jsp._jspx_meth_f_verbatim_3(LIC3320_jsp.java:358)
         at org.apache.jsp.pages.lic.LIC3320_jsp._jspService(LIC3320_jsp.java:97)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
         at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:574)
         at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
         at org.apache.taglibs.standard.tag.common.core.ImportSupport.acquireString(ImportSupport.java:296)
         at org.apache.taglibs.standard.tag.common.core.ImportSupport.doEndTag(ImportSupport.java:161)
         at org.apache.jsp.new_jsp._jspx_meth_c_import_0(new_jsp.java:311)
         at org.apache.jsp.new_jsp._jspx_meth_f_subview_0(new_jsp.java:285)
         at org.apache.jsp.new_jsp._jspx_meth_h_form_0(new_jsp.java:191)
         at org.apache.jsp.new_jsp._jspx_meth_f_view_0(new_jsp.java:146)
         at org.apache.jsp.new_jsp._jspService(new_jsp.java:110)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
         at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)
         at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
         at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
         at org.apache.myfaces.webapp.MyFacesServlet.service(MyFacesServlet.java:74)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    2007/7/30 ���� 12:05:22 org.apache.catalina.core.StandardWrapperValve invoke
    ���d�I: Servlet.service() for servlet faces threw exception
    javax.faces.FacesException: javax.servlet.jsp.JspException: Expected submitted value of type Boolean for Component : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /new.jsp][Class: javax.faces.component.html.HtmlForm,Id: _idJsp0][Class: javax.faces.component.UINamingContainer,Id: footer][Class: javax.faces.component.html.HtmlSelectBooleanCheckbox,Id: _idJsp12]}
         at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:435)
         at org.apache.myfaces.application.jsp.JspViewHandlerImpl.renderView(JspViewHandlerImpl.java:234)
         at org.apache.myfaces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:384)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:138)
         at org.apache.myfaces.webapp.MyFacesServlet.service(MyFacesServlet.java:74)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
         at java.lang.Thread.run(Unknown Source)
    Caused by: javax.servlet.ServletException: javax.servlet.jsp.JspException: Expected submitted value of type Boolean for Component : {Component-Path : [Class: javax.faces.component.UIViewRoot,ViewId: /new.jsp][Class: javax.faces.component.html.HtmlForm,Id: _idJsp0][Class: javax.faces.component.UINamingContainer,Id: footer][Class: javax.faces.component.html.HtmlSelectBooleanCheckbox,Id: _idJsp12]}
         at org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:839)
         at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:776)
         at org.apache.jsp.new_jsp._jspService(new_jsp.java:120)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:334)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
         at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:301)
         at org.apache.myfaces.context.servlet.ServletExternalContextImpl.dispatch(ServletExternalContextImpl.java:416)
         ... 18 more
    I'm just a beginner, if anything that is unclear please tell me.
    thank for help
    emmy
    Message was edited by:
    emmy.ma

    The cause is rather self-explaining?Caused by: javax.servlet.ServletException: javax.servlet.jsp.JspException: Expected submitted value of type Boolean for Component :
        Component-Path :
        [Class: javax.faces.component.UIViewRoot,ViewId: /new.jsp]
        [Class: javax.faces.component.html.HtmlForm,Id: _idJsp0]
        [Class: javax.faces.component.UINamingContainer,Id: footer]
        [Class: javax.faces.component.html.HtmlSelectBooleanCheckbox,Id: _idJsp12]
    }The HtmlSelectBooleanCheckbox in the 'footer' expects a Boolean value. Otherwise you need to supply a Converter to convert between the object type used and the Boolean type.

  • Maybe you are looking for

    • How can i sync some cool photos to my apple TV? as well as my other devices...

      Hi, i had some animal photos that i added to photo stream and at the buttom of the folder it says "shared by me"... i want to see those photos on my apple tv, there is also a folder in photo stream named "my photo stream". i can only see "MY PHOTO ST

    • How can I delete photos from photo library on my Iphone 4s?

      Hello, Can someone please tell me (in easy step by step instructions) how to delete photos from my Photo Library on my Iphone 4s? I have moved some of the photos that i want ot keep in to sub folders by trip names etc but want to delete them from the

    • TDS  Number

      hello  guru,       when posting through the FB60  vendor invoice  . i mgetting following problem Could not determine the year for TDS certificate number range Message no. 8I017 Diagnosis The excise year could not be determined for generating the numb

    • Adding Button to titlebar

      I just want to ask that is there any way to add button on the title bar, with those three buttons on a right, i.e, Close, Maximize, Minimize. Is there any way for it?

    • OAM/OIM 11.1.1.3 audit question

      All, We are collecting login information in the IAU_BASE table. Most of the time IAU_INITIATOR value is null. Does anyone have an idea why this is the case? Is there a setup that we are missing in OAM configuration? thanks in advance, Prasad.