• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to run jsp in tomcat

 
Ranch Hand
Posts: 115
Firefox Browser Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!
 
Sheriff
Posts: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 9707
43
Android Google Web Toolkit Hibernate IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok fine ill try that out.Thanks for helping!!
reply
    Bookmark Topic Watch Topic
  • New Topic