servlet question

D

D E

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

D E

D E said:
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)?
 
J

Joona I Palaste

D E said:
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>");
 
B

Bryce (Work)

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...
 
D

D E

it's for a school project.


Bryce (Work) said:
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...
 
J

Joona I Palaste

D E said:
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.
 
J

Joona I Palaste

D E said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top