aspose file tools*
The moose likes Servlets and the fly likes New to servlets&JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "New to servlets&JSP" Watch "New to servlets&JSP" New topic
Author

New to servlets&JSP

Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 598

Hi...

I was wondering about what parts of the the mvc need to exist in order for the servlet to run.Because I'm trying to run a servlet that doesnt use a model.

It's just an HTML page that posts some form parameters to a servlet and then the servlet forwards the request to the JSP.Doesn't seem to be able to find the servlet that I defined in the DD...

enlightenment?
Also,what other books are available for SCJP other than the K&B one?I need fresh material...


===>SCJP 1.5(72%)<===
==>SCWCD1.5(76%)<===
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2718
    
    6

I was wondering about what parts of the the mvc need to exist in order for the servlet to run.Because I'm trying to run a servlet that doesnt use a model.

Running a servlet has nothing to do with MVC, it can run all on it own.
MVC is a design pattern that simplifies design and maintainance.

All a servelt needs to run is its class file placed in WEB-INF/classes and a mapping in the deployment descriptor web.xml.

Doesn't seem to be able to find the servlet that I defined in the DD...

And what is the error/problem, does it give a 404?


SCJP, SCWCD.
|Asking Good Questions|
Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 598

Yes a 404...
Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 598

The servlet class is in WEB-INF/myPackagename/myPackageName/classes.
The dd is in WEB-INF.
Does the development enviroment have any effect at runtime?Or is it only the deployment enviroment that matters?
sudhir nim
Ranch Hand

Joined: Aug 29, 2007
Posts: 212

Verify that you have correct servlet mapping in deployment descriptor (web.xml). See Servlet Mapping


[Servlet tutorial] [Servlet 3.0 Cook Book]
rakesh sugirtharaj
Ranch Hand

Joined: Dec 16, 2007
Posts: 151
This is wrong
The servlet class is in WEB-INF/myPackagename/myPackageName/classes.

instead use WEB-INF/classes/


Cheers!
RSR
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
How is it wrong?

Originally posted by rakesh sugirtharaj:
This is wrong
instead use WEB-INF/classes/


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61756
    
  67

Originally posted by Bosun Bello:
How is it wrong?

The package hierarchy starts at WEB-INF/classes, not WEB-INF.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
Oops! I missed that. Very true indeed. I mis-read the response and thought it was saying WEB-INF/classes is wrong.

Originally posted by Bear Bibeault:

The package hierarchy starts at WEB-INF/classes, not WEB-INF.
 
jQuery in Action, 2nd edition
 
subject: New to servlets&JSP