• 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 tag in JSPs

 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
mister krabs
Posts: 13974
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Thomas! I'll have to go check that out.
Annette
 
Good heavens! What have you done! Here, try to fix it with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic