Absolute paths (win and linux)

hy
is there a solution to write absolute paths independent of operating system?
I mean e.g. in windows instead of y:\\folder\file.name maybe y//folder/file.name?
the methods in class File only give me \\ (fileSeparator) and ; (pathSeparator)
(using java 1.4)
big thx
cheers

Absolute paths, by their very nature, are platform-specific, so, no. For instance, what's the platform-independent way of referring to D:\ ? There isn't one, because not all platforms, and indeed not all installations of any platform, have a D: drive. The path " y//folder/file.name" makes no sense
java.io.File.listRoots() returns an array of File objects representing the root volumes for your machine. For instance, it might return C:\, D:\, E:\ on your Windows box. That might be of some use to you. Or better yet, avoid absolute paths altogether, if you can.

Similar Messages

  • IndexOf - difference between Win and Linux encoding

    Hello folks, wondering if someone could put me on the right track over this little problem with porting a java app to Linux...
    I have a nice little program, developed on (the latest) JDK under windows which reads a custom file format, locates the second occurance of the substring 'PNG', ignores everything before the character before this PNG (hence the -1 below) and saves the remainder, which is now a bog-standard PNG image. The first 'PNG substring always occurs within the first 50 bytes (hence the 50 below) and the second around the 2kB mark. Here's the line that finds the location of the second 'PNG' in the file loaded into strFileContent:
    location = strFileContent.indexOf( "PNG", 50 )-1;All is well compiled and run on windows, say file 'test1.xyz' produces a value for location of 2076 and saves a nice PNG called 'test1.png'.
    When I haul it over to Linux (Ubuntu 9.04) and lo, location comes out as 1964 for the same file, and of course the file is no-longer a PNG because there are an extra 112 bytes on the front end. Running the windows compile of the code or a fresh Linux compile makes no difference.
    I'm suspecting Win and Linux Java count, perhaps, line endings or some such differently, perhaps have to check an encoding. I'd appreciate any pointers on correcting this to work on both platforms (ultimately I'm trying to appease a Mac user, but don't have a Mac to play with at the moment).
    Cheers,
    K.
    Ken

    phaethon2008 wrote:
    I'm suspecting Win and Linux Java count, perhaps, line endings or some such differently, perhaps have to check an encoding. I'd appreciate any pointers on correcting this to work on both platforms (ultimately I'm trying to appease a Mac user, but don't have a Mac to play with at the moment).The immediate cause of your problem is probably that Windows uses a 8bit encoding as the default (probably some ISO-8859-{noformat}*{noformat} variant or the Windows-bastardization of it), while Ubuntu uses UTF-8, which has a varying number of bytes per character.
    The much more important underlying problem is that you're trying to treat binary data as if it were text. A PNG image is not text. Handling binary data in Strings (or char[]) is a sure way to invite desaster.
    You must convert your code to handle InputStream/OutputStream/byte[] instead of Reader/Writer/String/char[].

  • Fonts in java apps for win and linux

    Hi everyone.
    i need to build an application mult-plataform, to run in windows and linux...
    but i don�t know waht font i must use...the default font that java takes doesn�t exist in linux (dialog)...
    waht font should i use in my app??
    thanx

    For going multi-platform it is easiest to stick to the logical fonts: Fonts named "Serif", "SansSerif", "Monospaced", "Dialog", and "DialogInput".
    These fonts are guaranteed to exist on any platform, although their implementations may be different. If you use others then you'll have to figure out how to deal with cross platform issues.
    Jeff

  • 2 Queries for OCCI on WIN and Linux platform

    Hi,
    I got 2 questions on using OCCI.
    1. [Linux] Is it possible to compile OCCI programs on Linux if I am using gcc 3.2?
    2. [WIN XP] Recently, I installed the oracle client 10g with OCCI libs installed. I linked my program with ..\oci\lib\msvc\vc6\oraocci10.lib and copied the oraocci10.dll to my project folder so it will be used during execution. I am using VC6++(sp6). I managed to compile without any error. However, my program crashed with a call to createConnection() method. Can anyone help?
    Could I be using the wrong DLL? How to check which dll I am using? The program is planned to run on Instant Client on other machines.

    Hi,
    thks for the reply.
    no, i only have vc++ 6 installed.
    i even tried to create a seperate folder with just the program and all the required dlls.
    However, I found a 'sqlnet.log' file in the vc project folder. Why is it using BEQ protocol when it should be TCP? Is the dll using any registry entries instead of running in instant client mode?
    Fatal NI connect error 12560, connecting to:
    (DESCRIPTION=(ADDRESS=(PROTOCOL=BEQ)(PROGRAM=oracle)(ARGV0=oracleORCL)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))'))(CONNECT_DATA=(SID=ORCL)(CID=(PROGRAM=H:\vcproj\trial\desc\Debug\desc.exe)(HOST=xFtfdjkw3)(USER=peter))))
    VERSION INFORMATION:
         TNS for 32-bit Windows: Version 10.1.0.2.0 - Production
         Oracle Bequeath NT Protocol Adapter for 32-bit Windows: Version 10.1.0.2.0 - Production
    Time: 27-APR-2004 13:59:54
    Tracing not turned on.
    Tns error struct:
    ns main err code: 12560
    TNS-12560: TNS:protocol adapter error
    ns secondary err code: 0
    nt main err code: 530
    TNS-00530: Protocol adapter error
    nt secondary err code: 126
    nt OS err code: 0

  • Graphics bug on Win and Linux ?

    Hi all,I have a graphic problem. I have created a JFrame and I have added him a JPanel (1) that it has as Layout a BorderLayout. To this JPanel (1) I have added another JPanel (2) that it has as Layout a GridLayout and a JLabel that I have used as StatusBar.
    The problem is that when a window overlaps to the JPanel (1), the JPanel (2) is visualized to the initial state in which it had been created.After click on it returns to the actual state.
    I post you an image to make to understand better me.
    http://img176.imageshack.us/my.php?image=screenji3.gif
    Someone know how i can resolve this problem?
    Ps: sorry for my bad English.
    Message was edited by:
    JinKazama
    I have forgotten to say that use Java5

    package it.unibo.cs.CSameGame;
    import javax.swing.JFrame;
    import java.awt.Dimension;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.KeyEvent;
    import javax.swing.ButtonGroup;
    import javax.swing.Icon;
    import javax.swing.ImageIcon;
    import javax.swing.JFileChooser;
    import javax.swing.JMenu;
    import javax.swing.JMenuItem;
    import javax.swing.JMenuBar;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JLabel;
    import javax.swing.JRadioButtonMenuItem;
    import javax.swing.JTextField;
    import javax.swing.JComboBox;
    import javax.swing.JButton;
    import javax.swing.KeyStroke;
    import javax.swing.UIManager;
    import java.awt.BorderLayout;
    import java.awt.GridBagLayout;
    import java.awt.GridBagConstraints;
    import java.awt.GridLayout;
    import java.awt.Insets;
    import java.io.IOException;
    import java.net.URL;
    import java.security.NoSuchAlgorithmException;
    import java.util.ArrayList;
    import javax.swing.JCheckBox;
    import java.awt.Toolkit;
    * @author Paolino Carmine
    * @author Statuto Riccardo
    public class Swingui {
    private JFrame FinestraPrincipale = null; // @jve:decl-index=0:visual-constraint="576,53"
    private JMenuBar BarraMenu = null;
    private JMenu Gioco = null;
    private JMenuItem NuovoGioco = null;
    private JMenu Impostazioni = null;
    private JMenu Aiuto = null;
    private JMenuItem About = null;
    private JMenuItem Help = null;
    private JMenuItem Esci = null;
    private JMenuItem CaricaMappa = null;
    private JMenuItem SalvaMappa = null;
    private JMenuItem Settings = null;
    private JFrame Preferenze = null; // @jve:decl-index=0:visual-constraint="10,10"
    private JLabel L_lbl = null;
    private JTextField L_txt = null;
    private JLabel H_lbl = null;
    private JTextField H_txt = null;
    private JLabel N_lbl = null;
    private JTextField N_txt = null;
    private JLabel Stile_lbl = null;
    private JComboBox Stile_cbox = null;
    private JButton Salva_btn = null;
    private static Game game; // @jve:decl-index=0:
    private int l;
    private int h;
    private int n;
    private int style;
    private JPanel PrefContentPane = null;
    private JPanel ContentPanePrincipale = null;
    private JLabel StatusBarLabel = null;
    private URL imageURL;
    private ImageIcon image;
    private JLabel piece;
    private JLabel Player_lbl = null;
    private JTextField Player_txt = null;
    private String player;
    private JMenu MenuTemi = null;
    private JRadioButtonMenuItem Standard = null;
    private JRadioButtonMenuItem Futurama = null;
    private String tema = "base";
    private JCheckBox NewGameAfterWinCB = null;
    private JRadioButtonMenuItem KillBill = null;
    private JPanel MainPanel = null;
    private GridLayout LayoutGriglia;
    private ArrayList<String> listaTipi = new ArrayList<String>();
    private boolean flag;
    * This method initializes FinestraPrincipale
    * @return javax.swing.JFrame
    private JFrame getFinestraPrincipale() {
         if (FinestraPrincipale == null) {
         try {
              FinestraPrincipale = new JFrame();
              FinestraPrincipale.setSize(new Dimension(374, 294)); // Generated
              FinestraPrincipale.setTitle("CSameGame"); // Generated
              FinestraPrincipale.setResizable(false);
              FinestraPrincipale
                   .setIconImage(Toolkit
                        .getDefaultToolkit()
                        .getImage(
                             getClass()
                                  .getResource(
                                       "/it/unibo/cs/CSameGame/icons/face-surprise.png")));
              FinestraPrincipale.setJMenuBar(getBarraMenu()); // Generated
              FinestraPrincipale.setContentPane(getMainPanel()); // Generated
              FinestraPrincipale
                   .setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return FinestraPrincipale;
    * This method initializes BarraMenu
    * @return javax.swing.JMenuBar
    private JMenuBar getBarraMenu() {
         if (BarraMenu == null) {
         try {
              BarraMenu = new JMenuBar();
              BarraMenu.add(getGioco()); // Generated
              BarraMenu.add(getImpostazioni()); // Generated
              BarraMenu.add(getAiuto()); // Generated
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return BarraMenu;
    * This method initializes Gioco
    * @return javax.swing.JMenu
    private JMenu getGioco() {
         if (Gioco == null) {
         try {
              Gioco = new JMenu();
              Gioco.setText("Gioco"); // Generated
              Gioco.setMnemonic(KeyEvent.VK_G);
              Gioco.add(getNuovoGioco()); // Generated
              Gioco.addSeparator();
              Gioco.add(getCaricaMappa()); // Generated
              Gioco.add(getSalvaMappa()); // Generated
              Gioco.addSeparator();
              Gioco.add(getEsci()); // Generated
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return Gioco;
    * This method initializes NuovoGioco
    * @return javax.swing.JMenuItem
    private JMenuItem getNuovoGioco() {
         if (NuovoGioco == null) {
         try {
              URL iconURL = getClass().getResource("icons/new.png");
              Icon icon = new ImageIcon(iconURL);
              NuovoGioco = new JMenuItem("Nuovo gioco", icon);
              NuovoGioco.setMnemonic(KeyEvent.VK_N);
              NuovoGioco.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N,
                   ActionEvent.CTRL_MASK));
              NuovoGioco.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                   flag=true;
                   newGame();
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return NuovoGioco;
    * This method initializes Impostazioni
    * @return javax.swing.JMenu
    private JMenu getImpostazioni() {
         if (Impostazioni == null) {
         try {
              Impostazioni = new JMenu();
              Impostazioni.setText("Impostazioni"); // Generated
              Impostazioni.setMnemonic(KeyEvent.VK_I);
              Impostazioni.add(getSettings()); // Generated
              Impostazioni.add(getMenuTemi());
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return Impostazioni;
    * This method initializes Aiuto
    * @return javax.swing.JMenu
    private JMenu getAiuto() {
         if (Aiuto == null) {
         try {
              Aiuto = new JMenu();
              Aiuto.setText("Aiuto"); // Generated
              Aiuto.setMnemonic(KeyEvent.VK_A);
              Aiuto.add(getAbout()); // Generated
              Aiuto.add(getHelp()); // Generated
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return Aiuto;
    * This method initializes About
    * @return javax.swing.JMenuItem
    private JMenuItem getAbout() {
         if (About == null) {
         try {
              About = new JMenuItem();
              About.setText("Informazioni su..."); // Generated
              About.setMnemonic(KeyEvent.VK_I);
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return About;
    * This method initializes Help
    * @return javax.swing.JMenuItem
    private JMenuItem getHelp() {
         if (Help == null) {
         try {
              URL iconURL = getClass().getResource("icons/help.png");
              Icon icon = new ImageIcon(iconURL);
              Help = new JMenuItem("Aiuto CSameGame", icon);
              Help.setMnemonic(KeyEvent.VK_A);
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return Help;
    * This method initializes Esci
    * @return javax.swing.JMenuItem
    private JMenuItem getEsci() {
         if (Esci == null) {
         try {
              URL iconURL = getClass().getResource("icons/exit.png");
              Icon icon = new ImageIcon(iconURL);
              Esci = new JMenuItem("Esci", icon);
              Esci.setMnemonic(KeyEvent.VK_E);
              Esci.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q,
                   ActionEvent.CTRL_MASK));
              Esci.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                   System.exit(0);
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return Esci;
    * This method initializes CaricaMappa
    * @return javax.swing.JMenuItem
    private JMenuItem getCaricaMappa() {
         if (CaricaMappa == null) {
         try {
              URL iconURL = getClass().getResource("icons/open.png");
              Icon icon = new ImageIcon(iconURL);
              CaricaMappa = new JMenuItem("Carica partita...", icon);
              CaricaMappa.setMnemonic(KeyEvent.VK_C);
              CaricaMappa.setAccelerator(KeyStroke.getKeyStroke(
                   KeyEvent.VK_L, ActionEvent.CTRL_MASK));
              CaricaMappa.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                   JFileChooser fc = new JFileChooser();
                   Filtro txtFiltro = new Filtro();
                   fc.setFileFilter(txtFiltro);
                   fc.addChoosableFileFilter(txtFiltro);
                   int scelta = fc.showOpenDialog(CaricaMappa);
                   try {
                   style = Stile_cbox.getSelectedIndex();
                   player = Player_txt.getText();
                   } catch (NullPointerException exception) {
                   player = "Anonimo";
                   if (scelta == JFileChooser.APPROVE_OPTION) {
                   try {
                        game = new Game(fc.getSelectedFile().getPath(),
                             style);
                        game.setPlayerName(player);
                        game.setPlayerScore();
                        StatusBarLabel.setText("Punteggio attuale: "
                             + game.getPlayerScore());
                        printSurface();
                        SalvaMappa.setEnabled(true);
                   } catch (IOException exception) {
                        exception.printStackTrace();
                   } catch (StringIndexOutOfBoundsException exception) {
                        JOptionPane.showMessageDialog(null,
                             "Il file della mappa � corrotto",
                             "Aiaiai...", JOptionPane.ERROR_MESSAGE);
                   } catch (NoSuchAlgorithmException exception) {
                        JOptionPane.showMessageDialog(null, exception
                             .toString().split(": ")[1],
                             "Aiaiai...", JOptionPane.ERROR_MESSAGE);
                   } catch (SecurityException exception) {
                        JOptionPane.showMessageDialog(null, exception
                             .toString().split(": ")[1],
                             "Aiaiai...", JOptionPane.ERROR_MESSAGE);
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return CaricaMappa;
    * This method initializes SalvaMappa
    * @return javax.swing.JMenuItem
    private JMenuItem getSalvaMappa() {
         if (SalvaMappa == null) {
         try {
              URL iconURL = getClass().getResource("icons/save.png");
              Icon icon = new ImageIcon(iconURL);
              SalvaMappa = new JMenuItem("Salva partita...", icon);
              SalvaMappa.setMnemonic(KeyEvent.VK_S);
              SalvaMappa.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,
                   ActionEvent.CTRL_MASK));
              SalvaMappa.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                   JFileChooser fc = new JFileChooser();
                   Filtro txtFiltro = new Filtro();
                   fc.setFileFilter(txtFiltro);
                   fc.addChoosableFileFilter(txtFiltro);
                   int scelta = fc.showSaveDialog(SalvaMappa);
                   SurfaceParser map = new SurfaceParser("");
                   if (scelta == JFileChooser.APPROVE_OPTION) {
                   try {
                        map.saveMap(fc.getSelectedFile().getPath(),
                             game.getSurface(), game.getH(), game
                                  .getL(), game.getPlayerScore(),
                             style);
                   } catch (IOException exception) {
                        exception.printStackTrace();
                   } catch (NoSuchAlgorithmException exception) {
                        JOptionPane.showMessageDialog(null, exception
                             .toString().split(": ")[1],
                             "Aiaiai...", JOptionPane.ERROR_MESSAGE);
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return SalvaMappa;
    * This method initializes Settings
    * @return javax.swing.JMenuItem
    private JMenuItem getSettings() {
         if (Settings == null) {
         try {
              URL iconURL = getClass().getResource("icons/preferences.png");
              Icon icon = new ImageIcon(iconURL);
              Settings = new JMenuItem("Preferenze", icon);
              Settings.setMnemonic(KeyEvent.VK_P);
              Settings.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P,
                   ActionEvent.CTRL_MASK));
              Settings.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                   JFrame Preferenze = getPreferenze();
                   Preferenze.setVisible(true);
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return Settings;
    * This method initializes jTable
    * @return javax.swing.JTable
    * This method initializes Preferenze
    * @return javax.swing.JFrame
    private JFrame getPreferenze() {
         if (Preferenze == null) {
         Preferenze = new JFrame("Preferenze");
         Preferenze.setSize(new Dimension(530, 250));
         Preferenze.setResizable(false); // Generated
         Preferenze.setContentPane(getJContentPane()); // Generated
         return Preferenze;
    * This method initializes L_txt
    * @return javax.swing.JTextField
    private JTextField getL_txt() {
         if (L_txt == null) {
         L_txt = new JTextField("15");
         return L_txt;
    * This method initializes H_txt
    * @return javax.swing.JTextField
    private JTextField getH_txt() {
         if (H_txt == null) {
         H_txt = new JTextField("10");
         return H_txt;
    * This method initializes N_txt
    * @return javax.swing.JTextField
    private JTextField getN_txt() {
         if (N_txt == null) {
         N_txt = new JTextField("3");
         return N_txt;
    * This method initializes Stile_cbox
    * @return javax.swing.JComboBox
    private JComboBox getStile_cbox() {
         if (Stile_cbox == null) {
         String[] style = { "Standard", "Continous", "Megashift", "Shifter" };
         Stile_cbox = new JComboBox(style);
         return Stile_cbox;
    * This method initializes Salva_btn
    * @return javax.swing.JButton
    private JButton getSalva_btn() {
         if (Salva_btn == null) {
         Salva_btn = new JButton();
         Salva_btn.setText("Salva");
         Salva_btn.addActionListener(new ActionListener() {
              private Game fakegame;
              public void actionPerformed(ActionEvent e) {
              Preferenze.setVisible(false);
              try {
                   l = Integer.parseInt(L_txt.getText());
                   h = Integer.parseInt(H_txt.getText());
                   n = Integer.parseInt(N_txt.getText());
                   style = Stile_cbox.getSelectedIndex();
                   player = Player_txt.getText();
                   fakegame = new Game(l, h, n, style);
                   fakegame.setPlayerName(player);
              } catch (Exception expt) {
                   JOptionPane.showMessageDialog(null, expt.toString()
                        .split(": ")[1], "Aiaiai...",
                        JOptionPane.ERROR_MESSAGE);
                   getPreferenze();
                   Preferenze.setVisible(true);
         return Salva_btn;
    * This method initializes jContentPane
    * @return javax.swing.JPanel
    private JPanel getJContentPane() {
         if (PrefContentPane == null) {
         try {
              GridBagConstraints gridBagConstraints32 = new GridBagConstraints();
              gridBagConstraints32.gridx = 0;
              gridBagConstraints32.gridy = 5;
              Player_lbl = new JLabel();
              Player_lbl.setText("Nome giocatore");
              Stile_lbl = new JLabel();
              Stile_lbl.setText("Stile di gioco");
              N_lbl = new JLabel();
              N_lbl.setText("Numero di tipi di pedine");
              H_lbl = new JLabel();
              H_lbl.setText("Altezza griglia");
              L_lbl = new JLabel();
              L_lbl.setText("Larghezza griglia");
              GridBagConstraints gridBagConstraints41 = new GridBagConstraints();
              gridBagConstraints41.insets = new Insets(35, 10, 2, 10);
              gridBagConstraints41.fill = GridBagConstraints.NONE;
              gridBagConstraints41.gridy = 0;
              gridBagConstraints41.weightx = 1.0;
              gridBagConstraints41.anchor = GridBagConstraints.SOUTH;
              gridBagConstraints41.gridx = 1;
              gridBagConstraints41.ipadx = 90;
              GridBagConstraints gridBagConstraints31 = new GridBagConstraints();
              gridBagConstraints31.insets = new Insets(5, 10, 5, 10);
              gridBagConstraints31.gridx = 0;
              gridBagConstraints31.fill = GridBagConstraints.HORIZONTAL;
              gridBagConstraints31.anchor = GridBagConstraints.SOUTHWEST;
              gridBagConstraints31.gridy = 0;
              GridBagConstraints gridBagConstraints6 = new GridBagConstraints();
              gridBagConstraints6.fill = GridBagConstraints.VERTICAL; // Generated
              gridBagConstraints6.gridx = 1; // Generated
              gridBagConstraints6.gridy = 4; // Generated
              gridBagConstraints6.weightx = 1.0; // Generated
              GridBagConstraints gridBagConstraints5 = new GridBagConstraints();
              gridBagConstraints5.gridx = 1; // Generated
              gridBagConstraints5.anchor = GridBagConstraints.EAST; // Generated
              gridBagConstraints5.ipadx = 0; // Generated
              gridBagConstraints5.insets = new Insets(15, 0, 35, 20); // Generated
              gridBagConstraints5.fill = GridBagConstraints.NONE; // Generated
              gridBagConstraints5.gridy = 7; // Generated
              GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
              gridBagConstraints4.gridx = 0; // Generated
              gridBagConstraints4.anchor = GridBagConstraints.WEST; // Generated
              gridBagConstraints4.insets = new Insets(5, 10, 5, 10); // Generated
              gridBagConstraints4.fill = GridBagConstraints.HORIZONTAL; // Generated
              gridBagConstraints4.gridy = 4; // Generated
              GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
              gridBagConstraints3.fill = GridBagConstraints.NONE; // Generated
              gridBagConstraints3.gridy = 3; // Generated
              gridBagConstraints3.weightx = 1.0; // Generated
              gridBagConstraints3.insets = new Insets(2, 10, 2, 10); // Generated
              gridBagConstraints3.ipadx = 90; // Generated
              gridBagConstraints3.anchor = GridBagConstraints.CENTER; // Generated
              gridBagConstraints3.gridx = 1; // Generated
              GridBagConstraints gridBagConstraints21 = new GridBagConstraints();
              gridBagConstraints21.gridx = 0; // Generated
              gridBagConstraints21.anchor = GridBagConstraints.WEST; // Generated
              gridBagConstraints21.insets = new Insets(5, 10, 5, 10); // Generated
              gridBagConstraints21.fill = GridBagConstraints.BOTH; // Generated
              gridBagConstraints21.gridy = 3; // Generated
              GridBagConstraints gridBagConstraints11 = new GridBagConstraints();
              gridBagConstraints11.fill = GridBagConstraints.NONE; // Generated
              gridBagConstraints11.gridy = 2; // Generated
              gridBagConstraints11.weightx = 1.0; // Generated
              gridBagConstraints11.insets = new Insets(2, 10, 2, 10); // Generated
              gridBagConstraints11.ipadx = 90; // Generated
              gridBagConstraints11.anchor = GridBagConstraints.CENTER; // Generated
              gridBagConstraints11.gridx = 1; // Generated
              GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
              gridBagConstraints2.gridx = 0; // Generated
              gridBagConstraints2.insets = new Insets(5, 10, 5, 10); // Generated
              gridBagConstraints2.fill = GridBagConstraints.BOTH; // Generated
              gridBagConstraints2.gridy = 2; // Generated
              GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
              gridBagConstraints1.fill = GridBagConstraints.NONE; // Generated
              gridBagConstraints1.gridy = 1; // Generated
              gridBagConstraints1.weightx = 1.0; // Generated
              gridBagConstraints1.gridheight = 1; // Generated
              gridBagConstraints1.insets = new Insets(2, 10, 2, 10); // Generated
              gridBagConstraints1.ipadx = 90; // Generated
              gridBagConstraints1.anchor = GridBagConstraints.SOUTH; // Generated
              gridBagConstraints1.gridx = 1; // Generated
              GridBagConstraints gridBagConstraints = new GridBagConstraints();
              gridBagConstraints.gridx = 0; // Generated
              gridBagConstraints.anchor = GridBagConstraints.SOUTH; // Generated
              gridBagConstraints.gridheight = 1; // Generated
              gridBagConstraints.ipadx = 0; // Generated
              gridBagConstraints.insets = new Insets(0, 10, 5, 10); // Generated
              gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; // Generated
              gridBagConstraints.ipady = 0; // Generated
              gridBagConstraints.gridwidth = 1; // Generated
              gridBagConstraints.gridy = 1; // Generated
              PrefContentPane = new JPanel();
              PrefContentPane.setLayout(new GridBagLayout()); // Generated
              PrefContentPane.add(L_lbl, gridBagConstraints);
              PrefContentPane.add(getL_txt(), gridBagConstraints1);
              PrefContentPane.add(H_lbl, gridBagConstraints2);
              PrefContentPane.add(getH_txt(), gridBagConstraints11);
              PrefContentPane.add(N_lbl, gridBagConstraints21);
              PrefContentPane.add(getN_txt(), gridBagConstraints3);
              PrefContentPane.add(Stile_lbl, gridBagConstraints4);
              PrefContentPane.add(getSalva_btn(), gridBagConstraints5);
              PrefContentPane.add(getStile_cbox(), gridBagConstraints6);
              PrefContentPane.add(Player_lbl, gridBagConstraints31);
              PrefContentPane.add(getPlayer_txt(), gridBagConstraints41);
              PrefContentPane.add(getNewGameAfterWinCB(),
                   gridBagConstraints32);
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return PrefContentPane;
    * This method initializes Player_txt
    * @return javax.swing.JTextField
    private JTextField getPlayer_txt() {
         if (Player_txt == null) {
         Player_txt = new JTextField("Anonimo");
         return Player_txt;
    * This method initializes MenuTemi
    * @return javax.swing.JMenu
    private JMenu getMenuTemi() {
         if (MenuTemi == null) {
         MenuTemi = new JMenu();
         MenuTemi.setText("Cambia tema");
         ButtonGroup group = new ButtonGroup();
         MenuTemi.add(getStandard());
         group.add(Standard);
         MenuTemi.add(getFuturama());
         group.add(Futurama);
         MenuTemi.add(getKillBill());
         group.add(KillBill);
         return MenuTemi;
    * This method initializes Standard
    * @return javax.swing.JMenuItem
    private JRadioButtonMenuItem getStandard() {
         if (Standard == null) {
         Standard = new JRadioButtonMenuItem("Base", true);
         Standard.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
              tema = "base";
              if (game != null){
                   createLista();
                   printSurface();
         return Standard;
    * This method initializes Futurama
    * @return javax.swing.JMenuItem
    private JRadioButtonMenuItem getFuturama() {
         if (Futurama == null) {
         Futurama = new JRadioButtonMenuItem("Futurama");
         Futurama.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
              tema = "futurama";
              if (game != null){
                   createLista();
                   printSurface();
         return Futurama;
    * This method initializes NewGameAfterWinCB
    * @return javax.swing.JCheckBox
    private JCheckBox getNewGameAfterWinCB() {
         if (NewGameAfterWinCB == null) {
         NewGameAfterWinCB = new JCheckBox(
              "Inizia automaticamente un nuovo gioco alla fine della partita",
              true);
         return NewGameAfterWinCB;
    * This method initializes KillBill
    * @return javax.swing.JRadioButtonMenuItem
    private JRadioButtonMenuItem getKillBill() {
         if (KillBill == null) {
         KillBill = new JRadioButtonMenuItem("Kill Bill");
         KillBill.addActionListener(new java.awt.event.ActionListener() {
              public void actionPerformed(java.awt.event.ActionEvent e) {
              tema = "killbill";
              if (game != null){
                   createLista();
                   printSurface();
         return KillBill;
    * This method initializes MainPanel
    * @return javax.swing.JPanel
    private JPanel getMainPanel() {
         if (MainPanel == null) {
         try {
              StatusBarLabel = new JLabel();
              StatusBarLabel.setText("Avvia un nuovo gioco!"); // Generated
              MainPanel = new JPanel();
              MainPanel.setLayout(new BorderLayout()); // Generated
              MainPanel.add(StatusBarLabel, BorderLayout.SOUTH); // Generated
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return MainPanel;
    public static void main(String[] args) {
         try {
         // Set System L&F
         UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
         } catch (Exception e) {
         e.printStackTrace();
         new Swingui();
    private Swingui() {
         JFrame FinestraPrincipale = getFinestraPrincipale();
         FinestraPrincipale.setVisible(true);
         SalvaMappa.setEnabled(false);
    private void printSurface() {
         ContentPanePrincipale = null;
         ContentPanePrincipale = new JPanel();
         LayoutGriglia = new GridLayout(game.getH(), game.getL());
         ContentPanePrincipale.setLayout(LayoutGriglia);
         makeMatrice();
         MainPanel.add(ContentPanePrincipale, BorderLayout.CENTER);
         ContentPanePrincipale
              .addMouseListener(new java.awt.event.MouseAdapter() {
              public void mouseClicked(java.awt.event.MouseEvent evt) {
                   int x = evt.getX() / 38;
                   int y = (game.getH() - evt.getY() / 38) - 1;
                   try {
                   game.move(x, y);
                   StatusBarLabel.setText("Punteggio attuale: "
                        + game.getPlayerScore());
                   } catch (RuntimeException e) {
                   StatusBarLabel.setText(e.toString().split(": ")[1]);
                   printSurface();
                   if (game.isEnded()) {
                   StatusBarLabel
                        .setText("Nessuna mossa disponibile!");
                   if (game.getPlayerName().equals("Anonimo")
                        || game.getPlayerName().equals("")) {
                        String in = JOptionPane.showInputDialog(
                             "Inserisci il tuo nome", "Anonimo");
                        if (in == null || in.equals(""))
                        in = "Anonimo";
                        game.setPlayerName(in);
                        JOptionPane.showMessageDialog(null,
                             "Complimenti, " + game.getPlayerName()
                                  + "! Il tuo punteggio �: "
                                  + game.getPlayerScore(),
                             "Grande!",
                             JOptionPane.INFORMATION_MESSAGE);
                   } else {
                        JOptionPane.showMessageDialog(null,
                             "Complimenti, " + game.getPlayerName()
                                  + "! Il tuo punteggio �: "
                                  + game.getPlayerScore(),
                             "Grande!",
                             JOptionPane.INFORMATION_MESSAGE);
                   try {
                        if (NewGameAfterWinCB.isSelected()){
                        flag=true;
                        newGame();
                        else
                        ContentPanePrincipale.setVisible(false);
                   } catch (NullPointerException exptz) {
                        flag=true;
                        newGame();
         FinestraPrincipale.pack();
    private void newGame() {
         try {
         l = Integer.parseInt(L_txt.getText());
         h = Integer.parseInt(H_txt.getText());
         n = Integer.parseInt(N_txt.getText());
         style = Stile_cbox.getSelectedIndex();
         player = Player_txt.getText();
         } catch (Exception e) {
         l = 15;
         h = 10;
         n = 3;
         style = 0;
         player = "Anonimo";
         try {
         game = new Game(l, h, n, style);
         game.setPlayerName(player);
         } catch (IndexOutOfBoundsException e) {
         JOptionPane.showMessageDialog(null, e.toString().split(": ")[1],
              "Aiaiai...", JOptionPane.ERROR_MESSAGE);
         printSurface();
         StatusBarLabel.setText("Punteggio attuale: " + game.getPlayerScore());
         SalvaMappa.setEnabled(true);
    private void makeMatrice() {
         if (flag) {
         createLista();
         flag = false;
         for (int y = game.getH() - 1; y >= 0; y--) {
         for (int x = 0; x < game.getL(); x++) {
              char type = game.getSurface()[x][y].getType();
              imageURL = getClass().getResource(returnPath(type));
              image = new ImageIcon(imageURL);
              piece = new JLabel(image);
              ContentPanePrincipale.add(piece);
    private void createLista() {
         listaTipi=new ArrayList<String>();
         int i = 0;
         if (n == 0)
         n = 20;
         for (int y = game.getH() - 1; y >= 0; y--) {
         for (int x = 0; x < game.getL(); x++) {
              if (i < n) {
              if (game.getSurface()[x][y].getType() != '.') {
                   if (notInLista(game.getSurface()[x][y].getType())) {
                   int j = i + 1;
                   String type = game.getSurface()[x][y].getType()
                        + " " + "images/" + tema + "/" + j + ".png";
                   listaTipi.add(type);
                   i++;
              } else
              break;
         if (i > n)
              break;
    private boolean notInLista(char type) {
         if (listaTipi == null)
         return true;
         for (int k = 0; k < listaTipi.size(); k++) {
         if (type == listaTipi.get(k).split(" ")[0].charAt(0))
              return false;
         return true;
    private String returnPath(char type) {
         for (int k = 0; k < listaTipi.size(); k++) {
         if (type == listaTipi.get(k).split(" ")[0].charAt(0)) {
              String path = listaTipi.get(k).split(" ")[1];
              return path;
         return "images/empty.png";
    Message was edited by:
    JinKazama
    On Mac this class work perfectly

  • Resource for BO on Win and Linux

    Hi,
    I have a BusinessObjects project. Can you give me requirements resource for BO on Linux and Window??
    Thanks
    Duypm

    Hi Duypm,
    go to below
    http://help.sap.com/
    and SAP BusinessObjects -> All Products
    you will get all the BO product giudes
    Thanks,
    Praveen.

  • Preferences under the user home in win and linux

    hi,
    how can i save my looger-file under the user home and not in the registry usw.? under my user home in windows i see lots of .PROGRAMNAME directorys! is there any class for using that?

    Preferences or log files? Your title says "preferences" and your text says "looger" (which I'm assuming is just a typo).
    If you want to store user-specific data (aka preferences), then use the new java.util.preferences classes and use the user context.
    If you want to store files (like log files) in the user's directory, then use the System property DrClap suggested to get the directory name.

  • Absolute paths to eclipse project root? Why?

    I am a dedicated follower of the Flex and related technologies since its first appearance (some years back, Flex 1.5)
    Flash Builder (formerly Flex Builder) back then (version 2) seemed to have a problem with paths relative to project location.
    More precisely, parts of generated projects always point to absolute locations either inside or outside the eclipse project workspace.
    Unfortunately, the problem still persists. In the past I had reported this issue (long time to remember/extract details now) but without success as it seems.
    This is very important for projects intended to be developed by more than one persons (different development machines, different paths etc.)
    for an example, with Flash Builder 4, create a new Flex project (Web), activate WTP integration, complete project generation and then check files
    .actionScriptProperties and .flexProperties
    you will observe absolute path references to essential files
    here is an example of my .actionScriptProperties
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <actionScriptProperties mainApplicationPath="Main.mxml" projectUUID="43b42874-f3f0-4b6b-932c-6a1d4e492b56" version="6">
    <compiler additionalCompilerArguments="-services &quot;D:/eclipse-win32/workspace/net.eliasbalasis.flex.web.sample/WebContent/WEB-INF/flex/services-config.xml&quot; -locale en_US" autoRSLOrdering="true" copyDependentFiles="true" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="true" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" sourceFolderPath="flex_src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="false" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
    <compilerSourcePath/>
    <libraryPath defaultLinkType="0">
    <libraryPathEntry kind="4" path="">
    <excludedEntries>
    <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flex.swc" useDefaultLinkType="false"/>
    </excludedEntries>
    </libraryPathEntry>
    <libraryPathEntry kind="1" linkType="1" path="flex_libs"/>
    <libraryPathEntry kind="3" linkType="1" path="D:/eclipse-win32/workspace/net.eliasbalasis.flex.web.sample/WebContent/WEB-INF/flex/libs/fds.swc" useDefaultLinkType="false"/>
    <libraryPathEntry kind="3" linkType="1" path="D:/eclipse-win32/workspace/net.eliasbalasis.flex.web.sample/WebContent/WEB-INF/flex/libs/player/playerfds.swc" useDefaultLinkType="false"/>
    <libraryPathEntry kind="1" linkType="1" path="D:/eclipse-win32/workspace/net.eliasbalasis.flex.web.sample/WebContent/WEB-INF/flex/locale/{locale}"/>
    </libraryPath>
    <sourceAttachmentPath/>
    </compiler>
    <applications>
    <application path="Main.mxml"/>
    </applications>
    <modules/>
    <buildCSSFiles/>
    </actionScriptProperties>
    here is a copy of my .flexProperties
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <flexProperties enableServiceManager="false" flexServerFeatures="6" flexServerType="8" flexWarLocation="D:/lcds/lcds.war" serverContextRoot="/WebContent" serverRoot="D:/eclipse-win32/workspace/net.eliasbalasis.flex.web.sample/WebContent" serverRootURL="http://localhost:8400/net.eliasbalasis.flex.web.sample" toolCompile="true" useServerFlexSDK="false" version="2"/>
    D:/lcds/lcds.war i suspect is fine because it is the location of the LiveCycle Data Services WAR used to create the project (it is external anyway)
    However, D:/eclipse-win32/workspace/net.eliasbalasis.flex.web.sample/WebContent is not fine at all. It is a location inside the project workspace. It should be referenced using some kind of variable, similarly to ${PROJECT_FRAMEWORKS} above.
    I observed that there is a variable ${DOCUMENTS} under Eclipse-->Preferences-->Workspace-->Linked Resources which references the Eclipse project workspace root (extremely convenient).
    Unfortunately, it seems that this variable can only be used within the context of other eclipse configuration files like .project and .classpath but not within the context of .actionScriptProperties and .flexProperties
    This is the same exact issue I reported in the past (see above)
    Flex Builder/Flash Builder family of products are the only Eclipse Based tools I have so far worked with that have such a big trouble handling file path locations relative to eclipse workspace root
    OOPS. CORRECT ME IF I AM WRONG PLEASE.
    I just replaced the eclipse workspace root with ${DOCUMENTS} and the project still compiles and generates deployment packages successfully.
    Perhaps the "Linked Resources" variables work in the context of flex configuration files.
    However I am not 100% sure.
    Please verify or otherwise provide a solution, as I am ready to select Flex technology products for the development of a new quite complex, multi developer, large scale system and this will be the only reason making me consider abandoning Flex and use other technology products

    I loooove Eclipse for reason.
    Yes, you are right, use of variables is great thing.
    However, there are 2 ways
    1.
    Use all paths relative to Eclipse workspace root. No absolute paths anywhere and No variables.
    2.
    Use tool-supplied variables (like ${DOCUMENTS} supplied by FB4 plugin pointing to Eclipse document root)
    However, although the variable is supplied by FB4 plugin, when a project is generated its files still contain absolute path references
    I had to manually introduce the ${DOCUMENTS} variable in project files discovering that variables work in the context of FB4 plugin project files.
    In earlier versions of FB plugin variables where not processed.
    Congratulations FB4 team, you saved the day.
    All I am saying is that there shouldn't be absolute paths in generated FB project files. Replacing manually currently works but it is not the easiest thing for all users. I happened to know where to look. Others may not.
    I believe FB team has to consider making actual use of the supplied variables in next version of FB (or alternatively, not use variables at all)
    p.s.
    You will love Eclipse, trust me :-)

  • Personas suddenly not working Firefox 30, 31, 32 on Win 7 Pro x64 and Linux Mint 16 x64

    Personas which have been working for a long time suddenly quit working on Win 7 and Linux. I tried changing to a different persona to change the background for the top border of the window and it just goes to some odd color and the personas just don't show up. This has been with Firefox 30, 31, 32. The personas still work with Win XP Pro run as a virtual machine on Win 7 host or Win 8 host. I thought it was a Windows thing until I saw the same problem with Linux. Everything else seems normal so this isn't a real bad problem. It's just odd.

    Make sure that you do not run Firefox in permanent Private Browsing mode (Never remember history).
    *https://support.mozilla.org/kb/Private+Browsing
    *Tools > Options > Privacy > Firefox will: "Use custom settings for history"
    *Deselect: [ ] "Always use Private Browsing mode"

  • Get the absolute path and filename of the file from the command line

    Hi,
    when we run the class we give the command
    java <filename>
    How can I capture the filename given above and get its absolute path inside the
    public static void main(String [] args){}
    args[0] gives me the command line argument after the filename. How do I capture the filename itself from the command line argument and also get that files absolute path
    Thanks

    I don't know of any way to capture the java command input, but there are ways to find out where the application is being run from. (the "absolute path")
    http://forum.java.sun.com/thread.jsp?forum=31&thread=335394

  • X-refs and index markers in absolute paths don't work

    A problem has arisen that did not exist before:
    If I have added files to a book using an absolute path, all X-refs and index markers in those files then don't work. The index *generates* without trouble, but if I then try to Alt-click an item in the index that refers back to a file with an absolute path I get the error "Cannot find the file named X. Make sure the file exists." This also means, of course, that the corresponding hyperlinks in a generated PDF file also don't work.
    X-refs and index markers in files added using *relative* paths work okay.
    What is wrong?
    (I use FM9 / Windows 7.)
    Regards,
    Knut Högvall

    Hi Michael,
    Yes, I use 9.0p255.
    No, the files don't have to be on different volumes. They can even be in the same folder (not that they are, but they *could* be; they are in fact in separate folders, but on the same volume). What matters is how I select the file in the File dialog box when I add the file to the book. To get an absolute link, I first click the Network button, select the top volume, and then navigate down to the file. The absolute path is displayed in the book window as \\<volume>\folder\file.fm" while a relative path is indicated by "..\..\file.fm".
    If I add a file using an absolute path it doesn't work; if I add the exact same file using a relative path, it works.
    How do I check the hypertext content in the index?
    Regards,
    - Knut

  • File Path for Windows and Linux

    hi can any one give solution how to implement code for odi file copy .
    i am using Same Code for Windows and Linux
    OdiFileCopy "-FILE=#Var_Lookup_File_Path \ Employee.csv" "-TOFILE=#Var_Lookup_File_Path_Backup\Employee.csv" "-RECURSE=NO" "-OVERWRITE=YES" "-CASESENS=NO"
    the problem of above code is
    it is working in windows but my Prod is Linux environment.
    in linux \ not works.. / will work
    please suggest how to concatnate variable and file without' \' '/'

    Thanks Phani
    i think in OS command also we may give path like #variable\File Name.
    So how it will replace \ with / in Linux.
    Could you give code for my Scenario..
    Thanks for helping

  • Ora:processXSLT xpath function and absolute paths

    It looks like ora:processXSLT xpath function does not honor absolute paths when specifying the location of the xslt to use in the first parameter. For example, if I call it like this:
    <copy>
    <from expression="ora:processXSLT('/u01/transforms/mytransform.xsl',bpws:getVariableData('xslInput','payload'))"/>
    <to variable="xslOutput"/>
    </copy>
    I get the following error in the bpel logs:
    Error while processing xpath expression, the expression is "ora:processXSLT('/u01/transforms/mytransform.xsl', bpws:getVariableData("xslInput", "payload"))", the reason is javax.xml.transform.TransformerException: java.io.FileNotFoundException: /u01/oracle/bpel/integration/orabpel/domains/test/tmp/.bpel_transformTest_1.0.jar/u01/transforms/mytransform.xsl (No such file or directory).
    Please verify the xpath query.
    It is assuming that the xsl will be relative to the bpel suitcase and just appending the supplied path to the relative path for the bpel process. Why would I want to do this? Well, I have hundreds of these maps and I want to be able to select one at runtime. I'm also adding new ones every day and I don't want to have to redeploy the process that uses them each time I add a new map. Is there any way to force this process to recognize the absolute path? I can work around it for now by using a bunch of ../../../../ stuff but that's a kludge and I'd like to find a better way to do it.
    I get the same error with xdk:processXSLT.
    Any suggestions?
    Thanks!
    Sean

    Hi Sean,
    Did you try to the file path with the file:// prefix and not just the path?
    ~ronen

  • Can I link to images using absolute paths in HTML Help and still see them locally?

    I'm publishing HTML help pages to a Web server.  All .htm files on the Web server are in their own folder, and all image files are in a separate folder.  Links to images are generally of the form <img src="/images/clear.png" height="14" width="8">.  That is, the images use an absolute path reference from the doc root folder (rather than relative path from the current file folder, such as "../images/myImg.png").
    I can modify the HTML for the images to follow this convention, but then I cannot see the images locally within RoboHelp, but must instead wait until the files are integrated with the Web server.  Is there a way to set up a RoboHelp project so that I can force an image path of "/images" both locally and in the HTML?
    Using RoboHelp 9.0.1.232.
    Thanks.

    RoboHelp expects the images to be within the project and will need that if you are to see them when working. It then uploads them to the server when you publish.  There is a check box when you publish so that only updated files get  uploaded.
    You could point Resource Manager to the server folder with the images and then link to those images. What happens then is the image gets downloaded into your project so that you see it when working. If the server image changes you will see the icon in Project Manager changes so that you can update the local copy. It would be a one-off exercise changing your workflow.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Problem with absolute path and context using Tomcat 4

    I added the following line to my server.xml:
    <Context path="/track" docBase="track" />Now I have used absolute paths(ex: /includes/css/style.css) throughout my code and it worked when I served my application from the ROOT context but when I moved it to the /track - the paths did not include the new root context.
    So instead of looking at http://localhost/track/includes/css/style.css it still looks at http://localhost/includes/css/style.css.
    Is there any kind of setting I am missing in the web.xml or server.xml? I really would like to be able to use absolute paths relative to the context root.
    Please help! Thanks in advance.
    -Chris

    Hi,
    I am not sure what exactly you are asking but here is my shot. If one tomcat is serving more than one application then the only way for tomcat to know which application to refer is by looking at the context path. Since you have the context path of /track then it should appear in all of your urls being directed to the server (for both servlet and jsp). Since you have used absolute path in all the cases either you will have to change the absolute path or you will have to define them relative (which is a better idea) to a base dir. Hope it helps.
    I added the following line to my server.xml:
    <Context path="/track" docBase="track"
    />Now I have used absolute paths(ex:
    /includes/css/style.css) throughout my code and it
    worked when I served my application from the ROOT
    context but when I moved it to the /track - the paths
    did not include the new root context.
    So instead of looking at
    http://localhost/track/includes/css/style.css it still
    looks at http://localhost/includes/css/style.css.
    Is there any kind of setting I am missing in the
    web.xml or server.xml? I really would like to be able
    to use absolute paths relative to the context root.
    Please help! Thanks in advance.
    -Chris

Maybe you are looking for

  • Invalid security certificate for my website host-they say the problem is Apple Safari and use Firefox instead

    For the past few days, I keep getting an invalid security certificate in Safari whenever I select Edit My Site from my website homepage (http://annaporterartist.com), or whenever I select anything requiring a secure log in from my website host main p

  • Document date is earlier than acquisition date for asset

    Client has an asset which they want to post an acquistion for as of 1/1/2011. They are in December of 2011. They first put an acquisition in with 12/31/2011 and then cancelled it, realizing they needed a docdate of 1/1/2011. When they try to redo the

  • How to run reports in Application Server 10g?

    Dear Friends, I am running my forms on Application Server 10g. How do I launch reports from my Forms on the 10g application server? My friend told to use web.show_document(http://serverip:port/reports/rwservlets/getjobid - what should it be after tha

  • Iphone 4 mail icon shows 3 emails, but do not show in the inbox

    I set up my new iphone 4 with my email and all the mail came in yesterday just fine. Today, the icon updates when a new email comes in but when I go to the inbox, it isn't showing. It goes through the update process but nothing updates. Is there a se

  • [SOLVED] Using awesome wm without a mouse?

    After recently learning Vim, then installing Vimperator on Firefox, I've found that using the keyboard for navigating links and the like to be the shit. Naturally, I want to extend this to my window manager. So, is there any way to really use awesome