Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet tag in JSPs

 
Annette L'Heureux
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does anybody know how the <servlet> tag works?
If I write a servlet, then put the name of it in the servlet tag (SERVLET NAME="myservlet" CODE="myservlet.class" CODEBASE="url">
will the servlet run automatically and replace the servlet tag with the values returned by the servlet?
Annette
 
Raukutam Sandeep
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

If u include the servlet tag in a html file and u must save that file with a extension .shtml
The servlet tag refreshes automatically(if it contains data) after submitting the data from the html form.
But at times it may not, and for that u have to clear u'r cache memory.
regds,
Sandeep.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In JSP pages you can include the output of servlets with the
<jsp:include> tag
The only <servlet> tag I know of in the current APIs is used in the web.xml file to define a servlet to the "container."
Bill
 
Annette L'Heureux
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's the link to the little bit of information I found. Seems to me like I should be able to put this code in, and then it will replace it with the output of the servlet.
http://www-4.ibm.com/software/webservers/appserv/doc/guide/asgusing.html#HDRDSHTML
If you scroll down, there's a section called
"Specifying a servlet within the <servlet> tag."
I dont' know if the <jsp:include> would do the same thing.
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The answer to your question is "yes" as long as the page ends with .shtml extension and support is turned on in the web server.
 
Annette L'Heureux
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Thomas! I'll have to go check that out.
Annette
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic