0

I'm trying to return an html, page using out.print(); from a servlet, and I can do it successfully the thing is that this is a group project and this other guy send me an html response that I have to mount in the servlet, he used css, and images and I tried to put all of what he send me in a out.print(); but I dont get images or color or whatever. How should it be done?

1
  • Learn JSP/taglibs/EL. A servlet is the wrong tool for the job in this specific case. Use a servlet to control/preprocess/postprocess requests/responses. Commented Aug 16, 2010 at 11:51

1 Answer 1

2

The CSS and images are most likely intended to be separate resources, each with their own distinct URLs. If you are going to output the resource contents from your servlet as you are currently doing, your servlet code has to look at the details of the HttpServletRequest and output the appropriate resource depending on the requested URL. When the user's browser requests the HTML page, when it requests an image, you give it that image and so on.

There are probably better ways to do this ...

Sign up to request clarification or add additional context in comments.

1 Comment

thanks... gonna look 4 that, and believe me i do know there r millions of better ways, i just don't know them... yet. thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.