servlet question

Discussion in 'Java' started by D E, Apr 7, 2004.

  1. D E

    D E Guest

    once i enter a dynamically(servlet) created webpage, how do i exit it? for
    example i have a static index.html with the option to either "search jobs"
    or go to "admin". When i enter "search jobs" i need to enter a
    servlet-produced page to populate a job category drop down. But on the top
    menu, i still want an option to go to the home page (which is static). Do i
    just need to create every page dynamically(servlet)?
     
    D E, Apr 7, 2004
    #1
    1. Advertising

  2. D E

    D E Guest

    "D E" <> wrote in message
    news:hjMcc.8109$...
    > once i enter a dynamically(servlet) created webpage, how do i exit it? for
    > example i have a static index.html with the option to either "search jobs"
    > or go to "admin". When i enter "search jobs" i need to enter a
    > servlet-produced page to populate a job category drop down. But on the top
    > menu, i still want an option to go to the home page (which is static). Do

    i
    > just need to create every page dynamically(servlet)?
    >
    >
     
    D E, Apr 7, 2004
    #2
    1. Advertising

  3. D E <> scribbled the following:
    > once i enter a dynamically(servlet) created webpage, how do i exit it? for
    > example i have a static index.html with the option to either "search jobs"
    > or go to "admin". When i enter "search jobs" i need to enter a
    > servlet-produced page to populate a job category drop down. But on the top
    > menu, i still want an option to go to the home page (which is static). Do i
    > just need to create every page dynamically(servlet)?


    Make the servlet include a link pointing back to the original static
    page in the dynamically generated HTML. For example:
    out.println("<a href=\"index.html\">Back to main</a>");

    --
    /-- Joona Palaste () ------------- Finland --------\
    \-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
    "We sorcerers don't like to eat our words, so to say."
    - Sparrowhawk
     
    Joona I Palaste, Apr 7, 2004
    #3
  4. D E

    Bryce (Work) Guest

    On Wed, 07 Apr 2004 05:27:41 GMT, "D E" <> wrote:

    >once i enter a dynamically(servlet) created webpage, how do i exit it? for
    >example i have a static index.html with the option to either "search jobs"
    >or go to "admin". When i enter "search jobs" i need to enter a
    >servlet-produced page to populate a job category drop down. But on the top
    >menu, i still want an option to go to the home page (which is static). Do i
    >just need to create every page dynamically(servlet)?
    >


    whats wrong with just putting a static link in your servlet generated
    page?

    If you want to keep this link out of the servlet, put it in a seperate
    file, and include it with the servlet..

    Or use JSPs...

    --
    now with more cowbell
     
    Bryce (Work), Apr 7, 2004
    #4
  5. D E

    D E Guest

    it's for a school project.


    "Bryce (Work)" <> wrote in message
    news:...
    > On Wed, 07 Apr 2004 05:27:41 GMT, "D E" <> wrote:
    >
    > >once i enter a dynamically(servlet) created webpage, how do i exit it?

    for
    > >example i have a static index.html with the option to either "search

    jobs"
    > >or go to "admin". When i enter "search jobs" i need to enter a
    > >servlet-produced page to populate a job category drop down. But on the

    top
    > >menu, i still want an option to go to the home page (which is static). Do

    i
    > >just need to create every page dynamically(servlet)?
    > >

    >
    > whats wrong with just putting a static link in your servlet generated
    > page?
    >
    > If you want to keep this link out of the servlet, put it in a seperate
    > file, and include it with the servlet..
    >
    > Or use JSPs...
    >
    > --
    > now with more cowbell
     
    D E, Apr 7, 2004
    #5
  6. D E <> scribbled the following:
    > it's for a school project.


    So? How does that prevent putting a static link in your servlet-
    generated web page? My previous reply even gives sample code.

    --
    /-- Joona Palaste () ------------- Finland --------\
    \-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
    "It was, er, quite bookish."
    - Horace Boothroyd
     
    Joona I Palaste, Apr 7, 2004
    #6
  7. D E

    D E Guest

    ok. joona i did that, but when i point back to home the link says
    http://localhost:8079/servlet/index.html
    then i click on it and get a 404 error.


    "Joona I Palaste" <> wrote in message
    news:c5057c$t0k$...
    > D E <> scribbled the following:
    > > once i enter a dynamically(servlet) created webpage, how do i exit it?

    for
    > > example i have a static index.html with the option to either "search

    jobs"
    > > or go to "admin". When i enter "search jobs" i need to enter a
    > > servlet-produced page to populate a job category drop down. But on the

    top
    > > menu, i still want an option to go to the home page (which is static).

    Do i
    > > just need to create every page dynamically(servlet)?

    >
    > Make the servlet include a link pointing back to the original static
    > page in the dynamically generated HTML. For example:
    > out.println("<a href=\"index.html\">Back to main</a>");
    >
    > --
    > /-- Joona Palaste () ------------- Finland --------\
    > \-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
    > "We sorcerers don't like to eat our words, so to say."
    > - Sparrowhawk
     
    D E, Apr 7, 2004
    #7
  8. D E <> scribbled the following:
    > ok. joona i did that, but when i point back to home the link says
    > http://localhost:8079/servlet/index.html
    > then i click on it and get a 404 error.


    D'oh. I forgot people could run servlet engines on non-standard ports.
    Let's try that again. Assume the original URL of your index.html is
    http://www.yourhost.com/index.html
    Then just add this to your servlet:
    out.println("<a href=\"http://www.yourhost.com/index.html\">Back</a>");
    The important bit is, write the address between the two \" marks
    *exactly* as it appears in your browser's location bar when you are at
    your static index page.

    --
    /-- Joona Palaste () ------------- Finland --------\
    \-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
    "Roses are red, violets are blue, I'm a schitzophrenic and so am I."
    - Bob Wiley
     
    Joona I Palaste, Apr 7, 2004
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andy Fish
    Replies:
    4
    Views:
    2,433
    Andy Fish
    Dec 17, 2003
  2. Sean Clarke
    Replies:
    1
    Views:
    1,925
    Sudsy
    Jan 7, 2004
  3. circuit_breaker
    Replies:
    2
    Views:
    2,052
    Jack Jia
    Apr 4, 2004
  4. chamikara
    Replies:
    1
    Views:
    49,917
  5. DiscoStu
    Replies:
    0
    Views:
    515
    DiscoStu
    Jul 8, 2004
Loading...

Share This Page