tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Turner, John" <JTur...@AAS.com>
Subject RE: Calling a servlet from a jsps page
Date Fri, 16 Aug 2002 18:11:49 GMT

Right.  A JSP page is a servlet once it is compiled.

You should be able to access your servlet directly at 
http://my-local-host-name/servlet/CurrentTime or perhaps
http://my-local-host-name/CurrentTime depending on the mapping, and assuming
that your servlet generates some sort of HTML-ish output.

Check the tomcat examples...such as Hello World, etc.

John Turner
jturner@NOSPAM.aas.com

-----Original Message-----
From: Wills, Mike N. (TC) [mailto:MNWills@taylorcorp.com]
Sent: Friday, August 16, 2002 2:09 PM
To: 'Tomcat Users List'
Subject: RE: Calling a servlet from a jsps page


To the best of my knowledge. You can't include a servlet in a JSP page. You
can do a submit to a servlet, or have a servlet forward data to a JSP page.

-----Original Message-----
From: Raju Lokhande [mailto:RLokhande@ne.health.net]
Sent: Friday, August 16, 2002 1:06 PM
To: tomcat-user@jakarta.apache.org
Subject: Calling a servlet from a jsps page


Greetings everyone,
 I have a .jsps page as follows:
===============Begin==================
<html>
<head><title>Times!</title></head>
<body>
The current time here is:
<jsp: include page="/rajapp/mypkg.CurrentTime.class" flush="true" />
<P>
</body>
</html>
=============End=====================
My application web.xml entries are as follows
===============Begin==================
<servlet>
        <servlet-name> CurrentTime </servlet-name>
        <servlet-class> mypkg.CurrentTime </servlet-class>
</servlet>

<servlet-mapping>
        <servlet-name> CurrentTime </servlet-name>
        <url-pattern> /CurrentTime </url-pattern>
</servlet-mapping>
==========End============
I invoke this page as http://my-local-host-name/rajapp/times.jsps
I get no output from the servlet.
The Servlet class compiled fine. I followed the advice from my searches in
the archives for this list server.
Any idea about what is wrong here. I am using jakarta-tomcat-4.0.3 on
Win2000.
Thanks in advance
Raju Lokhande




*************************************************************************
This message, together with any attachments, is intended only
for the use of the individual or entity to which it is addressed. It
may contain information that is confidential and prohibited from
disclosure.  If you are not the intended recipient, you are
hereby notified that any dissemination or copying of this
message or any attachment is strictly prohibited. If you have
received this message in error, please notify the original sender
immediately by telephone or by return e-mail and delete this
message along with any attachments, from your computer.
Thank you.
*************************************************************************


--
To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message