How to post an audio file in JSP or servlet

Hi,
I've loaded some rm files into the database. How do I retrieve and post it to the web using JSP or servlet page? How do I convert the ORDAUDIO to BLOB field? I went to the following example/demo:
http://www.oracle.com/technology/sample_code/products/intermedia/index.html
but didn't gain much help. Please provide me some sample codes using embeded tag. Thanks!
Regards,
Johnny

I''l try again.....
The response to your http page does not include media of any kind. The media is not part of your web response. It takes another request to get the media.
Your embed tag, image tag, object tag, anchor tag only reference the media data. Typically , in the case of an image, by a relative URL.
Your OrdAudio object can only provide the mimetype and other metadata when you are building your web page. You must have another endpoint to handle the delivery of binary media.
A simple servlet is typically used, Consider the following servlet. It delivers a HTML form, or Image media, depending on what the request parameter "what" is set to. If "what" is set to "form", it delivers an HTTP form that references this same servlet, except that in the image tag "what" is set to image, where the image object is fetched, and the binary media delivered (with the right mimetype). Just change the Image stuff to audio, the html image tag to an anchor or embed tag, and something like this should work for audio as well.
This is a bit better... , the <img src= is messed up, as are the <h1> tags...
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Types;
import java.sql.PreparedStatement;
import javax.servlet.ServletException;
import javax.servlet.ServletConfig;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.naming.NamingException;
import oracle.jdbc.OracleResultSet;
import oracle.jdbc.pool.OracleConnectionPoolDataSource;
import oracle.jdbc.pool.OraclePooledConnection;
import oracle.jdbc.driver.OracleConnection;
import oracle.ord.im.OrdImage;
import oracle.ord.im.OrdHttpResponseHandler;
import oracle.ord.im.OrdMultipartWrapper;
public class deliveryServlet extends HttpServlet
    OracleConnection conn = null;
    String servletURL = null;
     * Servlet initialization method.
    public void init( ServletConfig config ) throws ServletException
        super.init(config);
     * Get a pooled database connection
    private void getPooledConnection() throws SQLException, NamingException
        javax.naming.InitialContext ic = new javax.naming.InitialContext();
        OracleConnectionPoolDataSource ds = (OracleConnectionPoolDataSource)
                ic.lookup("jdbc/pool/OracleMediaPoolDS");
        OraclePooledConnection pc = (OraclePooledConnection)
                                 ds.getPooledConnection();
        conn = (OracleConnection)pc.getConnection();
        // conn.setAutoCommit(false); // just query. No need for this
     * Process an HTTP GET request used to deliver an image column
    public void doGet( HttpServletRequest request,
                        HttpServletResponse response )
        throws ServletException, IOException
      String id = request.getParameter( "id" );
      String what = request.getParameter( "what" );
      if (!"image".equalsIgnoreCase(what)) what = "form"; // set a default
      if ("form".equalsIgnoreCase(what))
     String servletURL = request.getRequestURL().toString();
        try
       if (conn == null) getPooledConnection();
          PrintWriter out = response.getWriter();
          response.setContentType( "text/html" );
          out.println( "<HTML><BODY>" +
         "<H1>Display Images</H1>" +
            "<FORM action=\"" + servletURL + "\">" +
            " Enter Row ID:<INPUT type=\"text\" name=\"id\" /><BR/>");
          if (id != null)
            PreparedStatement stmt =
              conn.prepareStatement("select description, location, " +
                                           "thumb, image "+
                                  " from photos where id = ?" );
            stmt.setString( 1, id );
            OracleResultSet rset = (OracleResultSet)stmt.executeQuery();
            // Fetch the row from the result set.
            if ( rset.next() )
              // Get columns from query
           String location = rset.getString(1);
           String description = rset.getString(2);
              OrdImage thumb =
                 (OrdImage)rset.getORAData(3, OrdImage.getORADataFactory());
              OrdImage img =
                 (OrdImage)rset.getORAData(4, OrdImage.getORADataFactory());
              out.println("<B>Description: </B>" + description+ "<BR/>");
              out.println("<B>Location: </B>" + location+ "<BR/>");
              if (thumb != null && thumb.getMimeType().startsWith("image/"))
                String thmbWidthStr =  thumb.getWidth() == 0 ? "" :
                                  "WIDTH=\"" + thumb.getWidth()  + "\" ";
                String thmbHeightStr =  thumb.getHeight() == 0 ? "" :
                                  "HEIGHT=\"" + thumb.getHeight()  + "\" ";
                out.println("<B>Thumbnail: </B>" +
                            "<IMG SRC=\"" + servletURL + "?id=" + id +
                                     "&what=image&col=thumb\" " +
                                     thmbWidthStr +
                                     thmbHeightStr +
                             "/>" );
              if (img != null && img.getMimeType().startsWith("image/"))
                String imgWidthStr =  img.getWidth() == 0 ? "" :
                                  "WIDTH=\"" + img.getWidth()  + "\" ";
                String imgHeightStr =  img.getHeight() == 0 ? "" :
                                  "HEIGHT=\"" + img.getHeight()  + "\" ";
                out.println("<B>Image: </B>" +
                            "<IMG SRC=\"" + servletURL + "?id=" + id +
                                     "&what=image&col=image\" " +
                                     imgWidthStr +
                                     imgHeightStr +
                             "/>" );
            else
              // Print not found
              out.println("<H2>Row with ID\"" + id + "\" Not Found</H2><BR/>");
          out.println("</FORM></BODY></HTML>");
        catch (Exception e)
       conn  = null; // Get another connection next time.
          throw new ServletException(e);
      else
        try
       if (conn == null) getPooledConnection();
          String col = request.getParameter("col");
          if (col == null) col = "thumb"; // default to the thumbnail column
          PreparedStatement stmt =
            conn.prepareStatement( "select " + col +
                                   " from photos where id = ? " );
          stmt.setString( 1, id );
          OracleResultSet rset = (OracleResultSet)stmt.executeQuery();
          // Fetch the row from the result set.
          if ( rset.next() )
            // Get the OrdImage object from the result set.
            OrdImage img =
                 (OrdImage)rset.getORAData(1, OrdImage.getORADataFactory());
            // Create an OrdHttpResponseHandler object, then use it to retrieve
            // the image from the database and deliver it to the browser.
            OrdHttpResponseHandler handler =
                new OrdHttpResponseHandler( request, response );
            handler.sendImage( img );
          else
            // Row not found, return a suitable error.
            response.setStatus( response.SC_NOT_FOUND );
          // Close the result-set and the statement.
          rset.close();
          stmt.close();
        catch (Exception e)
       conn  = null; // Get another connection next time.
          throw new ServletException(e);

Similar Messages

  • Play an audio file in JSP or Servlet without asking to save

    Hi,
    I struck with one problem since so many days. My problem is, i am having stream content for ringtones to play in database. In servlet, i am setting the content type to *"audio/x-wav"* and writitng the response to the output stream by retrieving the streaming content from the database.
    The problem is, with Internet Explorer it's a working beauty that it was playing in Windows Media Player without asking for saving. But, the problem is with Mozilla browser which was showing the save as dialog box which i couldn't do.
    Is there any solution that i can play so that audio will be played without opening any player by default provided in the system or can i create a plugin for player in the server so that the player in the server will be opened and played without the need to search for players available in the system.
    Please provide me the solution.

    You need to embed an audio player in your JSP. You can use the HTML <object> tag for this.

  • Jmf to play audio file in jsp

    hi,
    i am using jmf to play an audio file in jsp page.
    when i am trying in my computer it works.but when i am trying to access the application from other networked computer using the ip address,the audio can be hear only in the server system itself,not from where we have accessed the application and play the audio file.
    How can i resolve the issue?
    Thanks and Regards
    jai

    Jaisha wrote:
    ..i am using jmf to play an audio file in jsp page.Why JMF? Core Java has had the ability to play sound since J2SE 1.3, using [Java Sound|http://forums.sun.com/forum.jspa?forumID=541].
    when i am trying in my computer it works.but when i am trying to access the application from other networked computer using the ip address,the audio can be hear only in the server system itself,not from where we have accessed the application and play the audio file.I'm guessing you are a newbie to web development. To get the sound to play on the client, will require an applet or JWS launched application.
    How can i resolve the issue?Write an applet or JWS launched app.

  • How to delete unused audio files in a project?

    Hi guys,
    The question is fairly simple:
    How to delete unused audio files in a project?
    I can't manage to find the answer in the manual,... all I could find is how to delete audio outside used regions!
    But in the projects I use, I have loads of outtakes which I don't use in the project anymore, and now, I would like to delete them of the audio folder to save space on the HD.
    Can Logic select automatically the takes in the audio files folder which are not used in the project and delete them??
    Because there is hundreds of audio files per project, and +/- 50 projects, I just can't do it manually.
    Thanks,
    Fred

    Whoops! Yes, I knew that but a cow flew by... Sorry!
    The procedure I follow is to do what I described then Save as Project, creating a project folder. That way only the required audio is saved to the folder and I delete all temporary stuff. However, if you have folders with shared material, it's much harder and would require you to go through all your projects doing Save as Project before you could delete your old working folder.
    When doing day to day work, best practice is to create a new folder and only use Save as Project when you're working on stuff. Shared material (eg sample libraries etc) can go elsewhere and you can get Logic to copy those to the project folder automatically.
    Otherwise, Shift-Backspace in the Audio window, as you rightly say
    Pete

  • How to add an audio file to a link

    I am working on a project using IWeb and I am trying to figure out if it is possible and then, if it is how to add an audio file to a link. I would really be glad of your help as I am having problems meeting the requirements of the project if I don't make it work.
    Also, is it possible when having added a movie clip from quick time player to have the clip start as soon as the page is "opening", that is without pressing the play button?
    I am waiting in great suspense to see if anybody can help me out. If you have the answers to my questions, please send me an email at [email protected] - thank you so much :o)

    Hi Maiken
    Welcome to the discussion forums.
    All you need is open iWeb, select text or image, open inspector, go to link, check the "enable as a hyperlink" box, in "link to" there's a teardown menu where you select "a file" and select the file you want to link to.
    If you want to have it downloading look at [this|http://alyeska.altervista.org/en/iWeb_Downloads.html]
    For the second question:
    select the movie file in iWeb go to inspector, then to the last icon (showing the quicktime logo) and check the box that say "Autoplay".
    Regards,
    Cédric

  • How to import a jar file in JSP

    How to import a Jar file in JSP Page.
    please reply its very urgent!

    Hey I am facing a similar problem:
    I have this jar file lbswebservice.jar that I have to use for my application.
    I added it to the classpath, I copied it in my WEB-INF/lib folder, but when I try to access classes in this package, it doesnt work.
    For example the jar contains the package com.blipsystems.lbs.ws.messages.* ; that contains different classes, like the Campaign class.
    I tried to use this class (just to create an object) in different context (through jsp, or just through java test classes), but it never works, i get the error: com.blipsystems.lbs.ws.messages.Campaign cannot be resolved to a type
    I am a bit desperate here...

  • How do I transfer audio files from my laptop to my iPod classic

    How do I transfer audio files from my laptop to my iPod

    Thank you for using the Apple Support Communities
    You can synchronize audio files from iTunes to your iPod.
    https://www.apple.com/support/ipodclassic/how-to/
    -Zeph

  • How do I fuse audio files together?

    Hey, I'm finishing up the editing for my full-length horror feature, and currently I'm putting in the sound effects and I was trying to figure out how can I fuse audio files together?
    Here's the thing, my video files are files I converted into AVIs from VOBs, only problem is that the audio disappeared from them, but my friend tried to load all my VOBs into AVIs for me since I did something wrong but when he converted them the video was gone but the audio was there...so I figured I'd just take the audio and put it in place.
    Right now I have to put in a sound effect of the guy screaming while gory sounds are playing in the background, then after that I have a chainsaw scene where a woman screams, a chainsaw blases, a mechanical laughter is heard, and gory sounds are playing all together.
    If you could help me figure out how to get the files to fuse together to play the sounds all together, knowing I have to change the volume for each one, that would be very much appreciated. Thanks!
    -Toby

    Ah, those scroll bars. They don't stand out, as much, as I would like. I always overlook the ones in the Share Panel, though I have used them many times.
    Unfortunately, PrE has chosen an arrangement, where Audio & Video Tracks are grouped. I like the PrPro layout, where all Video Tracks are above a "centerline" and all Audio Tracks are below that.
    About the closest that one can come in PrE is to use Delete Unused Tracks, to remove empty Video Tracks, or to View Video Tracks (alone), or View Audio Tracks (alone). With a combo of those, one can customize the Timeline a bit.
    When cleaned up, one can then Add Tracks, for any additional Audio Tracks necessary.
    If one did ONLY the View Audio, they loose the ability to refer to the Video Track, and with SFX, that is necessary, at least for me.
    I like to keep each type of Audio on its own Track. That makes actions, like applying Track Keyframes, or adjustments to JUST that Clip, or Clip type. If I have SFX, music, camera Audio, and other Audio sources, I will put many SFX on their own Audio Track, the camera Audio on another, and then the music one one, or more additional Audio Tracks. Not too long ago, I had one Project with about 10 separate SFX Audio Tracks, one for a "loon," one for "crickets," three for "frogs," one for "pond ambiance," and then two for music (as I was doing faux DD 5.1 SS in PrPro), with one from Music F (front) and Music R (rear).
    Good luck, and happy editing,
    Hunt

  • How to display a pdf file in jsp

    hi,
    How to display a pdf file in jsp iam having a class which will return fileinputstream of the file object. the pdf file is in server.
    regards
    Arul

    A JSP is a combo of HTML and Java, so you can't really "display" a PDF file in a JSP.
    You can provider a href link to the PDF file in your JSP.
    You can use some utility package to read the contents of the PDF, pull certain things out of it, and display that in your JSP as html
    In a servlet you can set the content type to application/pdf and write the binary data of the PDF back to the browser. Once the browser finishes reading in the data it should open the PDF.

  • The audo files do not play from websites instead ask for download. This has occured from the time I have updated Firefox 4 to Firefox 5. Why? And how can i play audio files?

    The audo files do not play from websites instead ask for download. This has occured from the time I have updated Firefox 4 to Firefox 5. Why? And how can i play audio files from websites?

    You have a <b>general.useragent.override</b> pref that identifies you as Firefox/3.5.7
    *Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 (.NET CLR 3.5.30729)
    See:
    *https://support.mozilla.com/kb/Websites+or+add-ons+incorrectly+report+incompatible+browser
    *http://kb.mozillazine.org/Resetting_your_useragent_string_to_its_compiled-in_default

  • How does Airplay transfer audio file format to an Airport Express?

    Hi, everyone
    How does Airplay transfer audio file format to an Airport Express?
    Many from the Internet claim that iTunes encodes an AIFF file format into an Apple Lossless Audio Codec (ALAC) file format before sending signal to an Airport Express.
    Is that true?
    If so, would it still make sense for me to have AIFF files on my music server
    or should I have ALAC files instead?
    Please advise.
    Thank you.
    BR,
    George Lien

    Many from the Internet claim that iTunes encodes an AIFF file format into an Apple Lossless Audio Codec (ALAC) file format before sending signal to an Airport Express.
    Is that true?
    Yes. The AirPort Express Base Station (AX) works only with iTunes v4.6+ and is limited to music files that iTunes can read; ie, 16-bit data only. These data, though, can be in any file format that iTunes recognizes, from lossy MP3s at the low-quality end of the spectrum to Apple Lossless and lossless AIFF or WAV files at the high end. It is also important to note that the AX functions only at a 44.1kHz sample rate. When you play 32kHz or 48kHz data, iTunes sample-rate-converts the data in real time before sending it to the AX.
    iTunes uses a QuickTime CODEC to convert audio files to Apple Lossless, and then, uses AirPlay to send them to the AX. In turn, the AX uses built-in software that converts the Apple Lossless to an Encoded Digital Audio format. From there, digital audio is sent to a optical transceiver to convert the electrical signal to an optical one before sending it to the innermost part of the audio port. For analog, the AX has a built-in DAC to convert the Encoded Digital Audio to Analog which is sent to the same audio port.
    If so, would it still make sense for me to have AIFF files on my music server
    or should I have ALAC files instead?
    If you have audio files in both formats, I would elect just to keep the ALAC (.m4a) files on the music server.

  • How do you consolidate audio files in Premiere? (Make multiple audio files on a track one file)

    How do you consolidate audio files in Premiere? (Make multiple audio files on a track one file). Also, my client is having a hard time making an omf that Pro Tools can read. The files can not be found by Pro Tools. How do you make an omf that Pro Tools can read?

    Multichannel export;
    http://strypesinpost.com/2012/11/exporting-multichannel-quicktimes-in-premiere-pro/
    When you export the OMF, select Encapulate Files in the Settings window

  • How do you get audio files to loop instead of playing just once.

    how do you get audio file to loop instead of playing just once.
    Thanks

    This forum is specifically meant  for Edge Inspect issues. Could you please let us know the product your query is related to. We will redirect you to the correct forum.

  • How do I download audio files

    How do I download audio files? I downloaded an app that has audio but was told I needed to come to ITunes first to download audio files! Help!

    Does the app not have a link to the developer's site (with a manual/guide) on its description page in the store ? I assume that it means that you need to connect the iPad to your computer's iTunes and use the file sharing section on your computer's iTunes to copy content into it : file sharing.

  • Deploying a WAR file containing .jsp and servlets (also uses JNI)

    Deploying a WAR file containing .jsp and servlets (also uses JNI) on Windows 2000
    We had problems making it initially work on Sun ONE Web Server 6.0 Service Pack 1 because of lack of good iPlanet Web
    Server documentation on deploying such files.
    This is how we went about it:
    1) Make one of the servlet and JSP (must call another Java Class) web application (.war) examples work with iPlanet Web
    Server.
    C:\iPlanet\Servers\plugins\servlets\examples\web-apps\HelloWorld\HelloWorld.war
    and
    C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    a) Go to your Web Server Administration to deploy the application using GUI Web Application Deploy.
    (We usually use command line, we experienced some issues with the GUI version, but maybe it is fixed in the new Web Server
    service packs)
    From browser, open http://yourserver:8888/
    Click on Select a Server:Manage
    Click on Virtual Server Class
    Click on https-yourserver
    Click on the Web Applications Tab
    Then, click on Deploy Web Application
    Enter the following -
    WAR File On: Local
    WAR File Path: C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    Application URI: /jakarta
    Installation Directory: c:\iPlanet\examples\jakarta-examples
    By clicking on OK it deployed the application.
    I can verify that it is deployed by selecting "Edit Web Applications" and I see the following entry:
    Edit     /jakarta     c:/iPlanet/examples/jakarta-examples
    Also, c:/iPlanet/examples/jakarta-examples should have the similar following directory structure ..
    - [images]
    - [jsp]
    - index.html
    - [servlets]
    - [META-INF]
    - [WEB-INF]
    - [classes]
    - [tlds]
    - web.xml
    - index.html
    I restarted the server and accessed it using the following URL from my IE browser:
    http://yourserver/jakarta/index.html
    Then I clicked on the JSP Examples and tried some JSP examples.
    b) Alternatively, you can also deploy the same example from the command-line.
    Make sure C:\iPlanet\Servers\bin\https\httpadmin\bin\ is in your path
    wdeploy deploy      -u /jakarta
              -i yourserver
              -v https-yourserver
              -d c:\iplanet\examples\jakarta-examples
              C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    Restart the web server (I don't think you have to restart, but .. might as well).
    2)Deploy your web-application
    My Foo.war has the following structure.
    You can use jar tf Foo.war to look at the file contents from command line (assuming you have JDK installed and the bin is
    in your PATH)
    Foo.war
    - [META-INF]
    - [WEB-INF]
    - web.xml
    - [classes]
    - Bar.class
    - MoServlet.class
    - [lib]
    - ThirdParty.jar
    - [natlib]
    - extlib.dll
    - foo.jsp
    Here is our application scenario:
    foo.jsp uses a class call Bar (it is not in any package). The Bar java class uses classes from ThirdParty.jar. The
    ThirdParty.jar in turn uses JNI to load library extlib.dll. foo.jsp also calls /servlet/Mo as well.
    Now to deploy it, do the following:
    (a) Make sure that within foo.jsp, you import the Bar class ( I don't know why you have to do it, but if you don't you get
    JSP compile error).
    <%@page language="java" import="Bar" contentType="text/html"%>
    (b) Check web.xml (for Servlets)
    Within web.xml, make sure you have the following mappings:
    <servlet>
    <servlet-name> MoLink </servlet-name>
    <servlet-class> MoServlet </servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name> MoLink </servlet-name>
    <url-pattern> /servlet/Mo </url-pattern>
    </servlet-mapping>
    (c) Deploy the application
    Using command line:
    wdeploy deploy      -u /foo
              -i yourserver
              -v https-yourserver
              -d c:\iplanet\examples\foo-dir
              Foo.war
    (d) Change web-apps.xml file (for picking up ThirdParty.jar)
    It is located in
    C:\iPlanet\Servers\https-yourserver\config
    You should see something similar to following after successful deployment.
    <web-app uri="/foo" dir="C:\iPlanet\examples\foo-dir" enable="true"/>
    Change it to look like following to pick up the ThirdParty.jar
    <web-app uri="/foo" dir="C:\iPlanet\examples\foo-dir" enable="true">
    <class-loader reload-interval="300"
              classpath="C:/iPlanet/examples/foo-dir/WEB-INF/lib/ThirdParty.jar"
              delegate="false"/>
    </web-app>
    (e) Change jvm12.conf file (for JNI)
    It is located in
    C:\iPlanet\Servers\https-yourserver\config
    Add or uncomment the following lines:
    #optional - just helps with instrumenting the jsp and servlet code
    jvm.include.CLASSPATH=1
    jvm.enableDebug=1
    nes.jsp.enabledebug=1
    jvm.trace=7
    jvm.verboseMode=1
    #required for JNI
    java.compiler=NONE
    jvm.classpath=.;C:\JDK1.3.1\lib\tools.jar;C:/iPlanet/Servers/plugins/servlets/examples/legacy/beans.10/SDKBeans10.jar;
    jvm.option=-Xrs
    jvm.option=-Xnoagent
    # not sure if this is needed for iPlanet web server
    jvm.option=-Djava.library.path=C:/iPlanet/examples/foo-dir/natlib/ -Djava.compiler=NONE
    (f) Change magnus.conf file (for JNI)
    We HAD to change this file in order for ThirdParty.jar file to pick up the native C++ code using JNI. Apparently, the
    iPlanet Web Server doesn't pick the Environment Variable Path. Because when we had the directory containing the DLL just
    in Path, it didn't work.
    Change Extrapath directive:
    ExtraPath C:/iPlanet/Servers/bin/https/bin;${NSES_JRE_RUNTIME_LIBPATH}
    to
    ExtraPath c:/iPlanet/examples/foo-dir/natlib;C:/iPlanet/Servers/bin/https/bin;${NSES_JRE_RUNTIME_LIBPATH}
    (g) Apply changes from the Web Server Administration Console and Restart the web server.
    You should be able to see the behaviour that you want from your application.
    http://yourserver/foo/foo.jsp
    Hope this was helpful!!!
    Sonu

    Deploying a WAR file containing .jsp and servlets (also uses JNI) on Windows 2000
    We had problems making it initially work on Sun ONE Web Server 6.0 Service Pack 1 because of lack of good iPlanet Web
    Server documentation on deploying such files.
    This is how we went about it:
    1) Make one of the servlet and JSP (must call another Java Class) web application (.war) examples work with iPlanet Web
    Server.
    C:\iPlanet\Servers\plugins\servlets\examples\web-apps\HelloWorld\HelloWorld.war
    and
    C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    a) Go to your Web Server Administration to deploy the application using GUI Web Application Deploy.
    (We usually use command line, we experienced some issues with the GUI version, but maybe it is fixed in the new Web Server
    service packs)
    From browser, open http://yourserver:8888/
    Click on Select a Server:Manage
    Click on Virtual Server Class
    Click on https-yourserver
    Click on the Web Applications Tab
    Then, click on Deploy Web Application
    Enter the following -
    WAR File On: Local
    WAR File Path: C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    Application URI: /jakarta
    Installation Directory: c:\iPlanet\examples\jakarta-examples
    By clicking on OK it deployed the application.
    I can verify that it is deployed by selecting "Edit Web Applications" and I see the following entry:
    Edit     /jakarta     c:/iPlanet/examples/jakarta-examples
    Also, c:/iPlanet/examples/jakarta-examples should have the similar following directory structure ..
    - [images]
    - [jsp]
    - index.html
    - [servlets]
    - [META-INF]
    - [WEB-INF]
    - [classes]
    - [tlds]
    - web.xml
    - index.html
    I restarted the server and accessed it using the following URL from my IE browser:
    http://yourserver/jakarta/index.html
    Then I clicked on the JSP Examples and tried some JSP examples.
    b) Alternatively, you can also deploy the same example from the command-line.
    Make sure C:\iPlanet\Servers\bin\https\httpadmin\bin\ is in your path
    wdeploy deploy      -u /jakarta
              -i yourserver
              -v https-yourserver
              -d c:\iplanet\examples\jakarta-examples
              C:\iPlanet\Servers\plugins\servlets\examples\web-apps\jakarta-examples\jarkarta-examples.war
    Restart the web server (I don't think you have to restart, but .. might as well).
    2)Deploy your web-application
    My Foo.war has the following structure.
    You can use jar tf Foo.war to look at the file contents from command line (assuming you have JDK installed and the bin is
    in your PATH)
    Foo.war
    - [META-INF]
    - [WEB-INF]
    - web.xml
    - [classes]
    - Bar.class
    - MoServlet.class
    - [lib]
    - ThirdParty.jar
    - [natlib]
    - extlib.dll
    - foo.jsp
    Here is our application scenario:
    foo.jsp uses a class call Bar (it is not in any package). The Bar java class uses classes from ThirdParty.jar. The
    ThirdParty.jar in turn uses JNI to load library extlib.dll. foo.jsp also calls /servlet/Mo as well.
    Now to deploy it, do the following:
    (a) Make sure that within foo.jsp, you import the Bar class ( I don't know why you have to do it, but if you don't you get
    JSP compile error).
    <%@page language="java" import="Bar" contentType="text/html"%>
    (b) Check web.xml (for Servlets)
    Within web.xml, make sure you have the following mappings:
    <servlet>
    <servlet-name> MoLink </servlet-name>
    <servlet-class> MoServlet </servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name> MoLink </servlet-name>
    <url-pattern> /servlet/Mo </url-pattern>
    </servlet-mapping>
    (c) Deploy the application
    Using command line:
    wdeploy deploy      -u /foo
              -i yourserver
              -v https-yourserver
              -d c:\iplanet\examples\foo-dir
              Foo.war
    (d) Change web-apps.xml file (for picking up ThirdParty.jar)
    It is located in
    C:\iPlanet\Servers\https-yourserver\config
    You should see something similar to following after successful deployment.
    <web-app uri="/foo" dir="C:\iPlanet\examples\foo-dir" enable="true"/>
    Change it to look like following to pick up the ThirdParty.jar
    <web-app uri="/foo" dir="C:\iPlanet\examples\foo-dir" enable="true">
    <class-loader reload-interval="300"
              classpath="C:/iPlanet/examples/foo-dir/WEB-INF/lib/ThirdParty.jar"
              delegate="false"/>
    </web-app>
    (e) Change jvm12.conf file (for JNI)
    It is located in
    C:\iPlanet\Servers\https-yourserver\config
    Add or uncomment the following lines:
    #optional - just helps with instrumenting the jsp and servlet code
    jvm.include.CLASSPATH=1
    jvm.enableDebug=1
    nes.jsp.enabledebug=1
    jvm.trace=7
    jvm.verboseMode=1
    #required for JNI
    java.compiler=NONE
    jvm.classpath=.;C:\JDK1.3.1\lib\tools.jar;C:/iPlanet/Servers/plugins/servlets/examples/legacy/beans.10/SDKBeans10.jar;
    jvm.option=-Xrs
    jvm.option=-Xnoagent
    # not sure if this is needed for iPlanet web server
    jvm.option=-Djava.library.path=C:/iPlanet/examples/foo-dir/natlib/ -Djava.compiler=NONE
    (f) Change magnus.conf file (for JNI)
    We HAD to change this file in order for ThirdParty.jar file to pick up the native C++ code using JNI. Apparently, the
    iPlanet Web Server doesn't pick the Environment Variable Path. Because when we had the directory containing the DLL just
    in Path, it didn't work.
    Change Extrapath directive:
    ExtraPath C:/iPlanet/Servers/bin/https/bin;${NSES_JRE_RUNTIME_LIBPATH}
    to
    ExtraPath c:/iPlanet/examples/foo-dir/natlib;C:/iPlanet/Servers/bin/https/bin;${NSES_JRE_RUNTIME_LIBPATH}
    (g) Apply changes from the Web Server Administration Console and Restart the web server.
    You should be able to see the behaviour that you want from your application.
    http://yourserver/foo/foo.jsp
    Hope this was helpful!!!
    Sonu

Maybe you are looking for