HTML embedded servlet

Hi,
I am after some advice on Servlets. I have a web site running on Microsoft IIS 5.0. :( I need to write a HTML page that shows some static text (no problems here) and connects to an Oracle database that holds some images broken up into 2K chunks. To do this I was trying to write a servlet that was embedded in this HTML page.
I have written the servlet and it connects to the database retrieves the image data and stores it in a ByteArrayOutputStream without a problem. I then convert this ByteArrayOutputStream to a byte array so I can write the image data to the screen using the response.getOutputStream().write(byte[]) method. The trouble is the response writer (I think that's what it's called) is already in use so when I call the getOutputStream method the servlet throws an exception.
Can someone:
1. Tell me if what I am trying to achieve is possible by calling a Servlet embedded in a HTML page. (I know it is possible when you are running a java web server and call the servlet from the url)
eg.
<body>
<p>Output from servlet</p>
<hr>
<servlet
codebase=""
code="displayimage.DisplayImage.class"
>
</servlet>
<hr>
</body>
2. If it is possible, how do I call the getOutputStream method without throwing an exception OR write the byte array to the client using the current writer that is in use (PrintWriter).
I have tried numerous things such a setting the content type of the response to "image/jpeg" and converting the ByteArrayOutputStream to a string and writing this to the client with out success.
Help would be greatly appreciated.
Andrew

Hi Andrew,
1.
I notice that you try to display an Image from the Oracle database and have some problem.
There is another developer by the name Daizz that had the same problem. You may try contact to see how Daizz solve the issue.
2. Please look the subject:
problem about display jpg image in jsp daizz 3 Nov 12, 2001 11:39 PM
You can send Daizz an email to see.
--Paul

Similar Messages

  • Calling EJB with HTML via SERVLET

    Hi,
    I used a writen example that calls EJB from HTML via SERVLET. Example name is Bonus. The problem I have is that the HTML throw error while calling SERVLET. I dont figure out what seams to be a problem. Someone know?
    I wonder if the problem is in servlet? The EJB is fine!
    christian
    HTML CODE:(bonus.html)
    <HTML>
    <HEAD>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1250"/>
    <TITLE>untitled1</TITLE>
    </HEAD>
    <BODY BGCOLOR = "WHITE">
    <BLOCKQUOTE>
    <H3>Bonus Calculation</H3>
    <FORM METHOD="GET" ACTION="BonusAlias">
    <P>Enter social security Number:<P>
    <INPUT TYPE="TEXT" NAME="SOCSEC"></INPUT>
    </P>
    Enter Multiplier:
    <P>
    <INPUT TYPE="TEXT" NAME="MULTIPLIER"></INPUT>
    </P>
    <INPUT TYPE="SUBMIT" VALUE="Submit">
    <INPUT TYPE="RESET">
    </FORM>
    </BLOCKQUOTE>
    </BODY>
    </HTML>
    SERVLET CODE:(BonusServlet.java)
    package mypackage5;
    import mypackage5.Calc;
    import mypackage5.CalcHome;
    import mypackage5.impl.CalcBean;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import javax.naming.*;
    import javax.rmi.PortableRemoteObject;
    import java.beans.*;
    public class BonusServlet extends HttpServlet {
    CalcHome homecalc;
    public void init(ServletConfig config) throws ServletException{
    //Look up home interface
    try{
    //InitialContext ctx = new InitialContext();
    //Object objref = ctx.lookup("Calc");
    //homecalc = (CalcHome)PortableRemoteObject.narrow(objref, CalcHome.class);
    Context context = new InitialContext();
    CalcHome calcHome = (CalcHome)PortableRemoteObject.narrow(context.lookup("Calc"), CalcHome.class);
    Calc calc;
    catch (Exception NamingException) {
    NamingException.printStackTrace();
    public void doGet (HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    String socsec = null;
    int multiplier = 0;
    double calc = 0.0;
    PrintWriter out;
    response.setContentType("text/html");
    String title = "EJB Example";
    out = response.getWriter();
    out.println("<HTML><HEAD><TITLE>");
    out.println(title);
    out.println("</TITLE></HEAD><BODY>");
    try{
    Calc theCalculation;
    //Get Multiplier and Social Security Information
    String strMult = request.getParameter("MULTIPLIER");
    Integer integerMult = new Integer(strMult);
    multiplier = integerMult.intValue();
    socsec = request.getParameter("SOCSEC");
    //Calculate bonus
    double bonus = 100.00;
    theCalculation = homecalc.create();
    calc = theCalculation.calcBonus(multiplier, bonus);
    catch (Exception CreateException){
    CreateException.printStackTrace();
    //Display Data
    out.println("<H1>Bonus Calculation</H1>");
    out.println("<P>Soc Sec: " + socsec + "<P>");
    out.println("<P>Multiplier: " +
    multiplier + "<P>");
    out.println("<P>Bonus Amount: " + calc + "<P>");
    out.println("</BODY></HTML>");
    out.close();
    public void destroy() {
    System.out.println("Destroy");

    The error is that page cannot be found! When I run only the servlet it works, when I run the HTML page and enter the field throws eror that the page cannot be found!
    thanks
    Christian

  • WebLogic Server vs Embedded Servlet Engine

    We have licensing for WebLogic Server, and I was wondering if there were any benefits to using it over the embedded servlet engine for hosting Collaboration 4.5 or Publisher 6.4?

    hi.
    WebLogic Express supports the following:
    Servlets, JSP, JDBC, JNDI, JTA, JAAS, JAXP, RMI, and clustering. You
    can build a cluster of WLExpress instances.
    Hope this helps,
    Michael
    Laurent PAILLARD wrote:
    What are the differences between Server and Express. I've read that
    Express does not implement EJB, JMS and two-phase commit protocol for
    transaction. Nothing is said about clustering. As Servlet session can
    be clustered, I wish to know if I can build a cluster with 2 Weblogic
    Express instances.--
    Michael Young
    Developer Relations Engineer
    BEA Support

  • Jsp/html form- servlet- xml parsing

    does anyone have an example or know of a place where I can get code
    which passes XML from jsp/html to servlet which parses the xml???
    will be appreciated..........thanks

    Hi,
    Are u trying to acheive indpendent of browser solution or just want to know the things..
    well,I have one idea ok.
    Using JavaScript Constructs the XmL as u want, "let say
    <root><name>Lokesh</name><age>25</age></root>" before submitting the page(I mean frm.submit()) assign to a hidden variable, since you have post kind of submit back at the servlet from the request object get the value and store it as String and using StringReader you just parse the XML
    Just try the above one the below code
         public org.w3c.dom.Document getXMLDocument() throws IllegalStateException,Exception
                        if (!containsXMLDocument())
                                  throw new IllegalStateException("This request does not contain an XMLDocument");
                   javax.xml.parsers.DocumentBuilderFactory dbf=javax.xml.parsers.DocumentBuilderFactory.newInstance();
                   javax.xml.parsers.DocumentBuilder db=dbf.newDocumentBuilder();
                   java.io.StringReader strRdr=new java.io.StringReader(_xmlString);
                   org.xml.sax.InputSource ipSrc=new org.xml.sax.InputSource(strRdr);
                   org.w3c.dom.Document doc=db.parse(ipSrc);
                   return doc;
    best of luck..
    With Regards
    Lokesh T.C

  • Dynamic PL/SQL Report with html embedded in result

    Hi,
    I am trying to embed an html image tag element in an query result. I have followed the how to example (MS SQL down; Oracle up) successfully. However I now require the query to be dynamic based upon sone filtering criteria simalar to the how to example:
    So the query code looks something like this:
    <p>
    declare
    <p>
    q varchar2(1000);
    <p>
    begin
    <p>
    q:= ' select ';
    <p>
    q:= q || ' decode(status, ';
    <p>
    q:= q || ' 1, ''&lt;img src="up.gif"&gt;'', ';
    <p>
    q:= q || ' 0,''&lt;img src="down.gif"&gt;'') status, ';
    <p>
    q:= q || ' item_id item ';
    <p>
    q:= q || ' from item_table ';
    <p>
    return q;
    <p>
    end;
    (note this is a simplified example)
    The problem is that the image does not display and I think it is because of the double quotes - " - embedded within the query string for the html image element.
    Can anyone help, point out my error or suggest an more appropriate implementation.
    Thank for any help!
    sinclair

    Sorry for the previous post. Here is what I did based on your example:
    http://htmldb.oracle.com/pls/otn/f?p=31517:1
    and it works.
    The query is like:
    DECLARE
    q VARCHAR2 (1000);
    BEGIN
    q := q || 'SELECT deptno, DECODE(deptno, ';
    q := q || '10, ''&lt;img src=" #IMAGE_PREFIX#bullet1.gif" >'',';
    q := q || '20, ''&lt;img src=" #IMAGE_PREFIX#bullet2.gif" >'',';
    q := q || '30, ''&lt;img src=" #IMAGE_PREFIX#bullet3.gif" >'',';
    q := q || '40, ''&lt;img src=" #IMAGE_PREFIX#bullet4.gif" >'') ';
    q := q || 'image, dname FROM DEPT ';
    RETURN q;
    END;
    In your query you wrapped the image file name in double quotes, which wasn't necessary.
    Denes Kubicek

  • How to dynamically generate HTML in Servlet without all the out.println?

    Since I am not sure whether this is a Java Servlet or JSP problem, so I will describe my situation. And hopefully someone can propose a good solution. I came from a PHP, so Java Servlet and JSP are still a little bit foreign for me.
    My problem
    My front end is a JSP page that essentially contains a form (let’s call it form1). The reason it is a JSP not a HTML is because I will need to load form data from the backend and display them in the form. Once the user submits the form, it will go to a backend Java Servlet (let’s call it servlet 1), which loads data from files according to user input. Then, I will need to dynamically create a new form (let’s call it form2) based on the data loaded from files. Once the user inputs and submits form2, another Java Servlet (servlet 2) will do more processing. That is the end of line. Both form1 and form2 require Javascript.
    My question is that since servlet 1 will need to dynamically create form2. I naturally will want a presentation control. Instead of doing out.println(“html code”), I want to use JSP and write direct HTML code. On the other hand, can JSP be used as a form action? So basically, in form 1, can I do <form action=”…/xxx.jsp”> I think I saw something like this, but I lack the comprehensive JSP knowledge to know for sure. More importantly, if hypothetically JSP can be used, how do I handle functions such as doGet(HttpServletRequest request, HttpServletResponse response), which is used in servlet1.
    Thank you,
    M

    no, servlets should not be used to generate a view, that is what a JSP is for. So let your backend servlet fetch the data, put it for example as attributes of the request scope (request.setAttribute()) and then forward control to a JSP that will generate the view, based on the information you stored in the request scope. That is the proper way of using servlets & JSPs; use servlets to invoke business logic classes, use JSPs combined with JSTL to generate the view. If you do it properly, you don't need ANY java code in your JSP.

  • MIME Multipart/related to embed images in html files - Servlet

    Hello,
    My goal is to embed images in html/xhtml files to decrease latency when using slow networks. Think about mobile phones, if I have 10 images in one page, I will have 11 requests/responses to get the whole page.
    The solution would be to embed all images using Content-type multipart/related, so I have one request to the whole pack.
    How to do that in java? I mean, I need to set the content-type and build all parts encoding the images to base64.
    I tried JavaMail API, there I can build messages like this and instead of send an e-mail, I can write:
    myMimeMultipart.writeTo(response.getOutputStream());
    The problem is: I am getting everything as text in my browser, including the MIME headers of each part. Another think is that the first header (the main one) doesn't appear too.
    Any thoughts/other ideas?
    Thanks in advance,
    Andr� Carlucci

    If memory serves me right, I believe in the Servlet spec you have access to the Response object. You "should" be able to set any headers you need there. In addition, you can get the output streams just as you described.
    I did a similar thing, although slightly modified, to output dynamically-generated XLS (Excel Spreadsheet) files using a reporting engine called JasperReports. It wasn't a multipart response, however, so you may need to figure out how to handle that part of it, but in my case I set the mime-type header, then grabbed the output and started writing my XLS file too it. Once done, you close the streams and return the response. Worked perfect.

  • Base64 decoding - perl & openssl vs. html embedded image

    I am having a strange problem. I have a TIFF image stored in a SQLite database encoded as Base64. When I retrieve the Base64 characters, save them to a file using an applescript writing a utf-8 text file to disk (or just saving it in TextWrangler), and then try to feed that file into openSSL using the Base64 decoding option, I get an empty file or just a small (not nearly large enough) file that will not open. BUT! When I put that same string into a img tag using base64 decoding in an HTML document, it displays properly in a browser window. Anyone have an idea why this might happen? It does not work using perl either.
    The html code is here: http://web.me.com/danaleighton/base64.html
    The file I am feeding into openSSL is here: http://web.me.com/danaleighton/base64sm.txt
    I am using the following command: openssl enc -base64 -d -in base64sm.txt -out testscript.tiff
    This perl command also does not work: perl -i.txt -MMIME::Base64 -e 'undef $/;while(){print decode_base64($_);}' base64sm
    Thanks in advance for any help!!!

    it's most likely the text you're extracting from the database is either corrupted or wasn't encoded as you expect. Note that your success with the img tag decoding may be misleading. I can't give you details that apply to this case, but browsers typically use smarter decoding tools which are more robust ...
    1) Was the text in the database produced by an internal encoder or was it obtained either from a standard e-mail attachment or produced by this command or its equivalent?:
    Thanks Ray - I was afraid of that. I am extracting the image from a database written by a commercial application. I checked with the developers, and they said it was base64, so that's all I have to go on. I reported this anomaly to them but haven't heard back in over a week.
    2) Are you sure you're retrieving exactly the same bytes that were stored in the database?
    As sure as I can be. For testing, I invoke sqlite from a shell to do the select statement and dump the result to the terminal. Then copy and paste from terminal to a TextWrangler document. I have done the same with an Applescript.
    One complicating factor: the text stored in the database has these weird markup tags that I can't find any documentation. They look like this: <iimg><preferredFilename>Embedded image</preferredFilename><segment>TU0AK...=
    </segment><segment>UdSVL...=
    </segment></iimg>
    I strip these out of the field coming from the database.
    To isolate the problem...
    Unfortunately, since I am not creating the database, I am loath to write to it. I could, but since the problem is likely in the way the developers are encoding or storing the data, it wouldn't do much to solve my problem...
    Thanks so much for your suggestions!! Very helpful.

  • Robohelp html embedded code

    if you use conditional build tags when you publish to html,
    robohelp publishes ALL of the details of the tags in the html page
    - yes it does not show, but search engines do nto care.....
    Also, every html page has robohelp embedded in pages that you
    cannot remove so if you use it as a tool to publish to html, your
    customers can figure out what you use?
    Anyone know how to remove this? I talked to support about 10
    times, sent my files and they never did get back to me.
    Thanks
    Steve

    Hi again Steve
    Ummm, I think you are a bit confused. You said:
    Sorry that was after a 30 minute hold call with yoru customer
    support and then I was told that robohelp was longer around and was
    replaced by Captivate....
    For starters, even though I have a rather officious looking
    Adobe logo near my forum handle, I'm not an Adobe employee. I'm
    just a user same as you. I've just been around enough and answered
    enough posts and generally tried to be helpful. As a result, I've
    earned a bit of recognition.
    If Adobe support actually told you RoboHelp was replaced by
    Captivate, they are dead wrong. Captivate is a totally different
    application. That's about like saying Microsoft Word was replaced
    by Photoshop.
    I once contracted with a web hosting reseller that did
    something similar. Even though we were using RoboHelp, he wasn't
    overly concerned with the behind the scenes references. But to each
    his own.
    Without actually seeing both the before and after code, it's
    very difficult to say what may or may not be controlled. To be very
    honest, I'm having a bit of a struggle with visualizing what may
    actually be occuring. I don't suppose you could toss together a
    simple two or three topic help file that exhibits the issue and let
    us look it over? I'm not suggesting I'd have an answer for you. But
    there are a good many bright folks here that have all sorts of
    different expertise. You never know what you might find.
    Cheers... Rick

  • HTML embeded video is not playing on DMP

    We had created asp.net website first page is outputing a simple grid control that is working perfectly fine. On second page we had embed a video that is playing inside the media player control through html.
    Second page is blank on DMP, please suggest way forward as if we view the same website to a normal PC both of the pages are working.
    Any help in this regard will be highly appriciated.

    Hi Muhammad,
    Playing the video embedded in HTML is not a very good idea on DMP since the built-in DMP browsers has some limitations compared to a laptop one.
    As per the DMS content creation best practices, it is already not advised to use pages generated by ASP.net: http://www.cisco.com/en/US/docs/video/digital_media_systems/5_x/5_2/dmd/best/practices/guidelines.html#wp1167395
    To solve your problem, maybe you could consider using a playlist that would first display the html page you've created and would then display your video as a content taken from the DMM and not embedded into HTML?
    You would end up with something that would look more or less like this:
    Regards,
    Nicolas

  • AIR 3.0 mx:HTML embedded fonts in external swf - silent craziness

    The recent upgrade to AIR 3.0 has hosed our application.  We rely heavily on an mx:HTML control to render the UI of our application using javascript and HTML templates.  Everything has been working great in production for months, until Adobe released AIR 3.0 last week.  We use embedded fonts in our application that our defined in an external .swf (loaded at runtime).  The HTML control loads a .css file that references the name of our embedded font "ArialEmbedded" and it all worked great.  But now, with 3.0 it does not respect anything in the external .swf.  We get the default Times New Roman font in all of our content, and the app crashes with reliability (in debug mode and release mode) without any exceptions being thrown.
    Using the Windows Debugger, I have been able to track it down to this call consistently - Webkit!cairo_pattern_get_type with an Access Violation erros - c0000005 . 
    After some Googling, it seems webkit uses Cairo for the graphics rendering portion of the library, and in this case it is trying to render a specific color.
    1) I've tried forcing the moduleLoader on the HTML control to use the moduleLoader of the parent Spark component - to no avail.
    2) Did something change with style management and loading external .swf files?
    3) Any other help?  At this point, I have no idea where to begin.  When it crashes, usually during the rendering of items in a grid the AIR process will grab about 2GB of RAM all at once and then stop working with the windows process stopped working dialog.
    Thanks for any help,
    Steve

    Hi,
    Could you please open a new bug report on this over at bugbase.adobe.com? Please include sample media, code, project or app to help us reproduce the issue. Finally, once the bug has been added, would you mind posting back with the URL so that others affected can add their votes and comments?
    Thanks,
    Jian
    Adobe Flash Runtime team

  • Separation of Java and HTML in servlets

    I'm starting on my first Java project. It will be a basic table maintenance app using Java Servlets. My question is, what would be a good way to keep my servlet code separated from the HTML code that will be used to generate the pages I'll display to the users. Should I have separate classes that produce each type of HTML? Just looking for a place to start. Thanks.

    Yes it is good idea, essential even. There are three main ways to do this.
    1) Use a third party template system like TEA, FreeMarker or WebMarco.
         http://freemarker.sourceforge.net/
    http://opensource.go.com/Tea/index.html
    http://www.webmacro.org/
    2) Use the Model View Controller Pattern, the Servlet (the controller) processes the requests and dispatches it to a Jsp page (the view) containing beans that reference your data (the model). See this link ( http://java.sun.com/j2ee/blueprints/design_patterns/model_view_controller/index.html )
    3) Produce your own Template system; with page loader/Parser, replacing the relevant 'custom tags' with the correct data.
    My best solution depends on your circumstances,

  • Html inside  Servlet

    Im trying to create a HTML page that will be created and invoked from a servlet.
    In order to do so, I created the HTML page in Frontpage 2003 and then added it to the Servlet code using [out.println(" ............");] for each and every statement
    Now, I dont get the output as I would get when the page is directly executed.Remember I calling /creating the HTML page from a servlet.
    I have the replaced the " with \" so that wont be an issue here. Also the Java Servlet code compiles without any error.
    1. Now where I face a problem is when I add the Java Script codes they dont execute. For example I created a button using FrontPage and set the 3 modes for it ,
    - on mouse over
    -On mouse down
    - on mouse up.
    So they created 3 different functions and added their own code to the HTML page.I managed to add all of it to the servlet.
    But the picture just refuses to load!
    2. Also, when I use a plain Html code like,
    out.println(" <input src=getdetails.gif name= \"image\" type=\"image\" tabindex=\"8\">");
    the pic doesnt load. On looking at the properties of the picture I dont see the location of the picture instead I see http://localhost:8080/examples/servlet/TestServlet.
    So Can someone please help me embed the Java Script code inside my servlet code and also show me how to use the code in point 2.
    Thank you.

    Well actually the .HTML file having the javascript code works perfectly. This file was created using Frontpage 2003.
    But, when I copy-paste the same thing in my .JAVA and supply the absolute paths for the images, something misfires and I dont get the same result.
    If you would like to have a peek at it , this is the line as in the .HTML File
    <input img border="0" id="img1" src="button5.jpg" height="20" width="100" type ="image" alt="Button Text" onmouseover="FP_swapImg(1,0,/*id*/'img1',/*url*/'button6.jpg')" onmouseout="FP_swapImg(0,0,/*id*/'img1',/*url*/'button5.jpg')" onmousedown="FP_swapImg(1,0,/*id*/'img1',/*url*/'buttonA.jpg')" onmouseup="FP_swapImg(0,0,/*id*/'img1',/*url*/'button6.jpg')" fp-style="fp-btn: Braided Column 3" fp-title="Button Text"></p>Now when I transfer it to the .JAVA file it becomes like this.
    pw.println("<input img border=\"0\" id=\"img1\" src=\"c:\\Images\\button5.jpg\" height=\"20\" type =\"image\" width=\"100\" alt=\"Book Flight\" onmouseover=\"FP_swapImg(1,0,/*id*/'img1',/*url*/\"C:\\Images\\button6.jpg\")\" onmouseout=\"FP_swapImg(0,0,/*id*/'img1',/*url*/\"C:\\Images\\button5.jpg\")\" onmousedown=\"FP_swapImg(1,0,/*id*/'img1',/*url*/\"C:\\Images\\buttonA.jpg\")\" onmouseup=\"FP_swapImg(0,0,/*id*/'img1',/*url*/\"C:\\Images\\button6.jpg\")\" fp-style=\"fp-btn: Braided Column 3; fp-font-size: 11; fp-font-color-hover: #FF0000; fp-font-color-press: #0000FF\" fp-title=\"Book Flight\"></p>");Can someone throw some light as to whats ,/*url*/ and do I still need to keep it in the code.
    Thank you.

  • HTML to Servlet connection

    I'm trying to debug a form submission to a servlet. I have an HTML with a form, and a servlet which processes the submission. If I deploy these files to Tomcat, they run fine and create the expected output. If I run the Servlet or the HTML in the internal debugger, they work individually as expected. If I run the HTML file and try to invoke the servlet through the submission button, I get an Error:
    404 Not Found
    Resource /servlet/TestPackage.NameForm not found on this server
    Am I overlooking some internal project directory setting? (I've tried placing the servlet in WEB-INF/classes/TestPackage, but still get the error) Do I have to deploy the two files together somewhere internally? Any help would be greatly appreciated.
    Bill

    The servlet name is 'NameForm'
    It's packaged in TestPackage (bad naming, I know, but this was supposed to be an easy test).
    The servlet name must be qualified by the package name, thus the "." between the two.

  • Unwanted spce when displaying tables in html using servlets

    hi everybody,
    i have noticed a strange behaviour. i have written servlets tht retrive values from a table based on a query. i retirive all the values using rs.getString() in the while rs.next() loop. next i try to display the values retried into strings in n html table. but when the html outputisgenerated lot of space is left blank in the output....the user hs to scroll a bit to view the output. why is this blank space left?????
    this is how i display the html table:
    while(rs.next())
    air=rs.getString("AIR");
    dd=rs.getString("DD");
    jces=rs.getString("JCES");
    System.out.println(jces);
    army=rs.getString("ARMY");
    navy=rs.getString("NAVY");
    iaf=rs.getString("IAF");
    dot=rs.getString("DOT");
    pol=rs.getString("POL");
    rly=rs.getString("RLY");
    aai=rs.getString("AAI");
    lhl=rs.getString("LHL");
    vsnl=rs.getString("VSNL");
    imd=rs.getString("IMD");
    dos=rs.getString("DOS");
    ongc=rs.getString("ONGC");
    nic=rs.getString("NIC");
    sac_com=rs.getString("SAC_COM");
    app_com=rs.getString("APP_COM");
    doe=rs.getString("DOE");
    mhq=rs.getString("MHQ");
    =================================
    out.println("<table width=90% bgcolor=orange cellspacing=0 cellpadding=10 border=1>");
    out.println("<th align=center>SACFA Member</th><th>Comment Status</th>");     
    out.println("<tr>");
    out.println("<td>AIR</td>"+"<td>"+air+"</td>");
    out.print("<br>");
    out.println("</tr><tr>");out.println( "<td>DD</td>"+"<TD>"+dd+"</TD>");out.print("<br>");
    out.println("</tr><tr>");          out.println( "<td>JCES</td>"+"<TD>"+jces+"</TD>");out.print("<br>");
    out.println("</tr><tr>");          out.println( "<td>ARMY</td>"+"<TD>"+army+"</TD>");out.print("<br>");
    out.println("</tr><tr>");     out.println( "<td>NAVY</td>"+"<TD>"+navy+"</TD>");out.print("<br>");
    out.println("</tr><tr>");          out.println( "<td>IAF</td>"+"<TD>"+iaf+"</TD>");out.print("<br>");
    out.println("</tr><tr>");          out.println( "<td>DOT</td>"+"<TD>"+dot+"</TD>");out.print("<br>");
    out.println("</tr><tr>");          out.println( "<td>POL</td>"+"<TD>"+pol+"</TD>");out.print("<br>");
    out.println("</tr><tr>");          out.println( "<td>RLY</td>"+"<TD>"+rly+"</TD>");out.print("<br>");
    out.println("</tr><tr>");          out.println( "<td>AAI</td>"+"<TD>"+aai+"</TD>");out.print("<br>");
    out.println("</tr><tr>");          out.println( "<td>LHL</td>"+"<TD>"+lhl+"</TD>");out.print("<br>");
    out.println("</tr><tr>");          out.println( "<td>VSNL</td>"+"<TD>"+vsnl+"</TD>");out.print("<br>");
    out.println("</tr><tr>");          out.println( "<td>IMD</td>"+"<TD>"+imd+"</TD>");out.print("<br>");
    out.println("</tr><tr>");          out.println( "<td>DOS</td>"+"<TD>"+dos+"</TD>");out.print("<br>");
    out.println("</tr><tr>");          out.println( "<td>ONGC</td>"+"<TD>"+ongc+"</TD>");out.print("<br>");
    out.println("</tr><tr>");          out.println( "<td>NIC</td>"+"<TD>"+nic+"</TD>");out.print("<br>");
    out.println("</tr><tr>");          out.println( "<td>SACFA COMMENT</td>"+"<TD>"+sac_com+"</TD>");out.print("<br>");
    out.println("</tr><tr>");     out.println( "<td>APPLICATION COMMENT</td>"+"<TD>"+app_com+"</TD>");out.print("<br>");
    out.println("</tr><tr>");          out.println( "<td>DOE</td>"+"<TD>"+doe+"</TD>");out.print("<br>");
    out.println("</tr><tr>");          out.println( "<td>MHQ</td>"+"<TD>"+mhq+"</TD>");out.print("<br>");
    out.println("</tr>");
    out.println("</table>");
    wht cud be wrong? pls help.
    thanx,
    ashna

    the reason i know is because i ran into this problem myself when converting '\r\n' to <br>. it just seems this is the way IE (and maybe netscape) handle html. if you do a 'view source' on the page you would see all the <br>'s and say "where did those come from?", then after looking at your code you would see it.
    i am not sure 100% as to why they do it, but I have theories as to why (i.e. table isn't done and that text isn't formatted correctly, so just spit stuff out - then print table when closed)
    so basically, the problem was with the html and not the servlet writing.

Maybe you are looking for