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.

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

  • Open html inside flash it´s posible?

    open html inside flash it´s posible?

    I've been trying to create a link in flash8, to link to an
    html page the whole week, no success at all. I dont think anyone in
    this
    forum's got any answer to that. When I run the swf file alone
    it works but as soon as I import it into Dreamweaver, all links to
    an html file created in flash fails.But if by any chance you get
    the answer please would u send it to this emall address:
    [email protected]

  • HtML inside JSP Tag

    How much HTML can be inside a JSP Tag? I created a tag which set few variables. Now on the JSP page, if the variable A is not null, then only display value and show a link next to it.
    So is it OK, if I take the link html (href code) and concatenate with the vale of A
    Thanks in advance

    <ed:TableIterator resultId="calist">
      <tr class="altrow">
        <td class="center" style="vertical-align:top;">
          <input type="checkbox" onchange="ca.value='1';" class="cb" name="cadel" value="<ed:getColumn column="idx"/>"/>
          <input type="hidden" name="cadate" value="<ed:getColumn column="date"/>"/>
        </td>
        <td style="vertical-align:top;">
          <input type="text" onchange="ca.value='1';" class="text" name="caoms" value="<ed:getColumn column="title"/>"/>
        </td>
        <td>
          <textarea class="text" onchange="ca.value='1';" name="camemo" cols="40" rows="4"><ed:getColumn column="memo"/></textarea>
        </td>
      </tr>
    </ed:TableIterator>Loads :)
    This is a small sample, building the rows of a table with 3 columns (a checkbox, an inputfield and a textarea) for each row.
    I've built larger structures where I nest the same tags to create select controls in each row.
    I wouldn't actually create HTML inside the java class for the tag, as that violates the separation of code and presentation (that's not to say I haven't done it, but I've learned better since <GRIN> and now try to avoid it where possible and minimise it where not).

  • HTML inside of JLabels

    I have been working around using java formatting for some time now by using HTML inside of my Swing objects. I had a couple of questions about this practice.
    Is it worth it? and if not, what should I do instead.
    Why dont link statements work inside of the text. <a href.....
    Is there a good resource for java formatting?
    I could easily start learning XML, would this be any better?
    Thanks for the advice.
    Leon

    Though the HTML form and the swing page appear similar their functions are rather different. The business of the HTML page is just to display information, and maybe send a few selected fields back. More often just to switch to another page when it's been read.
    The GUI window is much more interactive, with every element potentially communicating with the program on an individual basis.
    So the tools are bound to be different. If you want to write pages that can be displayed either way and hide the differences as much as possible you should look at Java Faces.
    Links can't work the same way because the meaning of a link on a browser is tied up in what the browser does. The GUI application isn't in the business of displaying another HTML page based on a URL (if it was, it would be a browser).

  • 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

  • Use BC4J inside servlets

    Hi,
    This may be a dumb question but I'm new to JDeveloper. I created my Business Components and can use it inseide applets and JSP's - but ich couldnt find a way to use it (via wizzard) inside a servlet. Could anybody give me a tip
    TIA
    Oliver
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by David Roberts ([email protected]):
    I would like to use the functionality of bc4j data tags inside servlets.
    My aim is to do code intensive operations inside a servlet and forward the results, if necessary, to a JSP page.
    The most convenient way of accessing data in BC4J are the JSP data tags. I was wondering if there is a way of instantiating them as normal Java Classes in a servlet, and using class methods to perform the database update operations that I want?<HR></BLOCKQUOTE>
    null

  • Displaying images in HTML Forms inside Servlets

              Dear friends
              How are you?
              I am developing Servlets in WebGain Studio Pro V4.1 VisualCafe
              V4.1 to display dynamic HTML forms with embedded
              images (*.jpg and *.gif).
              Please see the following sample code -
              "<DIV ID=\"Logo\" STYLE=\"position:absolute; left: 4%; top: 4%;
              width: 25%; height: 12%; z-index:1; visibility:visible\">" +
              "<IMG SRC=\"FigLogo.gif\" WIDTH=\"100%\" HEIGHT=\"100%\">" +
              "</DIV>"
              Then I deploymed servlets to BEA WLS 6.0 by including Servlets
              in the Web.xml file. However, I do not see the images when
              viewed in IE5.0 browser.
              I appreciate all comments and suggestions.
              Thanking you
              Very truly yours
              Sriram (Ram) Peddibhotla, PhD
              

              Dear Friends
              How are you?
              I moved all images (*.jpg, *.gif) to the subdirectory
              /myDomain/applications/DefaultWebApp_myServer/images
              and they are displaying now in the servlets with HTML forms.
              Thanking you
              Very truly yours
              Sriram (Ram) Peddibhotla, PhD
              "Sriram (Ram) Peddibhotla" <[email protected]> wrote:
              >
              >Dear Friends
              >
              >How are you?
              >
              >When the Servlet displays in the browser (IE5.0), when I click on where
              >the image
              >should be, I see the path
              >http://localhost:7001/servlet/FigureName.jpg (????). Why did it add
              >the /servlet
              >part to the path, I thought that was exclusively for deploying servlets
              >in web.xml
              >file.
              >
              >Thanking you
              >Very truly yours
              >Sriram (Ram) Peddibhotla, PhD
              >
              >
              >"Xiang Rao" <[email protected]> wrote:
              >>
              >>Check access.log to see the status of your image request (status code
              >>and response
              >>size). You can also check weblogic.log. On the other hand, IE cache
              >setup
              >>(e.g.,
              >>"Never") could cause this problem.
              >>
              >>"Sriram (Ra) Peddibhotla" <[email protected]> wrote:
              >>>
              >>>Dear friends
              >>>
              >>>How are you?
              >>>
              >>>I am developing Servlets in WebGain Studio Pro V4.1 VisualCafe
              >>>V4.1 to display dynamic HTML forms with embedded
              >>>images (*.jpg and *.gif).
              >>>
              >>>Please see the following sample code -
              >>>"<DIV ID=\"Logo\" STYLE=\"position:absolute; left: 4%; top: 4%;
              >>>width: 25%; height: 12%; z-index:1; visibility:visible\">" +
              >>>"<IMG SRC=\"FigLogo.gif\" WIDTH=\"100%\" HEIGHT=\"100%\">" +
              >>>"</DIV>"
              >>>
              >>>Then I deploymed servlets to BEA WLS 6.0 by including Servlets
              >>>in the Web.xml file. However, I do not see the images when
              >>>viewed in IE5.0 browser.
              >>>
              >>>I appreciate all comments and suggestions.
              >>>
              >>>Thanking you
              >>>Very truly yours
              >>>Sriram (Ram) Peddibhotla, PhD
              >>>          
              >>
              >
              

  • Problem in printing the data from database when i print inside servlet

    hi to all!
    the objective of the code below is getting the data from database table and has to send that data to the web browser using out.println .note: out - PrintWriter object
    In a getQuestion method, i am getting the data from database table and store it in String q and when i print the q within this method it is getting printed, but i got the null value when i printed the String q inside service method doPost. why..? its puzzling me.
    package servlet;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class test extends HttpServlet {
         Connection con;
         ResultSet rs;
         Statement s;
         StringBuffer q;
         StringBuffer o1;
         StringBuffer o2;
         StringBuffer o3;
         public void getQuestion() throws Exception
              if(rs.next())
                   q=new StringBuffer(rs.getString("question"));
                   o1=new StringBuffer(rs.getString("option1"));
                   o2=new StringBuffer(rs.getString("option2"));
                   o3=new StringBuffer(rs.getString("option3"));
                   System.out.println(q);
                   System.out.println(o1);
                   System.out.println(o2);
                   System.out.println(o3);
         public void connect(){
              try
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              con=DriverManager.getConnection("jdbc:odbc:ds","sa","server");
              s=con.createStatement();
              rs=s.executeQuery("select * from qa order by newid()");
              getQuestion();
              catch(Exception e)
                   System.out.println("erroe");
         public void doPost(HttpServletRequest request,HttpServletResponse response)
         throws IOException,ServletException
              response.setContentType("text/html");
              new test().connect();
              PrintWriter out=response.getWriter();
              request.setAttribute("question", q);
              request.setAttribute("option1", o1);
              request.setAttribute("option2", o2);
              request.setAttribute("option3", o3);
              //RequestDispatcher rd=getServletContext().getRequestDispatcher("/show.jsp");
              //rd.forward(request, response);
              out.println("<html>");
    out.println("<head>");
         out.println("<title>" + "shock!!!" + "</title>");
    out.println("</head>");
    out.println("<body>");
    out.println("<h2>"+"Read twice before u answer"+"<h2>");
    out.println("<p></p>");
    //why the value of q is not getting printed, instead i get null
    out.println("<h2>"+ q +"<h2>");
    out.println("how is it");
    out.println("</body>");
    out.println("</html>");
    Edited by: Mahesh_yeswecan on Nov 29, 2008 10:42 AM

    As u said , i have done a silly mistake earlier. though i have corrected the code still i am getting the same null value
    package servlet;
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.sql.*;
    public class test extends HttpServlet  {
         Connection con;
         ResultSet rs;
         Statement s;
         StringBuffer q;
         StringBuffer o1;
         StringBuffer o2;
         StringBuffer o3;
         public void getQuestion() throws Exception
              if(rs.next())
                   q=new StringBuffer(rs.getString("question"));
                   o1=new StringBuffer(rs.getString("option1"));
                   o2=new StringBuffer(rs.getString("option2"));
                   o3=new StringBuffer(rs.getString("option3"));
                   System.out.println(q);
                   System.out.println(o1);
                   System.out.println(o2);
                   System.out.println(o3);
         public void connect(){
              try
              Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
              con=DriverManager.getConnection("jdbc:odbc:ds","sa","server");
              s=con.createStatement();
              rs=s.executeQuery("select * from qa order by newid()");
              getQuestion();
              catch(Exception e)
                   System.out.println("erroe");
         public void doPost(HttpServletRequest request,HttpServletResponse response)
         throws IOException,ServletException
              response.setContentType("text/html");
              connect();
              PrintWriter out=response.getWriter();
              request.setAttribute("question", q);
              request.setAttribute("option1", o1);
              request.setAttribute("option2", o2);
              request.setAttribute("option3", o3);
              //RequestDispatcher rd=getServletContext().getRequestDispatcher("/show.jsp");
              //rd.forward(request, response);
              out.println("<html>");
            out.println("<head>");
             out.println("<title>" + "shock!!!" + "</title>");
            out.println("</head>");
            out.println("<body>");
            out.println("<h2>"+"Read twice before u answer"+"<h2>");
            out.println("<p></p>");
            //why the value of q is not getting printed, instead i get null
            out.println("<h2>"+ q +"<h2>");
            out.println("how is it");
            out.println("</body>");
            out.println("</html>");
    }

  • Avoid out.println inside servlet

    Is there a nice way to avoid hardcoding of HTML tag inside the servlet?
    I know it can be done by XML and XSL, but it is hard !!
    Is there any example i can look at to start?
    Is there any other way to do that? I want to separate the logic from the style with static and dynamic content, dynamic stand for "based on the logged on user profile"..
    Thank you.

    Yes, but i have lot of servlet, part of our framework, already implemented (all abstract class), move to JSP mean re-write all this servlet as normal class, i would like to write just a few classes to render html for the specified application.
    I know somebody did using XSL but it is hard to find some good example or tutorial.
    Thank you anyway.

  • 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.

  • Embedding HTML inside Flash File

    HI.
    I would like to inquire on how to embed a HTML file insides a
    Flash File.
    This is the scenario, I have several HTML files, e.g. a.html,
    b.html, c.html.
    Where there would be a links inside that flash file, to open
    a.html, b.html, and c.html (not a new browser).
    How can I do this? Guides / Tutorials would help.
    I am a bit a newbie in the world of Flash. Thank you in
    advance.
    /928 :)

    mauve928,
    > I would like to inquire on how to embed a HTML file
    insides
    > a Flash File.
    Dynamic text fields do support some HTML formatting, but
    it's important
    to understand that at this time, the supported tags comprise
    only a very
    small subset of the full HTML specification. (Search the Help
    panel for
    "supported HTML tags," and you'll see which ones they are.)
    As such, Flash
    Player simply doesn't load HTML files.
    What Flash Player does load is XML, so if your documents are
    formatted
    as XHTML (that is, technically XML), you'll have the
    beginnings of something
    you can use. Flash won't necessarily be able to display
    elements it doesn't
    understand (e.g. tables), but because the document is XML,
    you'll be able to
    parse those tags and extract information from them, using
    what Flash *is*
    capable of displaying.
    I wrote a series at Community MX not long ago that makes
    some
    exploration into what you're after.
    http://www.communitymx.com/abstract.cfm?cid=02395
    The first article (of three) is free, and you sign up for a
    non-obligatory free trial to read the rest.
    David Stiller
    Co-author, Foundation Flash CS3 for Designers
    http://tinyurl.com/2k29mj
    "Luck is the residue of good design."

  • Application starts IE and needs to access html inside Jar

    Hi everyone,
    I have a Swing application which i have deployed as an executable Jar file. One of the options i give the users within this application is the ability to view a html file in their default browser. However the html file is packaged within the jar and i cannot get Internet Explorer to target the html file when it exists inside the jar.
    I fire up IE using the following command :
    Runtime.getRuntime().exec( "rundll32 url.dll,FileProtocolHandler <path to html file>" ).
    The above command works no problem if my html file exists on my hard drive so for example the following works no problem:
    Runtime.getRuntime().exec( "rundll32 url.dll,FileProtocolHandler C:\test\help.html" )
    I have tried the following command by getting the URL for the html file using :
    URL theURL = myClass.class.getClassLoader().getSystemResource( "help.html" );
    I then get a path to the file:
    File aFile = new File( theURL.getFile() );
    String htmlFile = aFile.getAbsolutePath();
    and execute the command
    Runtime.getRuntime().exec( "rundll32 url.dll,FileProtocolHandler" + " " + htmlFile )
    However this was not successfull either.Can anyone tell me how i might get internet explorer to display a html file which is packaged within a jar.
    Thanks :)

    An idea. Never tried anything like this myself, so don't know if it will work. Don't see why it shouldn't though.
    A jar file is just a file in the zip format so write some code that uses the tools in java.util.zip to unpack the jar (or just specific contents) to somewhere like /temp
    Then use the runtime exec to start the browser with the argument /temp/file.html
    Hope this helps.

  • HTML inside flash Movie

    How can i link and view any html page inside a flash movie,
    for example, i
    want to view a yahoo page inside of a movie... I apreciate
    all coments and
    help... Please!!!

    EFREN,
    > How can i link and view any html page inside a flash
    movie,
    > for example, i want to view a yahoo page inside of a
    movie...
    > I apreciate all coments and help... Please!!!
    I'm afraid you can't. If you were reading your HTML
    documents with a
    browser, that would be one thing. Browsers are HTML-reading
    machines. The
    Flash Player is not. The Flash Player reads Flash files.
    While Flash does
    support a modicum of the full HTML spec -- see "About
    supported HTML tags"
    in the documentation for details -- Flash does not, as a
    rule, open HTML
    documents.
    David
    stiller (at) quip (dot) net
    Dev essays:
    http://www.quip.net/blog/
    "Luck is the residue of good design."

Maybe you are looking for