• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to run jsp in tomcat

 
sumedha rao
Ranch Hand
Posts: 115
Firefox Browser Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Ranchers, i was trying to run the jsp code on page 286 of HFSJ,but im getting an output..

the pain java code is as below(compiles!)


and jsp code..


my doubt is that while deploying the class file,should i paste the entire foo package(folder) or should i paste only the Counter.class in the tomcat folder??

the jsp file is under tomcat\webapps\testing\BasicCounter.jsp

can anyone please help me out!!
 
Ankit Garg
Sheriff
Posts: 9577
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sumedha, you'll need a proper directory structure to run a web application. You'll need a WEB-INF directory with web.xml deployment descriptor in it. You'll need to put your Counter.class in its proper package so it will go under WEB-INF/classes/foo/Counter.class...
 
sumedha rao
Ranch Hand
Posts: 115
Firefox Browser Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ankit thanks for replying,bt i have a proper directory structure,i have followed the same steps as guided in hfsj.What should i write in web.xml?? there isnt anything given about web.xml for this program in the book.About the counter class,yes it is in the same order as you've mentioned.
 
Ankit Garg
Sheriff
Posts: 9577
33
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sumedha, you can find examples of web.xml over the internet like here. Since you don't have any servlets, you can remove most of the content of the web.xml. You can keep the display-name, description and welcome-file-list tags if you want...
 
sumedha rao
Ranch Hand
Posts: 115
Firefox Browser Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok fine ill try that out.Thanks for helping!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic