ServletServlet and IMG Tag

System: WebLogic Server 4.50
          Please look at the followin snippet from one of my servlets:
          out.println("<table cellspacing='10' cellpadding='0' border='0'
          bgcolor='#acdfb9'>");
          out.println("<tr>");
          out.println(" <td><IMG align=top border=0 height=100
          src='header_merch_pic.jpg' width=100>"
          out.println(" <font face='Arial' size='+2'
          color='white'><b><i>Magic</i></b></font>");
          out.println(" </td>");
          When I run this servlet as a registered class, it works fine. However
          when I try to run this guy under
          through the ServletServlet servlet (is that like USA Today today), I get
          an error reported on the server
          which states the following:
          Thu Dec 02 16:00:26 CST 1999:<E> <ServletContext-Servlets> Servlet
          failed with ServletException
          Thu Dec 02 16:00:26 CST 1999:<E> <ServletContext-Servlets>
          javax.servlet.ServletException: No servlet found for PATH_INFO =
          /com/novusnet/mrchsrv/java/MagicBannerServlet/header_merch_pic.jpg
          I'm a little confused since the only place where header_merch_pic.jpg
          appear is in an out.println() call, which is simply output to the
          browser and shouldn't be attempted to be loaded as another servlet. If
          the IMG line is removed, the servlet works, I just can't display the
          graphic. What gives?
          Please help,
          Matt
          

Let me guess something: you set up your webserver to proxy everything
          under the /com/novusnet/mrchsrv/java directory as a servlet. Since you
          used a relative path for the image, Weblogic is looking there for the
          image and expecting it to be a servlet.
          Try an absolute path to the image.
          Matt Schoaf wrote:
          >
          > System: WebLogic Server 4.50
          >
          > Please look at the followin snippet from one of my servlets:
          > out.println("<table cellspacing='10' cellpadding='0' border='0'
          > bgcolor='#acdfb9'>");
          > out.println("<tr>");
          > out.println(" <td><IMG align=top border=0 height=100
          > src='header_merch_pic.jpg' width=100>"
          > );
          > out.println(" <font face='Arial' size='+2'
          > color='white'><b><i>Magic</i></b></font>");
          > out.println(" </td>");
          >
          > When I run this servlet as a registered class, it works fine. However
          > when I try to run this guy under
          > through the ServletServlet servlet (is that like USA Today today), I get
          > an error reported on the server
          > which states the following:
          >
          > Thu Dec 02 16:00:26 CST 1999:<E> <ServletContext-Servlets> Servlet
          > failed with ServletException
          > Thu Dec 02 16:00:26 CST 1999:<E> <ServletContext-Servlets>
          > javax.servlet.ServletException: No servlet found for PATH_INFO =
          > /com/novusnet/mrchsrv/java/MagicBannerServlet/header_merch_pic.jpg
          >
          > I'm a little confused since the only place where header_merch_pic.jpg
          > appear is in an out.println() call, which is simply output to the
          > browser and shouldn't be attempted to be loaded as another servlet. If
          > the IMG line is removed, the servlet works, I just can't display the
          > graphic. What gives?
          >
          > Please help,
          > Matt
          

Similar Messages

  • HTML embeded in Flash and img tag

    I'm currently developing an application in flash, which
    consist of a hand-drawn screen, in which HTML page appears. To
    achieve this I used a TextField with html option. Unfortunately,
    TextFiles show only some simple tags – is there any other way
    to show more complicated ones in Flash CS3 (and AS3)? I have also a
    problem with the <img> tag. Picture loaded via <img>
    doesn’t print from TextField. My printing code attached -
    webpage_txt is control to print. Do you konw why it doesn't print?
    Thanks in advance for help.

    Currently, no, there are only simple HTML tags available.
    Though, FlashPlayer10 promises to have much greater support for
    text, including inline tables, etc.. You may just have to make do
    with what you have for now, and wait for the new player.
    As for your picture woes, I unfortunately am unable to help
    you there, with very little printJob experience myself.

  • Trying to add img scr, alt and title tags to a Photoshop created web gallery.

    I need to add some tags to a web photo gallery created by Photoshop. I've posted the same question in the PS Forum just in case.
    I need to add img src, alt and title tags to the images in the web gallery. Normally this is as simple as working on the code in the html page in which the image sits but the PS gallery doesn't seem to be that simple. I'm not sure exactly what file to put these tags in.
    Can anyone tell me exactly how, and which files I need to work on, to add these tags to each of my 42 gallery images?
    Thanks.
    John.

    The gallery is a mess and I might just rebuilt it using something else like Jalbum, but here it is: http://thewoodshopmalvern.com/ThumbnailGallery/index.htm
    Yes, I'm sorry, I'm trying to add ATTRIBUTES to the <img> tag.
    For the rest of the site I have simply gone to each of the html pages and updated the code itself - pretty straightforward. But PS seems to use Javascript in making this gallery and unfortunately I just don't know enough about Java to understand exactly where I need to add these attributes.

  • IMG tag and XML syntax

    Hi,
    I want to dynamically embed image url into the IMG tag as follows:
    <jsp:useBean id="image" scope="request" class="mybeans.ImageBean" type="mybeans.ImageBean" />
    <img src='<jsp:getProperty name="image" property="imagePath"/>'    />The problem arises because of confusion with closing/opening tags getting mixed up.. How do I get this code to work if i'm using xml syntax in my jsp pages? Any solutions?
    P.

    It would be complaining about using a tag as an attribute to another tag.
    ie nesting a tag within the tag, rather than between open/close tags for it.
    Solution? Don't nest tags like this. I'm figuring you have to use an expression of some sort.
    either <img src='<%= image.getImagePath %>'/>
    or using EL in a JSP2.0 container:
    <img src='${image.imagePath}'/>
    I can't say I have done strict xml stuff, so I might be a little off, but thats the general idea.
    Hope this helps,
    evnafets

  • Getting img tags to work in sub page using jstl core import tag

    Am trying to bring disparate system page reports together under one web app. This means using the jstl core import tag (I dont want to redirect as I want to hide the urls, this web app provides better security than those it calls).
    Use of the import tag works to a degree but any resources (ie. img tags) don't load.
    Have created a much simplified example that demonstrates..
    So heres the jsp...
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <h3>Delivery Performance Report</h3>
    <c:url value="http://localhost/mycontext/subpage.html" var="myUrl"/>
    <c:import url="${myUrl}" />and a simple sub page (note plain html, no jsp, this mimics my project as the other systems are hidden source, non jsp)
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
    <HTML>
    <HEAD>
    <TITLE>sub page</TITLE>
    </HEAD>
    <BODY>
         This is the sub page<br>
         <img src="images/banner_image.jpg" />
    </BODY>
    </HTML>While I dont get any errors what I do get is ..
    Delivery Performance Report
    This is the sub page
    ...but image fails to load.
    If I redirect instead of import it works, but as I said I need to hide the url from the user as security is an issue.
    Any help appreciated, really pulling my hair out with this final stage of something that will make a real difference to us!
    regards,
    G.

    Thanks for the answer but Im afraid thicko here doesnt get it.
    The img src is relative to the sub page, and I have tried it with an absolute address (ie. http://localhost/.....) with the same result.
    If I call the sub page direct (get with browser) the image tag works. Its just if the sub page is imported with the jstl core import tag.
    I've not tried a base tag. The real project always returns pages containing absolute urls... http://ourReportServer/reports?....plenty of params so dont belive relevant, please correct me if Im wrong here though.
    thanks, G.

  • IE problem with img tag calling stored procedure

    I have an img tag in my JSP which looks like this (it has a very long src value):
    <img src="http://www.enetrix.com/cores/net_charts.display_temp_chart?vChartDef_in=ChartType%20=%20DIALCHART;Chart
    . . . and so on and so on . . .
    26,%2075.0);&vChartType_in=PNG&vChartURL_in=http://333.333.33.333/j2ee/servlet/chart"/>
    In short, the img calls a stored procedure and passes it a servlet among many other things. The procedure passes back an image to the browser.
    The image shows up in Firefox but not IE 7. I don't think its an issue with the stored procedure but I can't understand why IE doesn't show the image. Is there something I'm missing? I've tried both jpeg and png.
    Thanks
    Eric

    As the related posts suggest, you will need to use direct JDBC code for this.
    Also I'm not sure JDBC supports the RECORD type, so you may need to wrap your stored functions with ones that either flatten the record out, or take OBJECT types.

  • Generate image with CFIMAGE - but need to use img tag to serve the content

    I create a new image with cfimage, that already works without
    any problems.
    But instead of using the action="writetobrowser" I need to be
    able to use the script inside a img tag:
    Example: <img
    src="myscript.cfm?somedata=iwanttheimagetocreate>
    I found one webpage that deals with that problem (
    http://www.webdevelopernews.com/2007/09/14/serving-up-cfimages-via-image-tags/)
    but the image served to the browser, when using the code below, is
    of a very low quality and another point is that you can't serve
    .gif's to the browser.
    <cfcontent type="image/jpg"
    variable="#ImageGetBlob(backgroundimage)#">
    Any suggestions/solutions?
    Thanks,
    Phil

    In that entry Raymond mentions:
    "The WriteToBrowser action actually generates HTML that points
    to a ‘magic’ URL to serve the image.". ie <img
    src="/CFFileServlet/_cf_image/_cfimg-12345036853711072.PNG" alt=""
    />
    Perhaps you could create a function that captures the
    generated html by using <cfsavecontent>.
    <cfsavecontent variable="imageTagHTML">
    <cfimage action="writeToBrower" ..>
    </cfsavecontent>
    Then uses a regular expression to extract and return the url
    portion only. ie
    "/CFFileServlet/_cf_image/_cfimg-12345036853711072.PNG"
    <cfset ExtractedURLHere = SomeFunction(arguments...)>
    <cfoutput><img
    src="#ExtractedURLHere#"></cfoutput>
    Though you could also use the entire html string directly
    <cfoutput>#imageTagHTML#</cfoutput>

  • How to display JPEG in JSP w/o IMG tag?

    I have a working application where a jpeg image is ecoded on the server via a JavaBean. The bean is then forwarded to a JSP, which gets the unique jpeg filename from the bean and displays it with an html <IMG> tag. All's fine and well, but I'd like to get away from having lots of image files laying around on the server and just display the image encoded in the current request. I tried creating a custom tag to encode and display the jpeg using the com.sun.image.codec.jpeg.* package in this manner:
    ServletResponse res = pageContext.getResponse();
    OutputStream os = res.getOutputStream();
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(os);
    encoder.encode(imageRef); //-- imageRef is instance of BufferedImage
    and in the JSP:
    html, other tags, etc.
    <graph:image imageRef='<%= imageBean.getImage() %>'/>
    The image displays, but nothing else in the JSP (ie. html, other custom tags). In all other tags I've written, JSPWriter is used for output, but I need an OutputStream for the createJPEGEncoder() method.
    Can anyone tell me if what I want to do is possible? I'm chasing my tail at the moment.
    TIA Mark

    Would this work for you:
    Create the IMG tag in the JSP with the SRC as a servlet.
    Also, add any parameters you may need to tell the servlet what image to send back.
    Something like this:out.print("<IMG SRC=\"/servlet/ImageProducerServlet?WhichImage=");
    out.print("MySpecialImage");
    ...The ImageProducerServlet can be setup to send back the JPEG image file.

  • Img Tag in textfield adobe air problem help :(

    Hi there,
    i ve got a textfield on the stage and wanted to give it a img
    tag.
    If i am using flash 9 in publishing, it is no problem.
    if i change to adobe air. There is no img in the textfield.
    Is this a bug???

    I've had the same problem. Using an img tag in a dynamically
    generated text field does not work the same published for AIR as it
    does published for Flash Player. If I use a relative path for the
    image or the class name of a symbol in the library in Flash it
    works perfectly, but neither work if the same code is published for
    AIR. Is there a solution to this that anyone knows of?
    Here's an example:
    var optionFont:Font = new UniversBold();
    var optionFormat = new TextFormat();
    optionFormat.color = 0x27318b;
    optionFormat.bold = true;
    optionFormat.size = 38;
    optionFormat.font = optionFont.fontName;
    var field:TextField = new TextField();
    field.embedFonts = true;
    field.autoSize = TextFieldAutoSize.LEFT;
    field.defaultTextFormat = optionFormat;
    field.selectable = false;
    field.htmlText = "Hi There <img src='GTE38'> Hi There";
    field.wordWrap = true;
    field.width = 200;
    addChild( field );
    UniversBold and GTE38 are classes in the library. This works
    when published for Flash, but if republished for AIR, the image
    does not show up.

  • Title in img tag

    I wish there was a field for title in the img tag like there
    is for the alt. As it is, when I want to put a title on an image, I
    have to do it in the code view.
    For those who don't know, the title tag will create a
    "tooltip" when someone hovers over an image, either in IE or
    FireFox. Works well, and better than using the "alt" for a tooltip.
    I'd rather use "alt" for a description of the image for screen
    readers.

    Tag inspector panel has it.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Malcolm N_" <[email protected]> wrote in message
    news:[email protected]..
    > On Thu, 19 Jul 2007 18:20:30 +0000 (UTC), "typist"
    > <[email protected]> wrote:
    >
    >>Well, I have to admit I hand code quite a bit,
    Michael. But I insert
    >>pictures
    >>using design view because it will include the height
    and width for me.
    >>
    >
    >
    > Well if you hand code the
    > img src="/img/test.jpg" alt="test" />
    > that's fine
    >
    > If you then select the above code in code view - go to
    the properties
    > panel - click on the W ( width ) and H ( height )
    letters - DW puts in
    > the width and height info for you :-)
    >
    > I only discovered this by accident after using DW for
    about 6 years !
    >
    > Not sure how to add the title in a similar way - I agree
    the
    > properties panel should have it.
    >
    >
    >
    > --
    >
    > ~Malcolm N....
    > ~

  • Img tag in TextField : a nightmare ?

    After reading of the documentation about Flash TextField
    class (used by Label and Text), I was expected a lot of this
    component, especially about the
    img tag.
    I spent a lot of hours trying to make it working as the doc
    says. Each time I have runtime errors.
    Using link to jpeg or png files I have Error #1034 (I comment
    a "resolve" bug in the JIRA adobe bug system).
    Then I try to embed images with a link identifier to a
    movieclip symbol (seams to be the only way to use embedded images).
    After spending a long time to understand what that was meaning
    (just ONE example should have save half day of work !!! may be the
    Adobe guy should be advised that not all the Flex developpers comes
    from Flash !), I was abled to use a swf file made with fresh
    downloaded Flash CS3.
    But that time if the first assignment to htmlText property is
    ok, when I change the value I have error #2025 (DisplayObject must
    be a child of the caller - translate from french).
    So I am quite disappointed about Flex choice today...
    I was abled to add a support for the missing <table>
    tag but I don't know how to easily rewrite a complete TextField
    which can insert images (embedded in swf).
    If anybody has success with images in TextField, let me know
    Thanks.

    I've had the same problem. Using an img tag in a dynamically
    generated text field does not work the same published for AIR as it
    does published for Flash Player. If I use a relative path for the
    image or the class name of a symbol in the library in Flash it
    works perfectly, but neither work if the same code is published for
    AIR. Is there a solution to this that anyone knows of?
    Here's an example:
    var optionFont:Font = new UniversBold();
    var optionFormat = new TextFormat();
    optionFormat.color = 0x27318b;
    optionFormat.bold = true;
    optionFormat.size = 38;
    optionFormat.font = optionFont.fontName;
    var field:TextField = new TextField();
    field.embedFonts = true;
    field.autoSize = TextFieldAutoSize.LEFT;
    field.defaultTextFormat = optionFormat;
    field.selectable = false;
    field.htmlText = "Hi There <img src='GTE38'> Hi There";
    field.wordWrap = true;
    field.width = 200;
    addChild( field );
    UniversBold and GTE38 are classes in the library. This works
    when published for Flash, but if republished for AIR, the image
    does not show up.

  • Unclosed meta/img tag. Output method= xml / xhtml / xml

    Hello,
    Im trying to parse from a Document to an String, in the usually way, as follows:
        public static String parseDocument(Document document) {
            try {
                if (document== null) {
                    return null;
                TransformerFactory tFactory =
                        TransformerFactory.newInstance();
                Transformer transformer = tFactory.newTransformer();
                DOMSource source = new DOMSource(document);
                StringWriter sw = new StringWriter();
                StreamResult result = new StreamResult(sw);
                transformer.transform(source, result);
                String xmlString = sw.toString();
                return xmlString;
    //TODO: error handling
            } catch (TransformerConfigurationException ex) {
                return null;
            } catch (TransformerException ex) {
                return null;
            } catch (Exception ex) {
                return null;
    }Ive maked a test that creates a Document:
      public static Document createFromDoc(){
            try {
                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                DocumentBuilder builder = factory.newDocumentBuilder();
                DOMImplementation impl = builder.getDOMImplementation();
                Document doc = impl.createDocument(null, null, null);
                Element root = doc.createElement("html");
                doc.appendChild(root);
                Element head = doc.createElement("head");
                root.appendChild(head);
                Element meta = doc.createElement("meta");
                meta.setAttribute("http-equiv", "Content-Type");
                meta.setAttribute("content", "text/xml");
                meta.setAttribute("charset", "UTF-8");
                head.appendChild(meta);
                Element title = doc.createElement("title");
                head.appendChild(title);
                Element body = doc.createElement("body");
                root.appendChild(body);
                Element div = doc.createElement("div");
                div.appendChild(doc.createTextNode("Created with docs."));
                body.appendChild(div);
                return doc;
            } catch (ParserConfigurationException ex) {
                Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
                return null;
        }Well, you can see the test method "prueba1". Y:
        public static void prueba1(){
            Document doc1 = Main.createFromDoc();
            //String doc2 = Main.createFromString();
            String doc1Str = GestorXMLDoc.parseDocument(doc1);
            return;
        }Why my method public static String parseDocument(Document document) adds this extra meta tag when it transforms a Document to an String:
    <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
    and modifies the other meta tag as follows (I mean, unclosing it):
    <meta charset="UTF-8" content="text/xhtml" http-equiv="Content-Type">
    You can see the full String result:
    <html>
    <head>
    <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="UTF-8" content="text/xhtml" http-equiv="Content-Type">
    <title></title>
    </head>
    <body>
    <div>Created with docs.</div>
    </body>
    </html>I tried parsing with a fake XSLT Template with output: XML, and it doesnt works. I tried changing the meta content data with "text/xml".
    This method makes the document not compatible with XML, because it doesnt close the meta tag. I need work with this XHTML doc as a valid XML document, not as a HTML (W3C allows set meta/link/img tags unclosed) to add new nodes.
    Thank you ppl =)

    First of all, what you are trying to do is transforming, not parsing. Parsing is converting an XML document into an internal form, and you already have the XML in the internal form (org.w3c.dom.Document).
    Anyway, XSLT has special rules for transforming a document whose root element's name is "html". It looks like those rules are being applied in your case. If you don't want them to be applied (which you don't if you are producing XHTML) then you have to tell the transformer you want XML as your output and not HTML.
    If you had an XSLT document you would use <xsl:output method="xml"/>, but you don't have one in this case. So you do it like this:
    transformer.setOutputProperty(OutputKeys.METHOD, "xml");

  • Using img tag with htmlText

    I'm trying to display images within mx:Text components using htmlText.  However, no matter what I try, I can't get an image to display.  The application just displays whitespace where the <img> tag is.  My current code looks something like:
                <mx:Text id="test_html" width="100%" height="100%">
                    <mx:htmlText>
                        <![CDATA[
                            <p>Why can't I include an image =(</p><img src='assets/add_icon.gif' width='20' height='20' align='left' hspace='10' vspace='10' />
                        ]]>
                    </mx:htmlText>
                </mx:Text>
    What I get displayed when I view this is:
    I've tried essentially every permutation that I can think of -- setting the htmlText in actionScript, using all different paths (app:/assets/add_icon.gif, ../assets/add_icon.gif, add_icon.gif, embedding the image and using {<classname>.addIcon}).  I have other images embedded in the application using the path "../assets/<image file>" and they work fine (they're not being used in htmlText).
    Has anyone had this kind of trouble before?  Any idea what might be going wrong?

    does anybody know anything? how long do i need to wait to see
    if someone replies? I just need to know if it is possible or not.

  • How to pass src value into img tag in ADF

    Hi,
    My Dev : 11.1.2.3.0
    How to pass row values into <img> tag.,I used the below code but it's taking empty.,
    I tried both ways like #{row.CdFilePath}   and   ${row.CdFilePath}
    <af:iterator var="row"
                      value="#{bindings.xxx.collectionModel}"
                     id="i2">
         <img src='/ShowImage?src=#{row.CdFilePath}' border='0' style="width:100px; height:100px; margin:5px;"/>
    </af:iterator>
    Please tell me any other option is there..
    Thanks

    This works if you use a normal table so I guess it should work here too.
    Are you sure the el #{row.CdFilePath} return something?
    Why don't you use the adf image tag <af:image source="/ShowImage?src=#{row.CdFilePath}".../> instead of the html img tag?
    Should the src property not be enclosed with " instead of your '?
    Timo

  • img tag

    I have a problem about writing <img tag in the xsl file. Below are the xml and xsl file.
    **************************** XML file **********************************
    <image>promo_banner_onecard.gif</image>
    **************************** XSL file **********************************
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <xsl:output method="html" encoding="utf-8"/>
    <xsl:template match = "test">
    <td width="165" valign="top"><b>& l t ;img src="../images/<xsl:value-of select="image"/>" width="158" height="60" border="0"& g t ;</b></td>
    The output can't interpret the <img src ....> but treat it as the text only and display it on the html page -- <img src="../images/test.gif" width="158" height="60" border="0"> So how can I make the img work? Thanks.

    Use an xsl:element block with xsl:attributes inside it to produce the img tag like this:<xsl:element name="img">
      <xsl:attribute name="src">
        <xsl:value-of select="concat('../images/', image)" />
      </xsl:attribute>
    </xsl:element>Have a look at the other XSL tags you can use at http://www.w3schools.com/xsl/xsl_w3celementref.asp

Maybe you are looking for

  • Screenshot copyright question?

    I have no idea what forum I'd ask this question, so if my question can't be answered here, please advise where to post. I'd like to put a screenshot of a Numbers spreadsheet on my website to demo something, but I don't know if there are any copyright

  • Reports not getting generated

    Dear All, I know this is a repeat query but im unable to find information from the blogpost http://scn.sap.com/docs/DOC-41109. I have earlier configured the WWI setup in a linux server. Now I am testing it on a windows server. I have made all the con

  • I want to use the sound card with LabView

    Hi. Who can help me, I want to use the sound card with LabView, I have found the function but I can't use it. Thanks.

  • How to make a custom infotype field the time constraint 1?????

    Hello everyone I have this challenging question for gurus to answer it. In custom created infotype for OM Ii have that field called ZZJOBID. When infotype was created I assigned the time constraint 1 for that infotype. That time constraint was base o

  • No 'create' button in RSA2

    Hi Expert     i plan to create a data source by using RSA2 whereas i found there is no 'create/change' button in the screen of RSA2. only 'display' there.     my user has sap_all authority. are there additional roles needed? thanks