Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet can't see html files?

 
Hanna Habashy
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi:
I am using tomcat 5.0. I created an application using JBulider9.0 running tomcat 4.0. I tested the application and it is working fine. I took the .war file and I deployed it in tomcat/webapps folder. The container unziped the .war file and created the appropriat folders. Whe I run it, my servlet can't see my html files. I put the files in html folder, which is located at tomcat/webapps/myApp/html.
Inside my servlets, I refere to the html files as("/html/myPage.html")
any help is appreciated.
As all you can tell, I am new to this stuff.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JBuilder might be automatically setting your web app base for you. Try changing the URL to /myApp/html/myPage.html and see what happens. If you use /html/mypage.html the servlet will look for tomcat/webapps/html/mypage.html.
 
Hanna Habashy
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thnks Greg:
your suggestion fixed the problem, however my servlets couldn't refere to another servles in the same package. for example:
RequestDispatcher dispatcher = req.getRequestDispatcher("/com_habashy_shoppingcart.calculateshoppingcartsevlet");
dispatcher.forward(req, res);
the previous line produce server error, becuase it can't find the resource required. I check web.xml file, and I made sure the all the serlets are listed there. but still doesn't want to work.
thank you again for your advise.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic