Contact: Tel: 2726 - New Media Systems, 1st Floor South, Queens Walk You are right on all these counts. 1). Yes, if you have a servlet implemented in MyToplevelPackage.examples.HelloWorldServlet, using JWS, you would copy your compiled package into the servlets directory as C:/<JWS_install_dir>/servlets/MyFirstPackage/examples/HellowWorld.class, and then in JWS admin page, give it a name, 'alias', say HelloWorld, and give the class name as 'MyTopLevelPackage.examples.HelloWorldServlet'. And then you can call it in your HTML page by 'http://yourhost:port/servlet/HelloWorld. 2). Many new web server is now adopting the new Web application server approach, meaning you will have to configure the application server using XML files. You have to consult the manual or online help of each different server to find out how to. This is a bit confusing to new comers I have to say as not all the new Java developers are ready armed with the knowledge of XML and application server concepts. However, most of this kind of application servers will allow you do use a default server config. Charles Ying Sun <[EMAIL PROTECTED]> on 10/20/2000 02:43:49 PM To: [EMAIL PROTECTED] cc: (bcc: Charles Chen/YellowPages) From: Ying Sun <[EMAIL PROTECTED]>, 20 October 2000, 2:43 p.m. Re: Call a servlet from another servlet [Scanned by Yellow PagesPostMaster] [Scanned by Yellow Pages PostMaster] 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 ___________________________________________________________________________ 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
