• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Servlet API Problem

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Ranch Hand
Posts: 2108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does the servlet implement the getServletInfo method? The default implementation in GenericServlet (which is inherited by HttpServlet) returns an empty string.
 
bh sheiky
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"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
 
You guys haven't done this much, have ya? I suggest you study this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic