• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question about SERVLET tag

 
rick collette
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following html code:
<HTML>
<HEAD><TITLE>Times!</TITLE></HEAD>
<BODY>
The current time here is"
<SERVLET CODE=servlet/coreservlets.CurrentTime>
</SERVLET>
<P>
The current time in London is:
<SERVLET CODE=servlet/coreservlets.CurrentTime>
<PARAM NAME=zone VALUE=GMT>
</SERVLET>
<P>
And the current time in NEW YORK is:
<SERVLET CODE=servlet/coreservlets.CurrentTime>
<PARAM NAME=zone VALUE=EST>
</SERVLET>
<P>
</BODY>
</HTML>
This file is in: install-dir\webapps\ROOT.
My servlet is in:install_dir\webapps\ROOT\WEB-INF\classes\coreservlets.
coreservlets is a package. When I try to load
the page using: http://local/CurrentTime.html, I cannot get times from my servlet. What is the problem? Thanks.
rick
 
tony lee
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
try it by
1) including "package coreservlets;" in the 1st statement of your servlet.
2) adding port # in url http://local:8080/CurrentTime.html
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SERVLET is not a tag in JSP. Where is this tag defined? I think you are looking for something else. It looks like it's from Marty Hall's site. What example are you trying to follow?
 
rick collette
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys.
Tony, this line was included at the start. This may not be the problem.
I downloaded Jason Hunter's example code, but I am using Tomcat4.0.1, so I just copy the code into my subdirectory. Hunter's code is kind of old now (1998). But I believe SERVLET is a tag.
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
NO, SERVLET is NOT an acceptable tag in JSP. If it's from one of his original books, it was proposed but, never included in the JSP spec. (One of the dangers with writing on proposed drafts) Check out the JSP 1.2 Quick Card and you'll see that SERVLET isn't available.
Now, what is the code like for the servlet/coreservlets.CurrentTime servlet?
 
rick collette
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess this tag was mentioned in JSP's beta version, this is why it disappeared later.
The following is the simple code:
 
Carl Trusiak
Sheriff
Posts: 3341
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The other option is an include tag for an early version of NSAPIor IIAPI for Server Side Includes. I'm not positive which. Well, you can easily refactor this into a JSP Bean to get the output you want. Give it a try and post your code here. I'll work up a result myself and we'll compare results. From there, we can modify it into a JSP TagLib.
Feeling game?
 
Guy Allard
Ranch Hand
Posts: 776
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<servlet> is not an html tag either.
See the HTML specs here
At one time (I think), there was discussion of a <servlet> html tag, to be used to invoke server side functionality.
The technology/architecture did not work out that way.
Regards, Guy
 
Axel Janssen
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you have it from Jason Hunters 1998 book.
 
rick collette
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Axel Janssen:
I think you have it from Jason Hunters 1998 book.

Yes, I mentioned in my previous post, Alex.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic