Menu

How to dynamically set the path

vinoth
2004-12-14
2013-06-03
  • vinoth

    vinoth - 2004-12-14

    Hi,

    I use struts and dbforms in my application.

    I navigate from struts to dbforms in my application.
    So, I need to dynamically set the path for certain things (like image,followup,etc.) in the dbforms.

    It is difficult for me to refer the images when I'm in "../servlet/control".

    Should I write the root path in properties file and get it in the jsp & JS files? If so, how could I do this?

    Is there any other better way to do this?

    Thanx in advance.
    regards,
    vinoth.

     
    • Henner Kollmann

      Henner Kollmann - 2004-12-16

      Could you repost this into the mailing list?

      Thanks
      Henner

       
    • BJ Freeman

      BJ Freeman - 2004-12-18

      I use these
      in the main or init routine:
              String appHome = System.getProperty("user.dir");
             System.setProperty("application.home", appHome);

              System.setProperty("application.images", appHome
                      + System.getProperty("file.separator") + "com"
                      + System.getProperty("file.separator") + "images");

      then when I want to access images
      String image1=  System.getProperty("application.images") + System.getProperty("file.separator") + "myimage.gif"

       

Log in to post a comment.

MongoDB Logo MongoDB