Displaying HTML Background's in JSP's

Can anyone help?
I have 2 JSP's, called via a servlet. All the code works fine and all I want to do is dislay a background picture. Both JSP's have the same layout, shown below.
<html>
<head><title>Football</title></head>
<body background="../Web%20graphics/grass_background.gif">
.....code.......
</body>
</html>
One of the JSP's displays the background fine and one doesn't. I have definitely made sure that I have re-compiled all code concerned and I have also stopped started both Tomcat and my browser just to make sure. Both JSP's are also in the same directory. Am I going mad. Help would be appreciated.
Cheers
Mitch

Do both have the same exact <body> tag to display the background? Also, are both JSPs in the same directory? If not, perhaps the relative URL doesn't apply to both?

Similar Messages

  • Displaying html code in JSP page

    Hi.
    How do I display HTML code in an jsp page, so that the actual code is printet on the screen
    fx:
    <html>
    <head>
    </head>
    <body>
    </body>
    </html>

    I can't get my reply to show properly, but the answer is;
    Change < into &lt ; and > into &gt ;
    but with the semi-colons stuck next to the &lt and &gt if you get my drift

  • How to display a pdf file in jsp

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

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

  • Displaying Korean Characters on my jsp

    I would like to display korean characters in my jsp....the characters that i want to display are read from an xml file using the sax parser... how will i do this?

    Case 1 - In a JSP only.
    In a JSP you need to set the following and it will display your respective charset. Substitute xxx for your required character set.
    <%response.setContentType="charset=xxx"%>.
    Case 2 - In an XML file and JSP
    If you have an XML file, be sure to define the encoding. Be sure to change the encoding to your Korean charset.
    <?xml version="1.0" encoding="ISO-8859-2"?>
    You will the need to write an XSL which you can apply to your XML file using Xalan and output the resulting HTML in a JSP. I assume your user-agent will be a web browser, although you can use WML, cHTML and VoXML or even another XML file.
    Rajesh Thiharie
    New Delhi, India
    91 124 6455511 x 109 Work

  • Can i display HTML

    Can i make this code display HTML, and how?
    Examples and comments please. i need help
    Simpletext Java Applet.
    Applet displays a text file from the web in a text area.
    The Text Area is as large as the APPLET Width and Height commands.
    There is no animation
    It loads quickly
    And provides information that can be provided quickly.
    Utilizes the following Params
    <PARAM NAME = "filename" Value = "URL">
    <PARAM NAME = "fontname" Value = "Fontname">
    <PARAM NAME = "fontsize" Value = "Fontsize">
    This is very useful for placing on a page where you want to have information
    added without having to touch the HTML in the page.  It can also be placed into
    a table.
    import java.awt.*;
    import java.io.DataInputStream;
    import java.io.BufferedInputStream;
    import java.io.IOException;
    import java.net.URL;
    import java.net.URLConnection;
    import java.net.MalformedURLException;
    public class simpletext extends java.applet.Applet implements Runnable
      URL theURL;
      Thread runner;
      TextArea ta = new TextArea("Getting text...",7,70);
      public void init() {
        String fname = getParameter("fontname");
        String fsize = getParameter("fontsize");
        int fs = Integer.parseInt(fsize);
        Font tafont = new Font(fname,Font.PLAIN,fs);
        String url = getParameter("filename");
        try { this.theURL = new URL(url); }
        catch ( MalformedURLException e) {
          System.out.println("Bad URL: " + theURL);
      ta.setEditable(false);
      ta.setFont(tafont);
      setLayout(new BorderLayout());
        add("Center",ta);
    //    string fnts = getFontList();//not yet implemented in Toolkit
      public void start() {
        if (runner == null) {
          runner = new Thread(this);
          runner.start();
      public void stop() {
        if (runner != null) {
          runner.stop();
          runner = null;
      public void run() {
        URLConnection conn = null;
        DataInputStream data = null;
        String line;
        StringBuffer buf = new StringBuffer();
        try {
          conn = this.theURL.openConnection();
          conn.connect();
          ta.setText("Connection opened...");
          data = new DataInputStream(new BufferedInputStream(
                   conn.getInputStream()));
          ta.setText("Reading data...");
          while ((line = data.readLine()) != null) {
              buf.append(line + " HERE\n");
         ta.setText(buf.toString());
        catch (IOException e) {
          System.out.println("IO Error:" + e.getMessage());
    }

    Well now we are getting somewhere.
    Yes your right it is a copy and paste job, i needed
    somewhere to start and found that and thought it was
    good.
    I have been coding PHP/MySQL/HTML for years now so i
    think i am ready to learn java.
    PHP! Ick!
    i have been following the tutorials at:
    http://java.sun.com/docs/books/tutorial/getStarted/cup
    ojava/index.html
    and iv read up to:
    http://java.sun.com/docs/books/tutorial/java/data/garb
    agecollection.html
    Well that's a good start.
    The point of my applicvation:
    To display realtime quotes (stock prices). or atleast
    with 30 second updates.Ah-ha!
    here is my PHP version:
    http://www.fxdon.com/pgs/main_indices_frame.php
    (which updates every 30 seconds)more Ah-ha!
    >
    and what i ment about security, is i didnt want to
    "Hard-Code" SQL database details into this incase
    someone somehow can decompile it.?This is a good reason. Also because then you don't have to open up the database to socket connections from anyone on the net.
    I just thought it would be easier to have unix cron
    update the database automatically and use php page to
    fetch the updates and java to display it.
    Also i cant make php page refresh automatically like
    u can with java, i have to use some meta refresh
    tags.Okay.
    >
    Am i on the wrong track?Yes.
    What you need to do is basically implement a simple webservice. (This seems to be a popular topic today.)
    The idea is that the data comes from your site through HTTP but it is not really a web page. It is some sort of data page.
    Before I go further I am going to suggest something rather simple. A better model might use a webservice standard of some sort and return the data in an XML doc for example. You can read more about webservices in Java here http://java.sun.com/webservices/index.jsp
    Now here is my example.
    On the server have a php script like this.
    <?php
    /*I am assuming an open mysql connection here. Also that your GET
    request variables are being parsed and are available for use*/
    header("Content-type: text/plain");
    if(!$sym){
      echo "FAIL\nNO SYMBOL\n";
    }else{
      $rs = mysql_query("SELECT company,lastrade FROM stockprice WHERE symbol=".$sym);
      if($row = mysql_fetch_row($rs)){
        echo "OK\n";   
        echo $row[0]."\t";
        echo $row[1]."\t";
        echo "\n";
      }else{
        echo "FAIL\nUNKNOWN SYMBOL\n";
    ?>Then when you want to get the data from the applet you put in the url like this..
    www.mysite.com/mystockpriceservice.php?sym=AAA
    And the content returned will be a text file.
    The first line will say OK if everything worked or FAIL if it didn't. If it fails then the second line tells you why.
    If it does work then the second line will be a tab delimited string of all the values.
    Then you can do as you want in the applet to display that data. As a ticker or whatever.
    Do you see where I am going with this?
    Like I said this implementation is rather simplistic but the basic idea is there.

  • To display spanish characters on a JSP when the JSP is inside one portal

    Hi All,
    Previously, I had posted my query here that how to display spanish characters on a JSP screen.
    I got a solution that to add
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    to the JSP and to save the JSP in 'UTF-8'encoding format.
    This works well in case an individual JSP. But when I am adding the JSP to a web project consisting of many other JSP pages, its not working.
    Do I have to change anything else.
    Please help me if you have any suggestions. I am eagerly waiting for any response.
    Thanks in advance.

    I used to have a similar problem. I have jsp pages in braz. portugese and for these I have    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">When I tried setting the contentType to UTF-8, the way you wrote foreign characters didn't get submitted properly from input fields so I took it away, then everything worked correctly. Don't know why though.

  • Edit HTML Background

    I imagine this question has been asked many times in this forum, but I can't seem to locate any answers.
    Is it possible to edit the HTML background with an image?
    I know Captivate allows you to select the background color, but I don't see any options to upload images to display behind the elearning in the web page.  I'm using Captivate 5 (and also have access to Captivate 3).
    Thanks,
    Victor C.

    Hi there
    Sorry, but there has never been any provision for adding images to the background of the HTML page produced by Captivate. If you desire to have this, you will need to use a tool like Adobe Dreamweaver or another HTML editor.
    I would encourage you to suggest it to the development team. Use the Wish Form for this. (Link is in my sig)
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • Disconnecting from external display changes background, disconnect server shares, inactivates desktop icons.

    I have a user working on a MacBook Pro, Lion OS X 10.8.2, connected to an external display. When disconnecting from the external display the background picture changes, he can’t open documents saved to desktop, and the connection to the server shares is lost.  Rebooting does not resolve the issue while it is disconnected from the external display.  If he reconnects the MacBook back to the external monitor sometimes he has to reboot to get everything back to normal.  It almost seems like it is logging him into a different account or profile or something like that (please excuse my messy terminology as most of our users are still using PCs).  However if you look at what account is logged in, it is still the same account that he logged in with that morning.  The Mac is not authenticating to the network, just connecting to server shares.  Has anyone experienced this issue before and if so is there a fix for it?

    The Mac has a long history of assuming that ANY adapter still present means the display is still present -- you need to remove the adapter as well as the cable, if present.
    So my theory articulated above is that the disconnect is not registered correctly. This would mean that the second display is still seen as present. You could check this by invoking:
    System Preferences > Displays ...
    and looking for the Arrange pane (shown above) which is ONLY present when multiple displays are attached. More detailed information can be found in About this Mac  > ( More info ) Graphics & Displays ...
    ... specifically the NAME of each attached display is shown or an indication (no display connected):
    ATI Radeon HD 4870:
      Chipset Model:          ATI Radeon HD 4870
      Type:          GPU
      Bus:          PCIe
      Slot:          Slot-1
      PCIe Lane Width:          x16
      VRAM (Total):          512 MB
      Vendor:          ATI (0x1002)
      Device ID:          0x9440
      Revision ID:          0x0000
      ROM Revision:          113-B7710C-176
      EFI Driver Version:          01.00.318
      Displays:
    Cinema HD:
      Resolution:          2560 x 1600
      Pixel Depth:          32-Bit Color (ARGB8888)
      Display Serial Number:          CY8360UFXMP
      Main Display:          Yes
      Mirror:          Off
      Online:          Yes
      Rotation:          Supported
    Display Connector:
      Status:          No Display Connected

  • How Do I Display HTML Formatted Text From A Data Table In Crystal Reports?

    I'm creating reports in Crystal XI.  The information being displayed in the reports comes from data tables where the text is formatted in HTML.
    I've worked with Crystal Reports enough to know that HTML text pulled from a data table doesn't appear in Crystal the same way it does in a web browser.  Crystal Reports ignores all the tags (...unless I'm missing something...) and just displays the text.
    Someone far more Crystal savy than I (...who I don't have access to...) came up with a Formula Field workaround that tricks Crystal Reports into displaying some basic HTML tags.  Here's that workaround:
    <!--
    stringVar TableName := ;
    TableName := Replace (TableName, "<ul>","<br> <br>");
    TableName := Replace (TableName, "<li>", "<br>   &bull; ");
    TableName := Replace (TableName, "</li>", "");
    TableName := Replace (TableName, "</ul>","<br> <br>");
    TableName := Replace (TableName, "<a", "<u><font color='blue'");
    TableName := Replace (TableName, "</a>", "</font></u>");
    TableName
    -->
    QUESTION - Does any similar workaround exist so I can display an HTML Table in Crystal Reports?  If not, is there any way to display HTML formatted text from a data table in Crystal Reports as it would appear in a web browser?

    Hi Steven,
    To display html text in Crystal Reports follows these steps.
    1. Right click on the field and select Paragraph tab.
    2. Under 'Text Interpretation' select 'HTML Text' and click OK.
    I have tried using the way,but it never works.So reply me if there is any way to solve the issue

  • Display pop ups in the jsp by using Java script

    Hi
    can any body say ,how to display pop ups in the jsp by using Java script ?

    that's correct. You can use the below code for AJAX request.
    <script type="text/javascript">
    var httpObject = getHTTPObject();
    //create XMLHttpRequest object
    function getHTTPObject() {     
         var xmlhttp;
         if (window.XMLHttpRequest) // if Mozilla, Safari etc
              xmlhttp = new XMLHttpRequest();
         else if (window.ActiveXObject){ // if IE
              try {
                   xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
              catch ( e ){
                   try{
                        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                   catch ( e ){}
         return xmlhttp;
    //define the function to send the request
    function sendRequest(){
        var currDesc = document.getElementById("description").value;
        var URL =  "manageMaintAction.do"; //action mapping in your struts-config
        var queryString = "currDesc="+escape(currDesc); //get the currDesc value in your action class like request.getParameter("currDesc")
        httpObject.open( "Post", URL, true );
        httpObject.onreadystatechange = cbFn;
        httpObject.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded");
        httpObject.send(queryString);
    //callback fn
    function cbFn() {
        if (httpObject.readyState == 4)
             if (httpObject.status == 200)
              var result = httpObject.responseText;
              alert(result);
    </script>

  • How to display HTML response file in user's browser following submission of Livecycle form

    I have a PDF form created via Livecycle that does a HTTP submit to the webserver. The server returns a HTML 'submission receipt' page which is either opened in Acrobat or the user's web browser.
    Previously this process worked fine when submitting from adobe reader - the html receipt file would always automatically open OK in the user's browser. However, with newer versions of Reader (11.0.0+) I now get this error and no attempt to open the user's web browser:
    An error occurred during the submit process. Cannot process content of type text/html
    I realise why I get the error - Adobe reader can't display HTML files.
    What I don't understand is why it doesn't open the html file in the user's browser like it has been doing for years.
    Does anyone have any idea how I can fix this (without changing the response content type to PDF/FDF)?

    I had the same issue as you and we used FDF status, then eventually went with returning an XDP  that filled out a receipt section of the form.

  • How to display HTML file  (on server path) to ADF jspx page ?

    Hi Team,
    We have a requirement to display HTML content which is in tabular format on a page. This page is jspx page based on page template and this html has to be shown on a radio button select. I am trying to do this with Jquery but since the id of all components in jspx comes as pt1:id (pt1 being the id of page template) and : being a special character in Jquery, I am not able to proceed further.
    the syntax of Jquery to load html file a POC has been done outside Jdeveloper is working fine with a general syntax of
    $("#selector".load("html path"));
    Please let me know is they any other solution to load the file?
    Thanks
    Pavan

    For example
    - (void)viewDidLoad {
        [super viewDidLoad];
        NSURL *fileURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"readMe" ofType:@"html"]];
        [infoWebView loadRequest:[NSURLRequest requestWithURL:fileURL]];
    and from the .h
    @property (nonatomic, retain) IBOutlet UIWebView *infoWebView;

  • How to display HTML file from Unix server on UI at runtime

    Hi Experts,
    My requirement is to display  HTML files,  related to some particular person, on UI. The file is existing on a separate UNIX server and a file related to one person may have a lot of attached files as well , as is the case generally with HTML files, including pictures etc. So it is no use transferring file on my CRM system, as the files are kept separately on this UNIX server which is particularly for this kind of storage.
    I am able to show files residing on MIME repository ( I created some new HTML files )  of my CRM system on UI. but I don't know how to go ahead with this particular requirement.
    One idea is that I can map one folder of my application server to that unix server so that I can see the HTML files in this particular folder. but I don't know how to map MIME repository folder to application server directory or directly to the UNIX server .
    Please advise. Is my approach correct or is there any other way ?
    thanks in advance.
    Regards,
    Vikas

    Maybe this is too simple, but have you got an HTTP server on the UNIX machine? You could simply link the URL into you CRM application and display the contents directly from UNIX.
    cheers Carsten

  • HTML Comments in a JSP Document

    I am writing a JSP Document that has a number of comments. Some I want to be server-side such as version history and some I want to be client-side.
    Using a JSP page this is easily achieved using JSP comments <%-- JSP comment for server-side --%> and HTML Comments<!-- HTML comment client-side -->.
    Using XML syntax a number of things are apparent:
    1. There is no XML equivalent of a JSP comment (this has been well doc'd for a long time).
    2. In the Java EE tutorials the recommended alternative to a JSP coomment is a HTML comment.
    3. Using HTML comments in a JSP document the web container omits these in the page output - and so they are server-side only just like a JSP comment.
    Code Snippet:
    <template xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:c="http://java.sun.com/jsp/jstl/core" version="1.2">
    <!-- this comment will not appear in the generated source on the client browser -->
    </template>
    <!-- JSP fragment for no caching policy -->
    So, my question is how do I generate a client-side comment in a JSP Document?
    Thanks
    Edited by: DJT on Mar 3, 2008 4:28 AM
    Edited by: DJT on Mar 3, 2008 4:30 AM

    I found this ....
    http://www.javaworld.com/javaworld/jw-07-2003/jw-0725-morejsp.html
    One significant disadvantage of JSP documents is that no XML-compliant version of JSP comments exists. A JSP document developer can use client-side (HTML-/XML-style) comments or embed Java comments in scriptlets, but there is no JSP document equivalent to <%-- -->. This is a disadvantage because the other two commenting styles JSP documents can use have their own drawbacks. You can see the client-side comments in the rendered page using the browser's View Source option. The Java comments in scriptlets require placing Java code directly in the JSP document.
    So try to embed the HTML comment inside scriptlet tags...
    <%
    <!-- HTML comment here -->
    %>

  • Displaying data in xml using jsp

    how do we display data in database from jsp using xlst format in xml browser view

    how do we display data in database from jsp using xlst
    format in xml browser viewRefer this Post
    http://forum.java.sun.com/thread.jsp?forum=45&thread=482077&tstart=0&trange=15
    -Regards
    Manikantan

Maybe you are looking for

  • Image processing from .txt file onto an intensity graph

    I am doing a mini project in my class and I was wondering if anyone could help me. It about image processing but I am bit stuck. Heres the idea: "An image is really nothing more than a 2D array of data. The value of every element in the array corresp

  • From Mac Pro to Macbook and back, round-trip help (new user)

    I've searched a bit, but honestly I'm not sure yet what I'm searching for exactly so please excuse this post if it's been explained previously. Picked up Aperture a few days ago, reading, learning the tutorials, loving it... I wanted to make sure I'm

  • Problems with ADF in JDeveloper 10.1.2 - Focus Handling in a Table

    Hi there, we have a problem with the focus handling in a JClient-Table (embedded in a JScrollPane). When I insert a new row in a table (e.g. with 2 columns), and insert in the second column some text and (while the focus is still in the second column

  • Playing multiple sounds at once

    Hi guys, I have this problem for some time now (I just havent got time to deal with it) - after latest installation of arch I am unable to play sound from multiple programs at once (eg from firefox and xmms). I tried to figure out alsa configuration

  • DMM 4.1 to 5.0 migration

    Customer has 4.1 running in a test mode on a server that can not be upgraded to 5.0. He has a new DMM 5.0 server installed that he has been testing with and now wants to move all of the presentations that he has been using in the 4.1 system to the 5.