File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes correct me Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "correct me" Watch "correct me" New topic
Author

correct me

sandeep Talari
Ranch Hand

Joined: Dec 24, 2007
Posts: 63
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.
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2709
    
    5

Have you compiled your servlet and put it in the classes directory.

And pleas use a UseAMeaningfulSubjectLine.


Hope this helps


SCJP, SCWCD.
|Asking Good Questions|
sandeep Talari
Ranch Hand

Joined: Dec 24, 2007
Posts: 63
i have complied it and placed in the classes com web folder ..
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2709
    
    5

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

Joined: Dec 24, 2007
Posts: 63
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

Joined: Dec 24, 2007
Posts: 63
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.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60046
    
  65

sandeep Talari, Please read this.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: correct me
 
Similar Threads
Http Error 500
404 error
how to use the servlet in tomcat??
context path
HFS: Problem with deploying and testing Beer-v1 App