Servlet-html

How to send values from servlet to html..
I retrieve values from database using servlet pgm and want to display in textfield...
do reply
thx,
dish

You welcome to use my code... the syntax is not 100% for i changed table names, field names, etc for copyright purposes... but this is how i did mine
You will need to change it according to yur program/output
Create your SQL statement ...
=======================================================================================================
String q8="SELECT *     + "from search_projects "
     + "where queried_user_name = '" + g_user_name + "'";
os.println("<BR><BR><BR>");
DisplayQuery(q8, res, "view");
========================================================================================================
static String DisplayQuery(String p_sql,HttpServletResponse res, String p_heading_types)
throws ServletException,IOException
PrintWriter os=res.getWriter();
Statement stmt = null;
String l_error = "";
try
stmt = con.createStatement();
stmt.execute(p_sql);
ResultSet rs = stmt.getResultSet();
if (rs != null)
DispResultSet(rs, res, p_heading_types);
rs.close();
return(p_sql);
catch (Exception e)
os.println("<BR><BR>EXCEPTION. Unable to execute. If problem persists, please contact");
os.println(e);
return("<BR>ERROR3");
===================================================================================================
static void DispResultSet(ResultSet rs, HttpServletResponse res, String p_heading_types)
throws ServletException,IOException, SQLException
PrintWriter os=res.getWriter();
ResultSetMetaData rsmd = rs.getMetaData ();
int p=0;
int numCols = rsmd.getColumnCount ();
if (p_heading_types.equals("view"))
while (rs.next())
os.println("<TABLE BORDER=1 COLS=" + numCols + ">");
     os.println("<TR>");
     os.println("<TD>");
os.println("<TH><FONT color=blue>Id</FONT></TH>");
os.println("</TD>");
     os.println("<TD>");
os.print("<FONT color=black>"+rs.getString(1)+"</FONT></TD>");
     os.println("</TD>");
     os.println("</TR>");
     os.println("<TR>");
     os.println("<TD>");
os.println("<TH><FONT color=blue>Amount</FONT></TH>");
     os.println("</TD>");
     os.println("<TD>");
os.print("<FONT color=black>"+rs.getString(2)+"</FONT></TD>");
     os.println("</TD>");
     os.println("</TR>");
     os.println("<TR>");
     os.println("<TD>");
os.println("<TH><FONT color=blue>rings</FONT></TH>");
     os.println("</TD>");
     os.println("<TD>");
os.print("<FONT color=black>"+rs.getString(3)+"</FONT></TD>");
     os.println("</TD>");
     os.println("</TR>");
     os.println("<TR>");
     os.println("<TD>");
os.println("<TH><FONT color=blue>Date</FONT></TH>");
     os.println("</TD>");
     os.println("<TD>");
os.print("<FONT color=black>"+rs.getString(4)+"</FONT></TD>");
     os.println("</TD>");
     os.println("</TR>");
     os.println("<TR>");
     os.println("<TD>");
os.println("<TH><FONT color=blue>Email</FONT></TH>");
     os.println("</TD>");
     os.println("<TD>");
os.print("<FONT color=black>"+rs.getString(5)+"</FONT></TD>");
     os.println("</TD>");
     os.println("</TR>");
os.println("</TABLE>");
os.println("<BR><BR><BR>");
p=p+1;
Thanks
Naren

Similar Messages

  • How to create ShoppingCart By Using mysql+Servlet+Html

    Hi everyone:
    I am working on a project using Jbuilder, which is a shopping site.
    The functions are:
    1, Access database and display all kinds of products in a table
    2, Add the item you want into a Temporary Cart
    3, Remove unwanted items from cart
    4, Confirm the order
    I can only use mysql + Servlet + Html.
    I am at the step of display everything from the database, but i don't have any idea how to do the rest of the functions.
    i have read lots of information, it seems that i need to use session tracking, and connection pool stuff.
    Can any one give me some suggestions about how to design this project and how to implement it, and what kinds of thing i need to aware of.
    cheers
    Lin

    Hi,
    i have idea about ur app in different env i.e. in different servers but i don't know how it will impl in jbuilder.i will send u link of whole shop app and also u can refer the wrox books and site.

  • Save servlet html output as jpeg.

    Hello everybody,
    I have a servlet that creates an html page.
    The html consits of information from a database and displays a data sheet with images and text.
    I have been asked if the outputed data sheet can be saved as an image (jpeg).
    Is this possible?
    Thanks.

    I am can of confused how this works
    I know that there is more to do in order to create an
    image.First you have to make a desition, what do you need?
    * if you only want to save a data sheet i think the better solution is a Excel format file, for this yo coul take a look at http://jakarta.apache.org/poi/hssf/index.html
    * if you want to generate a pdf with images, tables, etc. yo should take a look at http://xml.apache.org/fop/
    * if you want to create a custom image i cant help you
    the proces to generate excel isnt dificult but to make a pdf is a little hard. but if you read the documentation and the examples you shouldnt have problems
    Jorge

  • Java Servlet/Html link problem

    Hi,
    I have been using the Java servlet to create the html code itself using the PrintWriter.I would like to know if it possible to input ALL the code into -
    PrintWriter out=null;
    out.println("<Html><Body>the entrie html code</Body></Html>");
    or must I input in this form?-
    out.println("<html>");
    out.println("<Body>");
    out.println("<The entire html code>");
    out.println("</Body>");
    out.println("</Html>");
    Does it really make a difference?
    I would also like to know it is possible to retrive data from a database and (via servlet) input the list of data into the combo-box of an html Webpage.
    Thank you very much for your assistance.Kindly acknowledge receipt.
    Yours sincerely,
    Aeshan
    PS- I'll send more information soon

    Your answers are yes ...and yes.
    But don't use:
    PrintWriter out=null;
    Use:
    PrintWriter out = response.getWriter();
    Usually the println() method is used to make both the servlet source code ...as well as the html it generates ...a little nicer to read. This may or may not be important to you, but may matter to your employer and those who maintain your code in the future.

  • Declarative security of servlet- html view changes depending upon  the role ??

              Hi All,
              There is acl for ejb methods and we can restrict roles to use certain
              methods of the bean. Now my question is that
              Is something possible in a declarative fashion so that user can have
              certain options enabled and certain disabled in the jsp/servlet output
              depending upon his role ?
              For example, let suppose we have a servlet MyServlet that creates an
              html output with some input boxes and buttons (add, modify, delete). Now
              is it possible, that ceratin user will only see modify button, some
              won't see any button, can only view the screen depending upon their role
              and verything in declarative fashion ?
              Any suggestion is welcome.
              TIA,
              Sudarson
              

    Servlet security is defined in the context of the web application containing
              the servlet, and web app security provides for the declarative protection of
              resources like servlets, jsps and html pages; so the answer is no.
              See http://e-docs.bea.com/wls/docs61///webapp/security.html
              Thanks
              Jim
              sudarson wrote:
              > Hi All,
              >
              > There is acl for ejb methods and we can restrict roles to use certain
              > methods of the bean. Now my question is that
              >
              > Is something possible in a declarative fashion so that user can have
              > certain options enabled and certain disabled in the jsp/servlet output
              > depending upon his role ?
              >
              > For example, let suppose we have a servlet MyServlet that creates an
              > html output with some input boxes and buttons (add, modify, delete). Now
              > is it possible, that ceratin user will only see modify button, some
              > won't see any button, can only view the screen depending upon their role
              > and verything in declarative fashion ?
              >
              > Any suggestion is welcome.
              >
              > TIA,
              > Sudarson
              [Reply.vcf]
              

  • Servlet HTML Template

    Hi, there.
    I have a Servlet that among many other things, return a HTML to the user.
    At the beggining, the HTML was so simple that it worth write the String and output it. The HTML now became much more complex, and I'd like to make it an external resource (.html), for mantainance purposes, and only replace the dynamic content inside it. I don't know which is the best way to accomplish it, to replace the variables inside the HTML Template I've just created. What should I look for?
    Searched the web and found this solution: [HTML.Template.java|http://html-tmpl-java.sourceforge.net/]
    Anyone knows it? Is it the fastest way? The best? Does anyone know a better solution?
    Thank you in advances,
    CaioToOn!

    CaioToOn! wrote:
    Hi, Kayaman.
    I'm searching over "velocity template" just right now, didn't knew it. Are you talking about it http://velocity.apache.org/engine/releases/velocity-1.5/user-guide.html
    Yes.
    On JSP, I have no familiarity with it. I can achieve anything with a JSP that I could achieve with a servlet? Like starting a second thread, reading headers, sending custom headers, etc? I'd also, for "fancy" reasons, like not to have a ".jsp" at the end of my URL. May I do it without a URL rewriting rule?Ideally you wouldn't do that logic in the JSP. You would do it in the servlet, then forward to the jsp which would only display and have minimal logic in it.
    And you can do it without having .jsp at the end of the URL.

  • Servlet/ html problem

    hi all,
    I have the situation where the result of an end user's actions is a variable length (in terms of number of rows) HTML table. How can the JSP/Servlet be designed so that the Servlet (or elsewhere in the non-presentation logic) doesn't generate HTML?
    thanks in advance.....

    Hi,
    The jsp can make a call to some class/object that may return a variable length list (like vector). the jsp code look like this :
    code:
    <table><%Vector nameVector = SomeObject.getNameVector(param);for (int index=0;index<nameVector.size();index++){%><TR><TD><%=(String) nameVector.get(index)%></tr></td><%}%></table>
    hope this will help you.
    Anil.
    Developer Technical support
    Sun Microsystems, India.
    http://www.sun.com/developers/support

  • Servlet-HTML connection

    I'm having some problems connecting html to a servlet. Im currently at my university and under my own root, the servlet is under /booksonline/html/servlet. the html code looks like this
    <tr>
    <FORM ACTION="http://localhost:8080/BooksOnline/HTML/servlet.MyServlet" METHOD=POST>
    <td valign="center"><B>Login Name: </B></td>
    <td valign="center"><input type="text" name="LoginName" size="50" maxlength="50" value=""></td>
    </tr>
    and the corresponding part in MyServlet looks like this:
    public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
    String name=req.getParameterValues("LoginName")[0];          
    //*****Construct a response in HTML*****
    String reply="<HTML>\n<HEAD><TITLE>Sample response</TITLE></HEAD>\n<BODY>\n<CENTER><BR><B>\n";
    reply=reply.concat("hi "+ name);
    reply=reply.concat("\n</B></CENTER>\n</BODY>\n</HTML>");
    //*****Send the reply*****
    res.setContentType("text/html");
    PrintWriter out=res.getWriter();
    out.println(reply);
    out.close();
    i think the servlet should be fine as it was taken from an online tutorial. i think the problem may lie in it not being able to find it.
    i have also tried combinations such as
    ="http://localhost:8080/BooksOnline/HTML/servlet/MyServlet", MyServlet.class and so on and so forth. Its really basic at the moment, but once i have it running, then i can actually have it doing better stuff. Can anyone help?!
    cheers
    Alex Thomas

    Hi,
    do i have to be running tomcat at this point? at the moment im just trying to get some connectivity before using tomcat. I just want to see that i can actually connect the html with the java. is this possible without using tomcat?
    cheers
    alex

  • Servlet (html code doesn't work correctly on IE6)

    Hi, i've a problem with code html on servlet...my page works correctly with firefox but on IE6 i've a lot of bugs about table alignment and CSS looks like not exist . This is code that doesn't work:
    protected void processRequest(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {
            PrintWriter out = response.getWriter();
            String context = request.getContextPath();
            response.setContentType("text/html");
            out.println("<html>");
            out.println("<head>");
            out.println("<title>RisultatoRicerca Servlet</title>");
            out.println("<link rel='stylesheet' type='text/css' href='"+context+"/css/cd.css'>");
            out.println("<script>");
            out.println("</script>");
            out.println("</head>");
            out.println("<body>");
            DbUtility utility = new DbUtility();
            GestioneCd gestioneCd =new GestioneCd();
            GestioneNoleggio gestioneNoleggio=new GestioneNoleggio();
            Cd cd = newCd();
    cd.setArgomento(request.getParameter("argomento")==null?"":request.getParameter("argomento"));
            cd.setEtichetta(request.getParameter("etichetta")==null?"":request.getParameter("etichetta"));
            cd.setUbicazione(request.getParameter("ubicazione")==null?"":request.getParameter("ubicazione"));
            int valoreRadio=request.getParameter("attivo")==null?0:Integer.parseInt(request.getParameter("attivo"));
            if (valoreRadio==1){
                cd.setAttivo(true);
            }else if (valoreRadio==2){
                cd.setAttivo(false);
            Connection con = null;
             LinkedList cdFromRisultatoRicerca=new LinkedList();
            try{
                con=utility.getConnection();
                cdFromRisultatoRicerca=gestioneCd.getRisultatoRicercaCd(con, cd,valoreRadio);
                ListIterator iterator = cdFromRisultatoRicerca.listIterator();
                int id=0;
                String argomento="";
                String etichetta="";
                String ubicazione="";
                out.println("<form name='visualizza' method='post'");
                out.println("<table align='center'>");  // NOT WORKS , table alignment not respected on IE6
                out.println("<tr><td colspan='9' align='center'></td></tr>");
                out.println("<tr><td colspan='9' align=center class='titolo'>Risultato ricerca</td></tr>");
                out.println("<tr>");
                out.println("   <td align='left' class='titolo'>Id</td>");
                out.println("   <td align='left' class='titolo'>Argomento</td>");
                out.println("   <td align='left' class='titolo'>Etichetta</td>");
                out.println("   <td align='left' class='titolo'>Ubicazione</td>");
                out.println("   <td align='center' class='titolo'>N.copie</td>");
                out.println("   <td align='center' class='titolo'>Disponibili</td>");
                out.println("   <td align='left' class='titolo'>Attivo</td>");
                out.println("   <td class='titolo'> </td>");
                out.println("   <td class='titolo'> </td>");
                out.println("</tr>");
                out.println("<tr>");
                out.println("   <td colspan='7' align='center'>");
                out.println("       <HR width='100%'>");
                out.println("   </td>");
                out.println("   <td> </td>");
                out.println("   <td> </td>");
                out.println("</tr>");
                int copie=0;
                while (iterator.hasNext()){
                    cd=(Cd)iterator.next();
                    out.println("<tr>"); // NOT WORKS, on IE6 lines appears not in a table
                    out.println("   <td>"+cd.getId()+"</td>");
                    out.println("   <td>"+cd.getArgomento()+"</td>");
                    out.println("   <td>"+cd.getEtichetta()+"</td>");
                    out.println("   <td>"+cd.getUbicazione()+"</td>");
                    out.println("   <td align='center'>"+cd.getCopie()+"</td>");
                    int copieNoleggiate=gestioneNoleggio.getCopieNoleggiate(con,cd);
                    int copieDisponibili=(cd.getCopie())-(copieNoleggiate);
                    out.println("   <td align='center'>"+copieDisponibili+"</td>");
                    out.println("   <td align='center'>");
                    if (cd.isAttivo()==true){
                        out.println("<img src="+context+"/immagini/pulsanteverde2.gif>");
                    }else{
                        out.println("<img src="+context+"/immagini/pulsanterosso2.gif>");
                    out.println("   </td>");
                    out.println("   <td>");
                    out.println("       <a href='javascript:;' onclick=\"javascript:window.open('"+context+"/servlet/ModificaCd?id="+cd.getId()+"','Modifica','width=500,height=300,top=200,left=300');\" target='main'>Modifica</a>");
                    out.println("   </td>");
                    if (cd.isAttivo()){
                        out.println("   <td>");
                        out.println("       <a href='javascript:;' onclick=\"javascript:window.open('"+context+"/servlet/ConfermaDisattiva?id="+cd.getId()+"','Disattiva','width=300,height=70,top=250,left=350');\" target='main'>Disattiva</a>");
                        out.println("   </td>");
                    }else{
                        out.println("   <td>");
                        out.println("       <a href='javascript:;' onclick=\"javascript:window.open('"+context+"/servlet/ConfermaAttiva?id="+cd.getId()+"','Attiva','width=300,height=70,top=250,left=350');\" target='main'>Attiva</a>");
                        out.println("   </td>");
                    out.println("</tr>");
                    out.println("<tr>");
                    out.println("   <td colspan='7' align='center'>");
                    out.println("       <HR width='100%'>");
                    out.println("   </td>");
                    out.println("   <td> </td>");
                    out.println("   <td> </td>");
                    out.println("</tr>");
                out.println("<tr>");
                out.println("   <td colspan='9' align='center'>");
                out.println("       <a href='"+context+"/jsp/index.jsp' target='main'>Torna Home</a>");
                out.println("   </td>");
                out.println("</tr>");
                out.println("</table>");
                out.println("</form>");
            }catch (SQLException e){
                out.println(e.getMessage());
                out.println(e.getSQLState());
            }finally{
                try {utility.closeConnection(con);} catch (Exception e) {con=null;}
            out.println("</body>");
            out.println("</html>");
            out.close();
        }And this is CSS :
    BODY {
            background : #CCCCCC ;
            color : #000000 ;
            font-family  : sans-serif ;
            font-size : 13px ;
    A {
            color : #D2691E ;
            font-weight : bold ;
            font-family : sans-serif ;
            font-size : 12px ;
            text-decoration : none ;
    TABLE {
            background : #CCCCCC ;
            color : #000000 ;
            font-family : sans-serif ;
            font-size : 13px ;
            border : 1px ;
    .titolo {
            background-color : #CCCCFF ;
            font-family : sans-serif ;
            color : #000000 ;
            font-size : 13px ;
            font-style : normal ;
            font-weight : bold ;
    }Thx for your attenction :D

    out.println("<form name='visualizza'
    'visualizza' method='post'");
    out.println("<table align='center'>");
    'center'>"); // NOT WORKS , table alignment not
    respected on IE6You're missing a > at the end of the form start tag.

  • Alternative to Servlets&HTMLs

    can anybody suggest me an alternative for servlet based html to develop a realtime ecom site?
    Is the servlets based HTMLs not advisable in a realtime environment? why?
    Thanx

    hi,
    well not quite a REAL alternative, but a good addition are java server pages. if you build your pages after the three-layer-model (presentation, logic, database), then you have a powerful, easy to scale, dynamic website.
    but, it's not that simple, so you will have to make a lot of shots, before you hit the duck :-).
    these two pages are a good point to start, there are a lot of more good pages out there, you just have to search a little bit around.
    http://www.jspinsider.com/
    http://www.jspin.com/
    chris

  • Saving servlet html input parameters and reuse it for later time

    Dear all,
    I am using one of charting api (netcharts pro) to develop a j2ee based charting application (jsp/servlet).
    One of the requirement is to be able to capture the user input (set of selections) and save it as simple file or even save it in a database, and reuse it at later time.
    At later time user do not need to make a selection from the scratch, and user can re-select/re-open his file (or database record) and generate charts.
    in practical words :
    user can input thru request.getParameter() or reading set of parameters from file
    I will appreciate if someone can lead me to pointers/link/idea.

    Reading file is exactly the same as you do for a normal app.
    BufferedReader br = new BufferedReader(new FileReader(
                              new File("someFilePathName")));
    while(br.readLine()!= null)
        //do your stuff here
      }just put the above code into your servlet plus the relevant try,catch block. Put the blow info into your app's web.xml if you want this servlet loads once Tomcat starts.
    <servlet>
    <servlet-name>servletName</servlet-name>
    <servlet-class>servletDir</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    Hope it helps.

  • Html to browser in servlets

    When JSP's are compiled as servlets, does the servlet send HTML to the browser during the html generation or does it send after the complete html is generated?
              Thanks
              AJ

    When JSP's are compiled as servlets, HTML isn't generated. The JSPC compiler
              first generates the Java code for the servlet and then calls the javac
              compiler to compile the generated java code. The resulting servlet's service
              method then executes as a result of being called by the web container. The
              servlet's service method is then free to stream any HTML it generates (by
              whatever means) back to the browser using the response output stream.
              HTML 'generation' is not part of the JSP code gen and compilation process.
              Execution of the servlet's service method is where HTML will be sent to the
              browser as part of the response, if the servlet chooses to do that.
              Bill
              "Anil Jacob" <[email protected]> wrote in message
              news:24477094.1102620616996.JavaMail.root@jserv5...
              > When JSP's are compiled as servlets, does the servlet send HTML to the
              browser during the html generation or does it send after the complete html
              is generated?
              >
              > Thanks
              > AJ
              

  • Applet:how to display a html-page generated by servlet?

    hi everybody,
    I have an applet which posts data do a servlet and receives a response from the servlet (html-code). can anybody please tell me if there is a possibility to display this received html-page?
    (I HAVE to use a post-request to the servler due to a lot of data to send...)
    all my applet-servlet-communication is within a session with a jsessionid.
    does anybody have a hint for me?
    thanks a lot in advance,
    frank

    One possibility is to have the servlet create a new .html file on the server and output the HTML code to that file. Then the servlet can pass the name of the file back to the applet, and the applet can useshowDocument(new URL(yourUrlHere), "_blank"); to display the page.
    Just a thought. Good luck!
    - Sheepy

  • Problem to display Animated Gif from HTML into JEditorPane

    I have a problem displaying animated gif that comes from URL (HTML) into JEditorPane.
    Let me show you the source I have:
    * @author Dobromir Gospodinov
    * @version 1.0
    * Date: Dec 6, 2002
    * Time: 6:47:53 PM
    package test.advertserver;
    import javax.swing.*;
    import java.awt.*;
    import java.io.IOException;
    public class Test {
         public static void main(String[] args) {
              JFrame frame = new JFrame();
              JEditorPane ed = new JEditorPane();
              try {
                   ed.setPage("http://localhost:8200/servlet?key=value");
              } catch (IOException e) {
                   e.printStackTrace();
              JPanel panel = new JPanel();
              panel.setPreferredSize(new Dimension(500, 500));
              panel.add(ed);
              frame.getContentPane().add(panel);
              frame.pack();
              frame.setVisible(true);
    }Part of the returned from servlet HTML includes an img tag:
    <img src="/images/MyAnimatedGif.gif" alt="animated gif comment" width="480" height="50"  border="0">Let us assume that MyAnimatedGif.gif has 10 frames and gif is looped - when the 10th is dipslayed it has to display the 1st and so on.
    JEditorPane displays frames from 1 to 10 correctly but does not start from the first again. Instead JEditorPane displays a broken image.
    I locate where the problem arise:
    JEditorPane has an HTMLEditorKit that creates javax.swing.text.html.ImageView instance for every IMG tag.
    And here is the problem:
    ImageView has an ImageObserver necessary for the asynchronous image download. ImageObserver has the imageUpdate method. But this imageUpdate method is never called with ALLBITS flag raised up. Instead, after the last frame of MyAnimatedGif.gif is downloaded the imageUpdate method is called with flag ERROR raised up. Obviously this is a bug of Sun's implementation. Finaly the flag ALLBITS has to be received for normal end of image observing. But ALLBITS flag does not come.
    So, can anybody help me how to load an animated gif within JEditorPane completely.
    Thank You in advance,
    Dobromir Gospodinov
    P.S. If somebody of you wants to debbug what happens within ImageView will have to implement it (and related classes too, because of the limited package visability) borrowing the source from Sun's ImageView.

    I'm also having this problem with java 1.4.1 I discovered that some animated gifs work fine, while others stop animating. Running with java 1.3.1 fixed the problem. I'm going to report this as a bug
    Here's my code:
    import java.awt.*;
    import java.io.*;
    import javax.swing.*;
    public class AnimatedGifTester
    extends JFrame
    public static void main(String argv[])
    throws Exception
    new AnimatedGifTester();
    public AnimatedGifTester()
    throws Exception
    String[] images = new String[] {
    "http://www.gif.com/ImageGallery/Animated/Animals/Photographic/dog_running.gif",
    "http://www.gif.com/ImageGallery/Animated/Characters/Cartoon/java.gif",
    "http://www.webdeveloper.com/animations/bnifiles/anielg.gif",
    "http://www.webdeveloper.com/animations/bnifiles/cat2.gif",
    "http://images.animfactory.com/animations/animals/fish/big_fish_swimming_md_wht.gif",
    "http://www.webgenies.co.uk/images/martian.gif",
    "http://www.webdeveloper.com/animations/bnifiles/at_sign_rotating.gif",
    "http://www.webdeveloper.com/animations/bnifiles/arrow_1.gif",
    "http://www.gif.com/ImageGallery/Animated/Characters/Cartoon/javaacro.gif",
    "http://java.sun.com/products/java-media/2D/samples/suite/Image/duke.running.gif",
    "http://www.gif.com/ImageGallery/Animated/SouthPark/Cartoon/stan.gif"
    StringBuffer buffer = new StringBuffer("<html><body>");
    for (int idx = 0; idx < images.length; idx++)
    buffer.append("<img src='" + images[idx] + "'>");
    buffer.append("</body></html>");
    String html = buffer.toString();
    // save a copy of the html to open in a browser so we can see what it's
    // supposed to look like
    BufferedWriter writer = new BufferedWriter(new FileWriter("animatedGifTest.html"));
    writer.write(html);
    writer.close();
    JEditorPane editorPane = new JEditorPane("text/html", html);
    editorPane.setEditable(false);
    getContentPane().add(editorPane);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    setSize(new Dimension(400, 600));
    show();

  • How to run a servlet in tomcat 5.0.

    Hi all,
    how to run a servlet in tomcat 5.0
    please tell me the entire procedure....(directory structure)
    step by step....

    hi :-)
    http://java.sun.com/j2ee/tutorial/1_3-fcs/doc/Servlets.html
    or
    http://www.google.com.ph/search?hl=en&q=java+servlet+tutorial&btnG=Google+Search&meta=
    regards,

Maybe you are looking for

  • How to print Signature in smartform in a dynamic place ?

    Hi experts,                 i have a requirement to print signature in a smartform (purchase order print) ,the signature has to printed in dynamic place.                 i have  to Print signature in in authorized signatory place, we cannot place sta

  • Statechart module: crashes when I want to save state

    I am using the LV Statechart Module (version 8.6.0). LabVIEW crashes when I want to save a state (by clicking "OK" on the state dialog). The crash does only occur if I have some member VIs of a quite large class hierarchy in the state. It does not oc

  • JRE 1.4 to 1.6 - Migration Question

    Thank you for reading this post and attempting to help me. I am being tasked with a project to migrate a application that was developed on JDK 1.4 to JDK 1.6, the application is not going to go through any functional change. I went about upgrading my

  • Problem in threading operation...

    Hi All, I have developed an application based on threads. An application contains two threads which starts separately (separate class for each thread). On first thread I am showing continuous animation & on second thread I am doing socket connection.

  • Captivate 7 Drag Interaction - show answer

    Hi I am trying out the new Drag and Drop Interaction. What I am trying to do is when you submit your answer I would like to show the user the correct answer if they have answered incorrectly.Is there a way to make this possible? Thanks