aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark " Servlet API  Problem" Watch " Servlet API  Problem" New topic
Author

Servlet API Problem

bh sheiky
Greenhorn

Joined: Feb 26, 2007
Posts: 4
Hi,
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: 2057
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
Marshal

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


Ping & DNS - my free Android networking tools app
bh sheiky
Greenhorn

Joined: Feb 26, 2007
Posts: 4
Hi Dittmer

These contents are from servlet api

javax.servlet
Class GenericServlet

java.lang.Object
extended byjavax.servlet.GenericServlet

All Implemented Interfaces:
java.io.Serializable, Servlet, ServletConfig

Direct Known Subclasses:
HttpServlet

In the method Summary

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

Joined: Mar 22, 2005
Posts: 42276
    
  64
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
Sheriff

Joined: Dec 11, 2004
Posts: 13410

"sheiky",
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 agree. Here's the link: http://aspose.com/file-tools
 
subject: Servlet API Problem