• 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
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

correct me

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello , hi. I have dought regarding MVC . I will explain you How i'm doing MVC but i'm getting error.

1. First i have created form.html file which gives some result.
2. Second i have created Servlet(controller)
3. third a helper class (Model)
4. A jsp for the representation

directory structure;
tomcat 5.0, webapps, beer's-app(my application name),web-inf(outside of it will have jsps and html files and media files) inside of it contains web.xml file and two folders classes, lib, .In classes com(directory)in that web(a folder) and model (a folder).

5. In web.xml file i have given the full path for servlet.class file which i kept in classes>com>web folder and mapping i have done.
6. In form.html file i have give the action(url mapped name)
6. I have started the server
7. when i ran the html file throught the http://localhost:8080/beer's-app/form.html . Page has opened after that(when i sumit )a exception arises classnotfound exception ( ChooseColor.class(my servlet class)).


kindly anybody help ..

you can guide your own way of doing the MVC.
 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you compiled your servlet and put it in the classes directory.

And pleas use a UseAMeaningfulSubjectLine.


Hope this helps
 
sandeep Talari
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i have complied it and placed in the classes com web folder ..
 
Amit Ghorpade
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You mean to say classes/com/web
and have you used the same path in the web.xml

and what about the model class?
is it also placed in a proper package.
Just check it.
 
sandeep Talari
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have placed the model class in com.model package ... I believe we didn't place any thing about model class in d.d ,right? And i placed the controller servlet in com.web package and i did describe full path in d.d about servlet.
 
sandeep Talari
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
THANKS FOR THE REPLIES , I SOLVED THE PROBLEM NOW IT IS WOKING FINE, NOW MY HTML FILE CAN INVOKE CONTROLER(SERVLET), CONTROLLER CAN TAKE HELP OF EXPERT(POJO) AND DISPATCH IT TO JSP. MVC.
 
Sheriff
Posts: 67595
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
sandeep Talari, Please read this.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic