Hi charles,
1)servlet should be either configured to have an alias by which you can invoke it.
Does it mean when a html file embed a servlet link,I need to add alias
filename/html
servletname?
2)The javawebserver call the servlet like http://hostname:8080/servlet/servletname
when I use other java-enabled server,I can't call it as above,need to use xml to
configure first?
thank in advance,
chris
Charles Chen wrote:
> Contact: Tel: 2726 - New Media Systems, 1st Floor South, Queens Walk
>
> I do not use jsdk but this looks like a generic problem. A servlet is a Java
> class, not a html page. Therefore servlets are not invoked by there phyical
> locations. They should be either configured to have an alias by which you can
> invoke it, or you call it by the default way setup by your server. Most recent
> web servers use Xml configurations for this purpose. Some provide GUI screen to
> do this.
>
> Does JSDK do this differently?
>
> Charles
>
> Servlet Java <[EMAIL PROTECTED]> on 10/20/2000 12:05:07 AM
>
> To: [EMAIL PROTECTED]
> cc: (bcc: Charles Chen/YellowPages)
> From: Servlet Java <[EMAIL PROTECTED]>, 20 October 2000, 0:05 a.m.
>
> Call a servlet from another servlet [Scanned by Yellow Pages PostMaster]
>
> Dear All,
>
> I use jsdk 2.1 and can run the downloaded examples.
>
> I have problem to call a servlet from another servlet but no problem to call
> an HTML page at same location.
>
> Could anyone give me some help please?
>
> Best Regards.
>
> First servlet is at
> D:\jsdk2.1\webpages\WEB-INF\servlets
> the second servlet and HTML file are at:
> D:\jsdk2.1\webpages\myservlets
>
> Please see the source code below:
>
> public class Hello extends HttpServlet {
>
> public void doGet(HttpServletRequest request,
> HttpServletResponse response)
> throws IOException, ServletException
> {
> response.setContentType("text/html");
> PrintWriter out = response.getWriter();
>
> out.println("<html>");
> out.println("<body bgcolor=\"white\">");
> out.println("<head>");
>
> out.println("<title> Hello Title </title>");
> out.println("</head>");
> out.println("<body>");
> out.println("<h2> Hello body /h2>");
>
> //
> // Problems here
> //
> out.println("<p>");
> out.println("<a href=\"../myservlet/HelloWorldExample\">Execute:
> This one does not work</a>");
> out.println("</p>");
>
> //
> // No Problems here
> //
> out.println("<p>");
> out.println("<a href=\"../myservlets/helloworld.html\">");
> out.println("link to helloworld html page: This one work</a>");
> out.println("</p>");
>
> out.println("</body>");
> out.println("</html>");
> }
> }
>
> _________________________________________________________________________
> Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>
> Share information about yourself, create your own public profile at
> http://profiles.msn.com.
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
> ___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html