wood burning stoves 2.0*
The moose likes Servlets and the fly likes servlet tag in JSPs Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet tag in JSPs" Watch "servlet tag in JSPs" New topic
Author

servlet tag in JSPs

Annette L'Heureux
Ranch Hand

Joined: Dec 07, 2000
Posts: 135
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

Joined: Nov 15, 2000
Posts: 61
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

Joined: Mar 22, 2000
Posts: 12756
    
    5
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

Joined: Dec 07, 2000
Posts: 135
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

Joined: May 05, 2000
Posts: 13974
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.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Annette L'Heureux
Ranch Hand

Joined: Dec 07, 2000
Posts: 135
Thanks Thomas! I'll have to go check that out.
Annette
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: servlet tag in JSPs
 
Similar Threads
Problem with jspInit() overriding
filters query
web.xml
servlet deployment
invoking servlet from another servlet