• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to configure a packaged servlet in iPlanet Web Server

James Long
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, all:
Recently I try to create a web application in iPlanet Web Server4.1 (Enterprise Edition). My servelt has been put
into the package such as com.long.myapp.MyServlet.class. I read the documentation about how to configure
servlet in iPlanet web server, howerver I couldn't find too much about to do servlet mapping if the servlet has
the long packaged name.
I only find that you must put the servlet in the registered servlet directory, for example: ( excerpted from
iPlanet Web Server documentation)
You can invoke a servlet in a subdirectory of a registered servlet directory if you include a package directive in
the servlet code that corresponds to the path from the registered servlet directory. For example, suppose the
servlet is in the following location, and that server_root/docs/servlet/ is a registered servlet directory:
Include the following package directive as the first line in the Java source file:
package HelloWorld;
You can then invoke the servlet by pointing the web browser to:
However, if I want to invoke my servlet
com.long.myapp.MyServlet.class and I don't want to invoke it by the long pacakge name http://your_server/servlet/com.long.myapp.MyServlet
instead http://your_server/servlet/MyServletAlias
How can I do this and How can put my other servlet and JSP into the same context in iPlanet Web server???
If any one can give me the idea or tell me even the URL in the Internet, it will be very appreciated. Thank you in
Suresh Bansal
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Long,
I recently came up with the same problem, and while looking for the answer stumbled upon your post.
Now the solution.
Say, I have a servlet in a package 'com.portal.web.Test'
Put all the class files inside a jar file.
Go to Servlets tab, Configure Servlets Attributes.
give the name of servlet - Test
its full class(including the package) - com.portal.web.Test
path to the jar file
Go to Configure Servlet Virtual Path Translation
set virtual path to - /servlet
set servlet name to - Test
That should do the trick
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic