SSI of HTML file using SpryAssets

Hi,
I've saved a navigation header for my website in a nav.html
file. I'm trying to get another file, test.shtml, to use
server-side includes to include nav.html into it.
However, the nav.html file was built in DW using a Spry Menu
Bar, which stores its files in a directory SpryAssets.
I have the following statement located right after my
<body> tag, so it appears at the top of the webpage:
<!--#include file="nav.html" -->
The design view in DW shows the nav.html file included, but
menu-bar is expanded to look like normal text. The DW preview
doesn't show the nav.html being there at all.
Any ideas how to solve this? The nav.html file sits in the
same directory as test.shtml, and looks great when I open nav.html
alone.
Thanks in advance. -Gary

An Include is a code fragment, not an entire page.
It should not contain <html> or <body> tags, just
the snippet of code that
you are replacing the Include directive with.
As currently set up, your page code will look like this once
the Include has
been processed by the server and "included" in the main page
code:
This means duplicate doctypes, head tags etc etc which won't
work.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8" />
<title>Untitled Document</title>
<link href="StyleSheet.css" rel="stylesheet"
type="text/css" />
<style type="text/css">
<!--
-->
</style>
<script src="SpryAssets/SpryMenuBar.js"
type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarHorizontal.css"
rel="stylesheet"
type="text/css" />
<style type="text/css">
<!--
.style2 {
font-size: 16px;
font-weight: bold;
color: #336600;
margin-top: 30px;
margin-bottom: -12px;
.style3 {
color: #336600;
font-weight: bold;
.style6 {
font-size: 14px;
font-family: Arial, Helvetica, sans-serif;
font-weight: bold;
vertical-align: middle;
color: #6633FF;
.style7 {
font-size: 14px;
font-family: Arial, Helvetica, sans-serif;
position: static;
height: 0px;
top: 10px;
margin-bottom: -12px;
font-weight: bold;
color: #333333;
.style8 {
color: #CC0000;
font-weight: bold;
.style10 {
font-family: Arial, Helvetica, sans-serif;
position: static;
height: 0px;
top: 10px;
margin-bottom: -12px;
font-weight: bold;
color: #333333;
font-size: 13px;
.ucscheader {
font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
font-weight: bold;
margin-bottom: -10px;
text-align: center;
.spacer1 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
margin-bottom: 10px;
-->
</style>
</head>
<body>
<table width="750" border="0" align="center"
cellpadding="0"
cellspacing="0"
bgcolor="#669900">
<!--DWLayoutTable-->
<tr>
<td width="159" height="7"></td>
<td width="104"></td>
<td width="327"></td>
<td width="10"></td>
<td width="150"></td>
</tr>
<tr>
<td height="60" colspan="2" valign="top"><img
src="Images/jittertime_icon_logo.jpg" alt="JitterTime Logo"
width="222"
height="53" hspace="20" vspace="3" /></td>
<td> </td>
<td> </td>
<td valign="top"><img
src="Images/allabouttimingjitter.jpg" alt="Timing
Jitter Logo" width="129" height="56" hspace="0" vspace="2"
align="top"
/></td>
</tr>
<tr>
<td height="6"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="24" valign="top" bgcolor="#336600"
class="HomeText">Home</td>
<td colspan="2" valign="top" bgcolor="#336600"><ul
id="NavMenu2"
class="MenuBarHorizontal">
<a class="MenuBarItemSubmenu" href="#">Training</a>
<a href="#">Training Details</a></li>
<a href="#">Seminar Overview</a></li>
</li>
<a href="#"
class="MenuBarItemSubmenu">Resources</a>
<a href="#">Rates &amp;
Frequencies</a></li>
<a href="#">Phase Jitter Calculator</a></li>
<a href="#">Links</a></li>
</li>
<a class="MenuBarItemSubmenu" href="#">Articles</a>
<a href="#">Convert dBc/Hz to ps</a> </li>
</li>
<a href="#" class="MenuBarItemSubmenu">Company</a>
<a href="#">Biography</a></li>
<a href="#">Contact</a></li>
<a href="#">Policies</a></li>
</li>
</td>
<td colspan="2" valign="top" bgcolor="#336600"
class="HomeText"><div
align="right" class="SiteMap">Site
Map</div></td>
</tr>
</table>
<script type="text/javascript">
<!--
var MenuBar1 = new Spry.Widget.MenuBar("NavMenu2",
{imgDown:"SpryAssets/SpryMenuBarDownHover.gif",
imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
//-->
</script>
</body>
</html>
<p>this is a test</p>
</body>
</html>
Regards
John Waller

Similar Messages

  • How to parse a HTML file using HTML parser in J2SE?

    I want to parse an HTML file using HTML parser. Can any body help me by providing a sample code to parse the HTML file?
    Thanks nad Cheers,
    Amaresh

    What HTML parser and what does "parsing" mean to you?

  • How to display HTML files using ABAP Webdynpro?

    Hi,
    I have a html index file and a bunch of other files accessed by the index file  in a specific directory on the SAP server. I'd like to display the index file via ABAP webdynpro and allow the users to click on what they need to see. How can I achieve this using utilizing the ABAP webdynpro technology ?
    Thanks!

    Hi Thomas,
    Thanks for taking the time to answer my question.
    I have the main html file and all other files needed by the main file in one directory on the application layer of SAP. I'd like to provide the user with a link, by clicking on which they should be able to get to the main html file using the browser. This is just a standalone application.
    I can try the approach using BSPs, however, I'm new to that area. Could you point me in the right direction to get started?

  • How to read HTML files using UTL_FILE

    Hello Friends,
    How to read HTML files using UTL_FILE package ? According
    to Oracle documentation UTL_FILE can read or write OS Text Files.
    Thanx in advance..
    Adi

    HI Hareesh,
    i have gone through that blog.
    i tried it...but i am getting mapping error  no receiver determination fond because there are so  many excel files.
    my data is available on sharedString.xml but also it is in not same order.
    i have no clue how to handle this part form the blog.
    "This way our mapping will receive all data from the sheet in an XML format. The only thing that's left is to create an XSD file from the XML file we received in order to be able to use it in the mapping and as our Service Interface and we can proceed with mapping. As you can see from the sheet.xml files all the data is placed with column name and row number so it's not that difficult to map it to an table type format using the Message Mapping only (no java, abap mapping required)."

  • Opening HTML file using a Jbutton

    can anybody tell me how can I open an HTML file using a Jbutton.
    I have a help button on my menu of my GUI. I wanna open a html document using the help (jbutton)
    thank you

    call this class in your button action
    import javax.swing.JInternalFrame;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    import javax.swing.event.*;
    import java.net.URL;
    import java.net.MalformedURLException;
    import java.io.*;
    import javax.swing.text.*;
    import javax.swing.JOptionPane;
    import javax.swing.BorderFactory;
    import javax.swing.border.*;
    import javax.swing.JDesktopPane;
    public class Taa extends JFrame implements HyperlinkListener{
         public JEditorPane hh;
         public JScrollPane ss;
    *Taa default constructor
    *@param Nothing
    *@return Nothing
    *@thorws nothing
    *@see descon
    public Taa(){
    //set top left image in the gui
    setIconImage(Toolkit.getDefaultToolkit().getImage("buttons/help.jpg"));
    try{
         File f=new File("Here you can put your html"such as"Help.htm");
         String s = f.getAbsolutePath();
         s = "file:"+s;
         URL url = new URL(s);
    hh=new JEditorPane(s);
    hh.setEditable(false);
    hh.addHyperlinkListener(this);
    catch (MalformedURLException e) {
         System.out.println("Malformed URL: " + e);
    catch (IOException e) {
         System.out.println("IOException: " + e);
         ss=new JScrollPane(hh);
         getContentPane().add(ss);
         setBounds(232,0,490,500);
         setResizable(false);
         show();
    *Implementation of HyperlinkEvent
    public void hyperlinkUpdate(HyperlinkEvent e) {
         if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
         linkActivated(e.getURL());
    *this method activate link
    *@param URL the URL
    *@return Nothing
    protected void linkActivated(URL u) {
         Cursor c = hh.getCursor();
         Cursor waitCursor = Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR);
         hh.setCursor(waitCursor);
         SwingUtilities.invokeLater(new PageLoader(u, c));
    *this class load help files
    class PageLoader implements Runnable {
    *Taa default constructor
    *@param Url the url,Cursor c
    *@return Nothing
    *@thorws nothing
    *@see descon
         PageLoader(URL u, Cursor c) {
         url = u;
         cursor = c;
    public void run() {
         if (url == null) {
              // restore the original cursor
              hh.setCursor(cursor);
              Container parent = hh.getParent();
              parent.repaint();
         } else {
              Document doc = hh.getDocument();
              try {
              hh.setPage(url);
              } catch (IOException ioe) {
              hh.setDocument(doc);
              getToolkit().beep();
              } finally {
              // schedule the cursor to revert after
              // the paint has happended.
              url = null;
              SwingUtilities.invokeLater(this);
         URL url;
         Cursor cursor;

  • Help needed:Printing HTML file using javax.print

    Hi
    I am using the following code which i got form the forum for rpinting an HTML file.
    The folllowing code is working fine, but the problem is the content of HTML file is not getting printed. I am geeting a blank page with no content. What is the change that is required in the code? ALso is there any simpler way to implement this. Help needed ASAP.
    public boolean printHTMLFile(String filename) {
              try {
                   JEditorPane editorPane = new JEditorPane();
                   editorPane.setEditorKit(new HTMLEditorKit());
                   //editorPane.setContentType("text/html");
                   editorPane.setSize(500,500);
                   String text = getFileContents(filename);
                   if (text != null) {
                        editorPane.setText(text);                    
                   } else {
                        return false;
                   printEditorPane(editorPane);
                   return true;
              } catch (Exception tce) {
                   tce.printStackTrace();
              return false;
         public String getFileContents(String filename) {
              try {
                   File file = new File(filename);
                   BufferedReader br = new BufferedReader(new FileReader(file));
                   String line;
                   StringBuffer sb = new StringBuffer();
                   while ((line = br.readLine()) != null) {
                        sb.append(line);
                   br.close();
                   return sb.toString();
              } catch (Exception tce) {
                   tce.printStackTrace();
              return null;
         public void printEditorPane(JEditorPane editorPane) {
                   try {
                        HTMLPrinter htmlPrinter = new HTMLPrinter();
                        htmlPrinter.printJEditorPane(editorPane, htmlPrinter.showPrintDialog());
                   } catch (Exception tce) {
                        tce.printStackTrace();
         * Sets up to easily print HTML documents. It is not necessary to call any of the setter
         * methods as they all have default values, they are provided should you wish to change
         * any of the default values.
         public class HTMLPrinter {
         public int DEFAULT_DPI = 72;
         public float DEFAULT_PAGE_WIDTH_INCH = 8.5f;
         public float DEFAULT_PAGE_HEIGHT_INCH = 11f;
         int x = 100;
         int y = 80;
         GraphicsConfiguration gc;
         PrintService[] services;
         PrintService defaultService;
         DocFlavor flavor;
         PrintRequestAttributeSet attributes;
         Vector pjlListeners = new Vector();
         Vector pjalListeners = new Vector();
         Vector psalListeners = new Vector();
         public HTMLPrinter() {
              gc = null;
              attributes = new HashPrintRequestAttributeSet();
              flavor = null;
              defaultService = PrintServiceLookup.lookupDefaultPrintService();
              services = PrintServiceLookup.lookupPrintServices(flavor, attributes);
              // do something with the supported docflavors
              DocFlavor[] df = defaultService.getSupportedDocFlavors();
              for (int i = 0; i < df.length; i++)
              System.out.println(df.getMimeType() + " " + df[i].getRepresentationClassName());
              // if there is a default service, but no other services
              if (defaultService != null && (services == null || services.length == 0)) {
              services = new PrintService[1];
              services[0] = defaultService;
         * Set the GraphicsConfiguration to display the print dialog on.
         * @param gc a GraphicsConfiguration object
         public void setGraphicsConfiguration(GraphicsConfiguration gc) {
              this.gc = gc;
         public void setServices(PrintService[] services) {
              this.services = services;
         public void setDefaultService(PrintService service) {
              this.defaultService = service;
         public void setDocFlavor(DocFlavor flavor) {
              this.flavor = flavor;
         public void setPrintRequestAttributes(PrintRequestAttributeSet attributes) {
              this.attributes = attributes;
         public void setPrintDialogLocation(int x, int y) {
              this.x = x;
              this.y = y;
         public void addPrintJobListener(PrintJobListener pjl) {
              pjlListeners.addElement(pjl);
         public void removePrintJobListener(PrintJobListener pjl) {
              pjlListeners.removeElement(pjl);
         public void addPrintServiceAttributeListener(PrintServiceAttributeListener psal) {
              psalListeners.addElement(psal);
         public void removePrintServiceAttributeListener(PrintServiceAttributeListener psal) {
              psalListeners.removeElement(psal);
         public boolean printJEditorPane(JEditorPane jep, PrintService ps) {
                   if (ps == null || jep == null) {
                        System.out.println("printJEditorPane: jep or ps is NULL, aborting...");
                        return false;
                   // get the root view of the preview pane
                   View rv = jep.getUI().getRootView(jep);
                   // get the size of the view (hopefully the total size of the page to be printed
                   int x = (int) rv.getPreferredSpan(View.X_AXIS);
                   int y = (int) rv.getPreferredSpan(View.Y_AXIS);
                   // find out if the print has been set to colour mode
                   DocPrintJob dpj = ps.createPrintJob();
                   PrintJobAttributeSet pjas = dpj.getAttributes();
                   // get the DPI and printable area of the page. use default values if not available
                   // use this to get the maximum number of pixels on the vertical axis
                   PrinterResolution pr = (PrinterResolution) pjas.get(PrinterResolution.class);
                   int dpi;
                   float pageX, pageY;
                   if (pr != null)
                        dpi = pr.getFeedResolution(PrinterResolution.DPI);
                   else
                        dpi = DEFAULT_DPI;
                   MediaPrintableArea mpa = (MediaPrintableArea) pjas.get(MediaPrintableArea.class);
                   if (mpa != null) {
                        pageX = mpa.getX(MediaPrintableArea.INCH);
                        pageY = mpa.getX(MediaPrintableArea.INCH);
                   } else {
                        pageX = DEFAULT_PAGE_WIDTH_INCH;
                        pageY = DEFAULT_PAGE_HEIGHT_INCH;
                   int pixelsPerPageY = (int) (dpi * pageY);
                   int pixelsPerPageX = (int) (dpi * pageX);
                   int minY = Math.max(pixelsPerPageY, y);
                   // make colour true if the user has selected colour, and the PrintService can support colour
                   boolean colour = pjas.containsValue(Chromaticity.COLOR);
                   colour = colour & (ps.getAttribute(ColorSupported.class) == ColorSupported.SUPPORTED);
                   // create a BufferedImage to draw on
                   int imgMode;
                   if (colour)
                        imgMode = BufferedImage.TYPE_3BYTE_BGR;
                   else
                        imgMode = BufferedImage.TYPE_BYTE_GRAY;
                   BufferedImage img = new BufferedImage(pixelsPerPageX, minY, imgMode);
                   Graphics myGraphics = img.getGraphics();
                   myGraphics.setClip(0, 0, pixelsPerPageX, minY);
                   myGraphics.setColor(Color.WHITE);
                   myGraphics.fillRect(0, 0, pixelsPerPageX, minY);
                        java.awt.Rectangle rectangle=new java.awt.Rectangle(0,0,pixelsPerPageX, minY);
                   // call rootView.paint( myGraphics, rect ) to paint the whole image on myGraphics
                   rv.paint(myGraphics, rectangle);
                   try {
                        // write the image as a JPEG to the ByteArray so it can be printed
                        Iterator writers = ImageIO.getImageWritersByFormatName("jpeg");
                        ImageWriter writer = (ImageWriter) writers.next();
                                       // mod: Added the iwparam to create the highest quality image possible
                        ImageWriteParam iwparam = writer.getDefaultWriteParam();
                        iwparam.setCompressionMode(ImageWriteParam.MODE_EXPLICIT) ;
                        iwparam.setCompressionQuality(1.0f); // highest quality
                        ByteArrayOutputStream out = new ByteArrayOutputStream();
                        ImageOutputStream ios = ImageIO.createImageOutputStream(out);
                        writer.setOutput(ios);
                        // get the number of pages we need to print this image
                        int imageHeight = img.getHeight();
                        int numberOfPages = (int) Math.ceil(minY / (double) pixelsPerPageY);
                        // print each page
                        for (int i = 0; i < numberOfPages; i++) {
                             int startY = i * pixelsPerPageY;
                             // get a subimage which is exactly the size of one page
                             BufferedImage subImg = img.getSubimage(0, startY, pixelsPerPageX, Math.min(y - startY, pixelsPerPageY));
                                                 // mod: different .write() method to use the iwparam parameter with highest quality compression
                             writer.write(null, new IIOImage(subImg, null, null), iwparam);
                             SimpleDoc sd = new SimpleDoc(out.toByteArray(), DocFlavor.BYTE_ARRAY.JPEG, null);
                             printDocument(sd, ps);
                             // reset the ByteArray so we can start the next page
                             out.reset();
                   } catch (PrintException e) {
                        System.out.println("Error printing document.");
                        e.printStackTrace();
                        return false;
                   } catch (IOException e) {
                        System.out.println("Error creating ImageOutputStream or writing to it.");
                        e.printStackTrace();
                        return false;
                   // uncomment this code and comment out the 'try-catch' block above
                   // to print to a JFrame instead of to the printer
                   /*          JFrame jf = new JFrame();
                             PaintableJPanel jp = new PaintableJPanel();
                             jp.setImage( img );
                             JScrollPane jsp = new JScrollPane( jp );
                             jf.getContentPane().add( jsp );
                             Insets i = jf.getInsets();
                             jf.setBounds( 0, 0, newX, y );
                             jf.setDefaultCloseOperation( JFrame.DISPOSE_ON_CLOSE );
                             jf.setVisible( true );*/
                   return true;
              * Print the document to the specified PrintService.
              * This method cannot tell if the printing was successful. You must register
              * a PrintJobListener
              * @return false if no PrintService is selected in the dialog, true otherwise
              public boolean printDocument(Doc doc, PrintService ps) throws PrintException {
                   if (ps == null)
                   return false;
                   addAllPrintServiceAttributeListeners(ps);
                   DocPrintJob dpj = ps.createPrintJob();
                   addAllPrintJobListeners(dpj);
                   dpj.print(doc, attributes);
                   return true;
              public PrintService showPrintDialog() {
                   return ServiceUI.printDialog(gc, x, y, services, defaultService, flavor, attributes);
              private void addAllPrintServiceAttributeListeners(PrintService ps) {
                   // add all listeners that are currently added to this object
                   for (int i = 0; i < psalListeners.size(); i++) {
                   PrintServiceAttributeListener p = (PrintServiceAttributeListener) psalListeners.get(i);
                   ps.addPrintServiceAttributeListener(p);
              private void addAllPrintJobListeners(DocPrintJob dpj) {
                   // add all listeners that are currently added to this object
                   for (int i = 0; i < pjlListeners.size(); i++) {
                   PrintJobListener p = (PrintJobListener) pjlListeners.get(i);
                   dpj.addPrintJobListener(p);
              // uncomment this also to print to a JFrame instead of a printer
              /* protected class PaintableJPanel extends JPanel {
                   Image img;
                   protected PaintableJPanel() {
                        super();
                   public void setImage( Image i ) {
                        img = i;
                   public void paint( Graphics g ) {
                        g.drawImage( img, 0, 0, this );
    Thanks
    Ram

    Ram,
    I have had printing problems too a year and a half ago. I used all printing apis of java and I still find that it is something java lacks. Now basically you can try autosense. To check whether your printer is capable of printing the docflavor use this PrintServiceLookup.lookupPrintServices(flavor, aset); . If it lists the printer then he can print the document otherwise he can't. I guess that is why you get the error.
    Regards,
    Kevin

  • Pls Help--- URGENT... Combining XML file and HTML file Using java program.

    Hi, I need to implemnt this for my project....
    I need to combine XML and HTML file and generate a new HTML file
    Sample XML File:
    <user>
    <txtName>sun</txtName>
    <txtAge>21 </txtAge>
    </user>
    Sample HTML File:
    <body>
    Name: <input type="text" name="txtName" value=""
    Age : <input type="text" Age="txtAge" value=""
    </body>
    I need a java program to combine the above xml and html files and generate the output in HTML.
    Any kind of help is sincerely Appreciated.
    Thanks.

    toucansam wrote:
    So you want us to write it for you? It's pretty straight forward, first parse the xml file with the *[best java xml parser|http://www.google.com/search?&q=parsing+xml+in+java]* and then go through the nodes and construct the html with strings and concatination. Then write the file using *[the best java file writer|http://www.google.com/search?hl=en&q=writing+to+a+file+in+java]*.
    He would do better to use existing tools that make this easy [http://www.ling.helsinki.fi/kit/2004k/ctl257/JavaXSLT/Ch05.html|http://www.ling.helsinki.fi/kit/2004k/ctl257/JavaXSLT/Ch05.html]

  • How to upload html files using Weblogic Bulkloader

    I hav uploaded image files using bulkloader.
    however with html files am facing a prob.
    only the file structure gets created but there is no html file present inside.
    in
    Filename.html.md.properties i agv the followin
    nodeType=html
    lifecyclestatus=2
    File=C:\ContentRepository\a.html
    encoding=UTF-8
    charset=us-ascii
    mimeType = text/html
    shud i add some more properties...

    You have to do this your self by either (as vinod said) using a different component (not present in adf) or implementing this:
    1) allow the user to select multiple filenames (somehow)
    2) zip them together
    3) upload the zip
    4) unpack the zip on the server
    5) work with the files
    Timo

  • How to read html file using

    Gretting All,
    I have a html file....and also have a frame in which i m adding textarea with scroll pane...then setting the component using setcontentpane ....
    It's working fine....
    But i wanna display my html file in that textarea..
    how do i proceesed?
    regards,
    Tarique
    Marry X-mas

    BufferedFileReader in = new BufferedFileReader( new FileReader(....) );
    textArea.read(in, null);

  • How to upload an html file using jsp and jdbc

    Hi,
    im trying to upload an html page using JSP and jdbc. but of no success.
    my aim is to keep some important html pages in the database.the file size can vary.the file has to be selected from a local machine (through the browser) and uploaded to a remote machine(where the databse resides).
    any help/sample code or pointer to any helpful link is appreciated.
    thanks in advance
    javajar2003

    When uploading a file, I use a byte array as a temporary buffer..
    So, you should then be able to store the byte array in the
    database as binary data.
    example>
    //Temporary Buffer To Store File
    byte[] tmpbuffer = new byte[860];
    //Some Code To Upload File...
    //File Should Now Be In Byte Array
    //Get DB Connection and execute Prepared Statement
    Connection con=//GET DB CONNECTION;
    String sql=insert into TABLE(page) values(?);
    PreparedStatement ps=con.prepareStatement(sql);
    ps.setBytes(1,tempbuffer);
    ps.executeUpdate();
    //Close PS and Free DB Connection
    ..... and this method looks like you dont even have
    to store the file in a byte array, you can just give
    it the input stream.
    ps.setBinaryStream(int, inputStream, int);
    You may have to make several attempts at this. I have
    uploaded a file and temporarily stored it in a byte array,
    but have never from there stored it in the DB as binary
    data.. but this looks like it'll work.
    Good Luck!

  • How to mail the html file using javamail????

    hi
    i have captured the output of a jsp page in a html file....
    now i wish to send it in the mail ( *** not as an attachment)
    ie
    i wish the output of the jsp ie the html file to be displayed in
    the message box (ie text area) ..... and then when recieved by the
    receipient it shoud be displayed in the message area....
    is there any way to do this ........

    well as said by my fellow poster googling could have given you quick results.
    Anyways,if you are unable to do so checkout the below code snippet.
    SendMail.java:
    ===========
    import java.io.File;
    import java.io.FileReader;
    import java.io.BufferedReader;
    import java.util.Properties;
    import javax.mail.Session;
    import javax.mail.Message;
    import javax.mail.Transport;
    import javax.mail.internet.InternetAddress;  
    import javax.mail.internet.MimeMessage;
    import javax.activation.*;
    * @Author RaHuL
    * uses SMTP to send Email.
    public class SendMail {
        /** Method used to read contents of html/text/XML file */
        public String readFile(String fileName){
           StringBuffer sb = new StringBuffer();
           BufferedReader input = null;
           try{
               input = new BufferedReader(new FileReader(fileName));
               String str = null;
               while ((str = input.readLine()) != null){    
                      sb.append(line);
           }catch(Exception exp){
               exp.printStackTrace();
           }finally{
                  try {
                        if (input!= null)  
                          input.close(); 
                   }catch (Exception ex) {
                         ex.printStackTrace();
           return sb.toString();
        /** Send an HTML Email with the specific subject to specfic toAddress based on specified fromAddress & Smtp Hostname
          * and returns true on success.
        public boolean sendMail(String toAddress,String fromAddress,String hostName,String subject,String htmlMessage,String contentType) {
           boolean flag = false;    
            try {
                 String to = toAddress;
                 String from = fromAddress;     
                 String host = hostName;
                 // Setting Mail properties
                 Properties props = new Properties();
                 props.put("mail.smtp.host",host);
                 props.put("mail.debug","true");
                 // Getting a New Instance Generated by the API
                 Session session = Session.getInstance(props);
                   NOTE: a Mail Session could be configured and could be got from the Container via JNDI
                         which could be a better practise.
                // Instantiate a message
                Message msg = new MimeMessage(session);
                //Set message attributes
                msg.setFrom(new InternetAddress(from));
                InternetAddress[] address = {new InternetAddress(to)};
                msg.setRecipients(Message.RecipientType.TO, address);
                // Setting Subject Type
                msg.setSubject(subject);
                msg.setSentDate(new Date());
                // Setting Content Type
                msg.setContent(contentType);
                // Set message content
                msg.setText(htmlMessage);
                //Send the message
                Transport.send(msg);
                flag = true;
            }catch (Exception mex) {
             // Prints all nested (chained) exceptions as well
                mex.printStackTrace();
         return flag;
        public static void main(String args[]){
            SendMail sm = new SendMail();
            String htmlMessage = sm.readFile("myHtmlFile.html");
            boolean flag = sm.sendMail("[email protected]","[email protected]","your.smtp.server","EMail SubJect",htmlMessage,"text/html");
            if(flag)
              System.out.println("MAIL SENT SUCCEFULLY");
             else
              System.out.println("MAIL SENDING FAILURE");                          
    }NOTE:
    =====
    Make sure you inculde javamail & java activation libraries.
    Hope that might help :)
    REGARDS,
    RaHuL

  • Displaying HTML file using IFrame

    Hi All,
    I have an HTML file in my par file. It is contained as dist\html\test.html. Now I want to display this inside an IFrame. If I try something like
    <iframe id="myIframe" src="html\test.html"  width=100% height=100% frameborder="0"></iframe>
    it fails to load the HTML file. Please let me know how to display this.
    Thanks in advance
    Shubhadip

    Hi George,
    as per your suggestion I have used
    <% String html = componentRequest.getWebResourcePath() + "/html/test.html";%>
    <iframe id="myIframe" src=<%=html %>  width=100% height=100% frameborder="0"></iframe>
    But its not working.. giving the following error:
    Portal Runtime Error
    An exception occurred while processing a request for :
    iView : pcd:com.sap.portal.system/temporaryobjects3/9b20d054b8a1ab8c2cd5d105cde1788c/TestDynPage
    Component Name : null
    Page could not create the iView.
    But if I give some web url like yahoo.com it works fine. How to do it then?
    Thanks,
    Shubhadip

  • How to generate PDF file from HTML file using Acrobat API's

    Hi,
    I want to generate a PDF file from an HTML file on server side(C# .Net).
    Their is a COM interop called "AcrobatWeb2PDF" availaible but could not find any document regarding how to use it.
    I cant use "Adobe live cycle PDF Generator" as we just have license for Adobe Acrobat 8 Professional.
    Please help...
    Thanks and Regards,
    Anand Mahadik.

    > It is hard to believe that Adobe doesn't provide a toolkit for generating PDF files, so many web based applications have vector based content that needs to be converted to PDF!!!!
    They do, it's just not free (A company in business to make money? I'm sure IBM would never think this way... ;)). As mentioned you have Adobe LiveCycle PDF Generator, which you can customize and extend with Java. You also have the Adobe PDF Library SDK, which is written for use with C/C++ although if you license it from Datalogics (the only company in NA Adobe allows to license the PDF Library) you will also get .NET and Java interfaces (part of the DLE - DataLogics Extensions).
    > There must be a way to generate PDF dynamically on a server or from Javascript!
    JavaScript? Not really, no. As far as I'm aware JavaScript has no file system access capabilities without some form of intermediary (like sending the data to a webservice that writes it out to file). How would you create a PDF file with JavaScript?
    The PDF Standard is also in ISOs hands now (ISO 32000-1:2008), it is no longer owned by Adobe - you can download a copy of the specification from them and write your own library based on that as well.

  • Opening a HTML file using platformRequest

    Hi all,
    I am able to open a URL using the platformRequest() method.
    However, is it possible to open a HTML file which is stored in the file system? I tried the code given below, but it didn't work.
    platformRequest("file:///root1/Temp.html");Is this possible?
    Thanks,
    Venkat

    Hey Venkat,
    From what I understand, this HTML file is not inside your JAR -it is in the file system of the phone. In MIDP 2.0, for accessing the file system of the mobile, there are optional APIs that a MIDP device needs to support. This code will not work for MIDP 2.0

  • Question about HTML files using TextEdit

    First off, I wanted to ask if this is the proper place to post a question about HTML/XHTML. I couldn't really find anywhere else that seemed to fit better, but please point me in the right direction if this is not the place. Thanks.
    Moving on -- here's my question:
    I'm having trouble with working with HTML files in TextEdit. I'm on a Mac, using TextEdit as my HTML editor (I can not afford one of these other HTML editors, and I like using a simple text editor like TextEdit for HTML). Here's my problem: I open a new rich text document in TextEdit and write my HTML and then choose File>Save As and choose "HTML" under the File Format drop-down box. Having saved this file as an HTML file, I then open Safari and choose File>Open File and select my HTML file; however, when I do this, my web page's text does not appear in the browser window. Instead, the HTML code itself appears in the browser window, as if the browser was not interpreting it as HTML and converting it. The same problem happens when saving the file as a .htm file using Microsoft Word for Mac.
    So, as another solution (at the suggestion of a helpful poster in a previous thread), I tried creating a plain text file in TextEdit (instead of a rich text file like before). Now, in TextEdit there is no option for saving plain text files as HTML files, so I simply save it as a Unicode-8 format and then find the file in Finder and change the extension to .htm myself (I've tried .html as well). This, fortunately enough, actually works! When I open the file in Safari I get to see my web page as expected. However, the first time I quit out of the application TextEdit and then try to reopen my .htm file in TextEdit, I no longer can see my HTML code. Instead, TextEdit shows me the actual web page text that I would expect to see when I open the file in a browser, and my HMTL code is lost.
    Can someone please help me here? There has to be a way to edit HTML in TextEdit without the code disappearing every time you quit out of the application and reopen the HTML file. Any help is greatly, greatly appreciated. Thank you.

    That's the problem -- once I convert it to plain text there is no longer an HTML option under the Save As drop down menu. The drop down menu's title is Plain Text Encoding instead of File Format and the only options I get are Unicode-8, Unicode-16, Western, Chinese, and so forth. I can save it as an HTML file, but only if the file is rich text, which doesn't work for HTML.
    So, I can save it as plain text (.txt) and then go and change the extension myself, and like I said, it works if I do that. I can edit HTML in TextEdit and open the file properly in Safari to view my web page. The problem is (I went over all this in my first post) that, after that, if I exit TextEdit and reopen it, my document is no longer HTML code -- it is now simply the text of the web site as if I had opened it in a broswer.
    What do you suggest I do?

Maybe you are looking for

  • Adapter Module Receiver File Adapter

    Hi All, I am getting file name in the Mapping in my target structure in a field FILENAME and i want to use this field to create a file at the target with the name as the value in FILENAME. I have to develop this by using Adapter Module. Note : This c

  • Application in apex.oracle workspace

    hi, I got workspace on apex.oracle for making demo application. having Workspace :SANJAY_WS User ID :[email protected] Password :huveku Application -Id id 20376 I made an application (id 20376) and exported it then translated it to italian. It is bei

  • How to use XPath with Namespaces in the xml ?

    Hi all, I need to reference a certain Node in a Document using XPath notation. The problem is the the XML Document contains Namespaces inside it f.e. <xn:SubNetwork id="JRANM">     <xn:VsDataContainer id="1">        <xn:vsDataType>vsDataAreas</xn:vsD

  • Change all referenced files in Aperture for entire library?

    Hi experts... All my Aperture files are on an external HDD and I had to copy everything over to a new drive recently. The old drive was called "photos", the new drive is called "My Passport". Without thinking about it, I made the new directory struct

  • Invoking a Remote Method

    The Question is ? Suppose there is a object running on system, Say A. Another Object/Client want to invoke a method of the object in the System A and that method returns some value. Now the problem is if the method invoked returns the values in more