This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Servlets and the fly likes  Servlet API  Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Servlets
Bookmark " Servlet API  Problem" Watch " Servlet API  Problem" New topic

Servlet API Problem

bh sheiky

Joined: Feb 26, 2007
Posts: 4
Iam Running Servlet , it works fine prints messages which are given in double quotes but not those which are of API Methods
for: example- if i give pw.write("servlet Information : "+this.getServletInfo());
It will print only -servlet information : - but doesnt give the servlet information returned by the getServletInfo() method.

I have imported neccessary api's
I have included these jars in buildpath - servlet-api.jar,jsp-api.jar,servlet-api.jar

and iam using server -tomcat 5.0 also verified in Tomcat 6.0
IDE : eclipse
JDK - 5.0 as well as 6.0
[ December 16, 2008: Message edited by: bh phani ]
Jesus Angeles
Ranch Hand

Joined: Feb 26, 2005
Posts: 2066
I believe that your question is not clear, at least for english speakers.

If you carefully form your questions/sentences in correct english grammar, it will help everybody help you.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42958
Does the servlet implement the getServletInfo method? The default implementation in GenericServlet (which is inherited by HttpServlet) returns an empty string.
bh sheiky

Joined: Feb 26, 2007
Posts: 4
Hi Dittmer

These contents are from servlet api

Class GenericServlet

extended byjavax.servlet.GenericServlet

All Implemented Interfaces:, Servlet, ServletConfig

Direct Known Subclasses:

In the method Summary

java.lang.String -getServletInfo()
Returns information about the servlet, such as author, version, and copyright.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42958
Hi Dittmer

If you address someone by their last name, then the polite thing to do is to prefix that by "Mr"; first name is fine, though.

Returns information about the servlet, such as author, version, and copyright.

That's just what the interface says. If you check the javadocs of the implementation (in the GenericServlet class), you'll see what it actually returns.
Intuitively it makes sense that the servlet author would need to supply this information, because the servlet container can't possibly know anything about the servlet.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Welcome to JavaRanch!

We're pleased to have you here with us here on the ranch, but there are a few rules that need to be followed. One is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious. Initials are OK for the first and middle names but not the last. You can change it here

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Servlet API Problem
It's not a secret anymore!