Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Senior Coder jerry62704's Avatar
    Join Date
    Oct 2007
    Location
    Springfield, IL
    Posts
    1,100
    Thanks
    13
    Thanked 87 Times in 87 Posts

    Question paths, directories and servers

    Here is one that hasn't been here before (that I've seen).

    I'm developing a system in jsp. That system is being developed in RAD. We are using struts. Enough background.

    The server is "localhost:9080" and the structure is:

    RIN
    /css/RIN.css
    /images/several go here
    /pages/html goes here

    If I wanted to pull up the login page I would enter:
    http://localhost:9080/RIN/pages/RINLogin.jsp

    RAD/jsp/struts would then change the next page to:
    http://localhost:9080/RIN/RINLogin.do

    Notice the directory and name change.

    Now the problem. When I hard code the http://localhost:9080/RIN/css/RIN.css part in each of the pages to include the css it works find. I can't use relative positioning because the positioning changes and I can't control that. Is there a way to avoid the hard coding of the css and images?
    .
    .
    ...and gladly would he learn and gladly teach

    Visit www.LiberalsWin.com for humor and the unique Bush/Obama Approval Polls

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Maybe try /RIN/css/RIN.css instead of http://localhost:9080/RIN/css/RIN.css[i]

    That will tell the document to look for the stylesheet at the root of the site. I'm assuming you are wanting to do this because you will be moving this to a live server.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Senior Coder jerry62704's Avatar
    Join Date
    Oct 2007
    Location
    Springfield, IL
    Posts
    1,100
    Thanks
    13
    Thanked 87 Times in 87 Posts
    Yes, it will (maybe) move to a "real" site. We are using this as a training exercise to learn jsp, java and struts. BTW, that worked.

    Thanks for the quick and correct solution.
    .
    .
    ...and gladly would he learn and gladly teach

    Visit www.LiberalsWin.com for humor and the unique Bush/Obama Approval Polls


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •