This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes jsp calling a servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "jsp calling a servlet" Watch "jsp calling a servlet" New topic
Author

jsp calling a servlet

Prasad Kharkar
Ranch Hand

Joined: Mar 07, 2010
Posts: 438

Hello
I am trying to call a servlet from a jsp but that is not working at all
I tried the following code


but when I try to go to another servlet other than ExamInitilizer
let us say,

if we write


I have not written any code in doGet and doPost method of both servlets other than simle println statements

second works fine but first does not work
all the spellings and paths are correct
what can be the problem

SCJP 6 [86%] June 30th, 2010
OCPWCD [84%] March 26th, 2013
If you find any post useful, click the "plus one" sign on the right
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

Prasad Kharkar wrote:all the spellings and paths are correct


I doubt that. If I had been designing the system that servlet would not have been called "ExamInitilizer" because that isn't correct spelling. I would have called it "ExamInitializer". Maybe -- as you say -- all the spellings are correct. In which case you too should use the correct spellings.

And by the way you are not trying to "call" a servlet with that code. That is vague and unhelpful terminology. You are trying to forward to a servlet. Please use the standard terminology, it makes it much easier if we don't have to guess at the meaning of vague and undefined words like "call".
Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3827

Have you checked your mappings in web.xml for the offending servlet?


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
 
 
subject: jsp calling a servlet