File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes how to use css and js file in servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Reply locked New topic

how to use css and js file in servlet

rakhi sinha
Ranch Hand

Joined: Mar 26, 2012
Posts: 147
I have problem in using calendar in my servlet ..i dont understand where to save css ,js file and .png image file so that i can use these in my servlet to call the calendar in the servlet .how to give url in the servlet.

Neeraj Dhiman
Ranch Hand

Joined: Dec 19, 2011
Posts: 68

you can store your css, js and image any where in webcontent folder in any hierarchy except WEB-INF Folder. and corresponding path use to access.

Correct Me if i am wrong
Nam Ha Minh
Ranch Hand

Joined: Oct 31, 2011
Posts: 502

Putting HTML code inside servlet may work for the first time, but it will make maintain the code harder.
Why don't you dispatch to a JSP page from the servlet?

PM Me If You Want to get Urgent Help on Java Programming
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63870

Please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place. Please click this link ⇒ CarefullyChooseOneForum ⇐ for more information.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: how to use css and js file in servlet
It's not a secret anymore!