Oddities when serving images via NES from a servlet that is part of a WAR

Just wanted to confirm that the following behavior is normal:
          Environment:
          NT 4.0 SP5
          NES 3.6 SP3
          WLS 5.1 SP3
          jdk 1.2.2
          Goal: When constructing a page that has images embedded in it from my
          servlet, I would like NES to serve the images.
          I've found out that I've to refer to my images with an absolute URL that
          maps to the images directory under Netscape's document root. If I refer to
          my image with a relative URL (request.getContextPath() +
          "/images/cookie.jpg"), then WebLogic tries to retrieve the image from the
          WAR. What is interesting is if I use relative references to images within my
          servlet (minus the WAR, i.e. with the servlet registered in
          weblogic.properties), I see that the image is being served by Netscape.
          Why does the WAR require absolute references to images and the previous
          mechanism does not? Is this behavior consistent with the spec? How are you
          guys handling this (are you using absolute references to static content when
          using WAR?)?
          I'm really baffled by this and wanted to see how others view this. Any
          comments/feedback will be much appreciated.
          Thanks,
          Sanjiv
          

Hi Cameron,
          You are right but see my "Goal" below. I want to serve my images from my web
          server and NOT by WebLogic. Anyway, I spent too much time on this and found
          out that I was getting inconsistent results during testing different
          approaches because I was not restarting my web server. Once I became
          consistent in restarting my web server and closing all browser windows
          before each test, I got consistent results. So, here's what works for me:
          If I want to have my JSPs/servlets running in WLS to serve images that are
          included in their output from my web server, then I've to use absolute URLs.
          An example would be:
          img src="/images/a.gif"
          On the other hand if I use relative paths like img src="images/a.gif", then
          the browser request for the image is sent to WebLogic, which then looks for
          the image in the WAR (as it should).
          All of this might be common knowledge to most folks but not me.
          Thanks,
          Sanjiv
          Cameron Purdy <[email protected]> wrote in message
          news:[email protected]...
          > The WAR does not require absolute paths. Your JSP must be served from a
          URL
          > that, when combined with a relative path, actually specifies an image in
          the
          > WAR.
          >
          > Cameron Purdy, LiveWater
          >
          > "Sanjiv Gulati" <[email protected]> wrote in message
          > news:[email protected]...
          > > Just wanted to confirm that the following behavior is normal:
          > >
          > > Environment:
          > > NT 4.0 SP5
          > > NES 3.6 SP3
          > > WLS 5.1 SP3
          > > jdk 1.2.2
          > >
          > > Goal: When constructing a page that has images embedded in it from my
          > > servlet, I would like NES to serve the images.
          > >
          > > I've found out that I've to refer to my images with an absolute URL that
          > > maps to the images directory under Netscape's document root. If I refer
          to
          > > my image with a relative URL (request.getContextPath() +
          > > "/images/cookie.jpg"), then WebLogic tries to retrieve the image from
          the
          > > WAR. What is interesting is if I use relative references to images
          within
          > my
          > > servlet (minus the WAR, i.e. with the servlet registered in
          > > weblogic.properties), I see that the image is being served by Netscape.
          > >
          > > Why does the WAR require absolute references to images and the previous
          > > mechanism does not? Is this behavior consistent with the spec? How are
          you
          > > guys handling this (are you using absolute references to static content
          > when
          > > using WAR?)?
          > >
          > > I'm really baffled by this and wanted to see how others view this. Any
          > > comments/feedback will be much appreciated.
          > >
          > > Thanks,
          > > Sanjiv
          > >
          > >
          >
          >
          

Similar Messages

  • 'Sending failure' message when sening image via bluetooth from phone

    Hia,
    I'm getting a 'sending failure' message when sending an image from my phone to my new imac.
    I have no trouble sending content from this phone to my old powerbook and have no trouble sending content from my new imac to my phone.
    Cheers,
    David

    If you have a new iMac then you posted in the wrong forum. This area is for G5 iMac issues. Apple has not made any G5 iMacs since 2005.
    Suggest that you re-post over in the Internet, Networking and your *Intel-based* iMac Forums

  • I just got iPhone 5s and after a day when I open the notifications from the top that make the phone shows the apple sign and back to unlock!!

    I just got iPhone 5s and after a day when I open the notifications from the top that make the phone shows the apple sign and back to unlock what can I do as I reset all settings and nothing changed ??

    So after looking a bit closer i have noticed that when i have the phone plugged into the computer it shows the songs but when i dont have it plugged in and i go so the song icon on the bottom of the music menu screen it says i have no songs!

  • Dynamically output a  image via struts insted of servlet

    Hello,
    I want to know how to dynamically output a image via struts insted of servlet;
    I can work it fine with the serverlet, this how i get it to work via serverlet:
    java class:
    public class ImageServlet extends HttpServlet {
    public void doGet(HttpServletRequest request, HttpServletResponse response)
              throws ServletException, IOException {
    in web.xml :
    <servlet>
    <servlet-name>ImageServlet</servlet-name>
    <servlet-class>com.admin.transferform.ImageServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>ImageServlet</servlet-name>
    <url-pattern>/ImgServlet</url-pattern>
    </servlet-mapping>
    and access the pic in[b] jsp :
    <img src="/ImgServlet"></img>
    <br>
    I just want to know, how do i access via struct?
    i change the java class to :
    public class ImageServlet extends Action {
    public ActionForward execute(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response) {
    and in struts-config.xml :
    <action
    path="/image"
    type="com.admin.transferform.ImageServlet">
    </action>
    and i have tryed both these in jsp but none did work:
    in JSP :
    <img src="/image"></img>
    or
    <html:image src="/image" />
    can some one tell me, where did i went wrong pleaseee :)

    ImageServlet java :
    package com.admin.transferform;
    import java.io.*;
    import java.net.URLConnection;
    import javax.servlet.ServletException;
    import javax.servlet.http.*;
    import org.apache.log4j.Logger;
    import org.apache.struts.action.Action;
    import org.apache.struts.action.ActionError;
    import org.apache.struts.action.ActionErrors;
    import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionForward;
    import org.apache.struts.action.ActionMapping;
    public class ImageServlet extends Action {
         private static Logger logger = Logger.getLogger(ImageServlet.class);
    public ActionForward execute(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response) {
              try {
                   InputStream in = new BufferedInputStream(new FileInputStream("/export/projects/images/headernews.jpg"));
                   logger.debug("dec : trying to output the image file");
                   String s = URLConnection.guessContentTypeFromStream(in);
                   response.setContentType( s );
                   byte pic[]= new byte[in.available()];
                   in.read( pic );
                   OutputStream out = response.getOutputStream();
                   out.write( pic );
              } catch (IOException e) {
                   logger.error("Error opening file region", e);
              return null;
    in struts-config :
    <action-mappings>
    <action
    path="/image"
    type="com.waterfind.admin.transferform.ImageServlet">
    </action>
    </action-mappings>
    jsp :
    <img src="<html:rewrite action="/image"/>">
    or
    <img src="/myContext/image.do"/>
    none working still, any more help please :)

  • "Rend Error" when sending image via iChat/AIM

    On my brand new iMac aluminum, I am unable to send, and friends are unable to send, images via iChat AIM 3.1.8 (V445). When either of us try to send, we get the message "An undefined AIM error has occured. The server message was: Rend: Error"
    I then spin around and use my old G4 iMac to send an image - no problem. My buddy is also able to send to me, no problem.
    Both computers are connected to the same Linksys WRT54G router. When I searched for the term 'rend' only one thread came back which suggested to change the port from 5190 to 443. I did this and it didn't help.
    Any other suggestions?

    Hi Craig,
    In the Linksys set up pages you have Application and Gaming (Which is where I think you are talking about)
    In there there are several options.
    Port Forwarding, Port Triggering, DMZ (possibly UPnP Forwarding and QoS)
    Disable any Port Forwarding or Port Triggering. DO not use the DMZ.
    Save settings. (you should still have Web browsing and Mail abilities).
    GO to the Administration tab on the top row.
    Enable UPnP.
    Save Settings.
    UPnP allows multiple computers to use the same ports.
    This way the Linksys can be left doing DHCP if you wish and it will not matter if your computer gets a new IP every now and then. Also the Ports are opened by the application and close after a timed period of non use.
    You can limit the "Hops" to the number of devices the computer is from the Linksys (1 ?) to make it more secure.
    On the main set up page you could limit the the DHCP range to the number of computers you have to prevent outside connections.
    The ports you describe so far are only the TExt chatting and file sending ports
    11:23 AM Monday; August 13, 2007

  • When sending images via iPhoto it doesn't register as sent mail in A

    When sending images from iPhoto it does not register as sent mail in Apple Mail. Is there an option to allow this?

    No.  But in iPhoto's Info tray for that photo there will be a note that the photo was mailed and to whom:
    Click to view full size
    OT

  • Skipping when playing music via AirPlay from iPad to pioneer avr.

    I'm having skipping issues when trying to AirPlay music from the iPad to pioneer avr using AT&amp;T uverse 2wire router/modem. 
    Any advice as to the cause?  I have a sinking suspicion that it's the uverse router.  By the way,  I have the fastest Internet option that AT&amp;T is offering.

    Also,   This only seems to happen when using the iPad2.  When I use my iPhone the skipping doesn't occur.

  • How is a client certificate accessed from a servlet that received a SSL3 enabled client-side cert required request

    I would like to know the variables in the http header that hold the client cert information simillar to SSL_CLIENT_CERT variable in apache and how do I access these from a servlet ?

    I would like to know the variables in the http header that hold the client cert information simillar to SSL_CLIENT_CERT variable in apache and how do I access these from a servlet ?

  • Ipad only uses one file name when uploading images via email

    We have an image tool that uploads images to a template website. The problem is the file names for these images must be unique any duplicate file names will be rejected. Some of our users want to be able to upload from the field but Ipad only assigns the file name "photo.JPG" to jpegs. It doesn't seem to include the sequential extension that actually does exist for the image on the file name when uploading. Is there a way to get ipad to do so, or is this something that Apple maybe want to consider looking into. I can easily see the average Joe emailing themselves images and hitting save only to replace and lose an older image because let's face it, not all users are on MACs and PC's do not allow multiple files to have the same file name in the same folder.

    Hi,
    Based on the description, you could send email to external addresses without the Twin Oaks software. However, with the Twin Oaks software, you couldn't send successfully.
    For this issue, I recommend you enable message tracking and check whether you could retrieve message tracking log entires when you send emails to external addresses through the Twin Oaks software.
    If you couldn't retrieve message these tracking log entires when you send emails to external addresses through the Twin Oaks software, it means that the Exchange server is OK and the crux of the problem is the Twin Oaks software.
    Here is an article about message tracking log for your reference.
    Get-MessageTrackingLog
    http://technet.microsoft.com/en-us/library/aa997573(v=exchg.141).aspx
    Best regards,
    Belinda
    Belinda Ma
    TechNet Community Support

  • ConnectionClosedException when POSTing images via HTTPS

    Greetings,
    I am trying to send images to a server from my Verizon BlackBerry 8330 using an HTTPS connection. I am performing the following steps:
    HttpsConnection https = (HttpsConnection)Connector.open("https://myserver");
    https.setRequestMethod(HttpsConnection.POST);
    https.setRequestProperty("Content-Type", "image/jpg");
    FileConnection file = (FileConnection)Connector.open("file:///filename", Connector.READ_WRITE);
    InputStream is = file.openInputStream();
    OutputStream os = https.openOutputStream();
    byte[] b = new byte[1024];
    for(int i; (i = is.read(b)) != -1;) {
    os.write(b, 0, i);
    int code = https.getResponseCode();I am receiving a ConnectionClosedException when I call getResponseCode() after the final write() to the OutputStream, but I can't think of anything in my code that is closing the connection.
    Does anyone know what could be causing the connection to be closed between the time that I open the connection and finish writing to its OutputStream?
    Thank you.

    Greetings,
    I am trying to send images to a server from my Verizon BlackBerry 8330 using an HTTPS connection. I am performing the following steps:
    HttpsConnection https = (HttpsConnection)Connector.open("https://myserver");
    https.setRequestMethod(HttpsConnection.POST);
    https.setRequestProperty("Content-Type", "image/jpg");
    FileConnection file = (FileConnection)Connector.open("file:///filename", Connector.READ_WRITE);
    InputStream is = file.openInputStream();
    OutputStream os = https.openOutputStream();
    byte[] b = new byte[1024];
    for(int i; (i = is.read(b)) != -1;) {
    os.write(b, 0, i);
    int code = https.getResponseCode();I am receiving a ConnectionClosedException when I call getResponseCode() after the final write() to the OutputStream, but I can't think of anything in my code that is closing the connection.
    Does anyone know what could be causing the connection to be closed between the time that I open the connection and finish writing to its OutputStream?
    Thank you.

  • Character conversion problems when calling FM via RFC from Unicode ECC 6.0?

    Hi all,
    I faced a Cyrillic character convertion problem while calling an RFC function from R/3 ECC 6.0 (initialized as Unicode system - c.p. 4103). My target system is R/3 4.6C with default c.p. 1500.
    The parameter I used in my FM interface in target system is of type CHAR10 (single-byte, obviously).
    I have defined rfc-connection (SM59) as an ABAP connection and further client/logon language/user/password are supplied.
    The problem I faced is, that Cyrillic symbols are transferred as '#' in the target system ('#' is set as default symbol in RFC-destination definition in case character convertion error is met).
    Checking convertions between c.p. 4103  and target c.p. 1500 in my source system using tools of transaction i18n shows no errors - means conversion passed O.K. It seems default character conversion executed by source system whithin the scope of RFC-destination definition is doing something wrong.
    Further, I played with MDMP & Unicode settings whithin the RFC-destination definition with no successful result - perhaps due to lack of documentation for how to set and manage these parameters.
    The question is: have someone any experience with any conversion between Unicode and non-Unicide systems via RFC-call (non-English target obligatory !!!), or can anyone share valuable information regarding this issue - what should be managed in the RFC-destination in order to get character conversion working? Is it acceptable to use any character parameter in the target function module interface at all?
    Many thanks in advance.
    Regards,
    Ivaylo Mutafchiev
    Senior SAP ABAP Consultant

    hey,
    I had a similar experience. I was interfacing between 4.6 (RFC), PI and ECC 6.0 (ABAP Proxy). When data was passed from ECC to 4.6, RFC received them incorrectly. So i had to send trimmed strings from ECC and receive them as strings in RFC (esp for CURR and QUAN fields). Also the receiver communication channel in PI (between PI and  RFC) had to be set as Non unicode. This helped a bit. But still I am getting 2 issues, truncation of values and some additional digits !! But the above changes resolved unwanted characters problem like "<" and "#". You can find a related post in my id. Hope this info helps..

  • RFC_SYS_EXCEPTION when sending IDOC via tRFC from external program to R/3

    Hi all,
    using the RFCSDK 6.40 and writing a program in C which sends IDOC' s using tRFC to SAP.
    When I send my EDI_DC40 and EDI_DD40 tables to R/3 with:
    TCHAR strFktName[] = (_T("IDOC_INBOUND_ASYNCHRONOUS"));
         rfc_rc = ::RfcIndirectCallEx (m_rfc_handle,
                                    strFktName,
                                    exporting,
                                    tables,
                                    rfc_tid);
    --> rfc_rc gets back an RFC_SYS_EXCEPTION
    When I check for
    RfcLastErrorEx(&m_error_info);
    --> I get back:
    Beim Empfangen von Daten für einen Rfc-Call ist ein Fehler aufgetreten
    (in english --> an error occured when reciving data from rfc-call)
    dump check in R/3 tells:
    Fehleranalyse                                                                               
    Beim Ausführen eines Remote Function Calls trat ein Fehler auf.                                                                               
    "RFC_GET4"                                                                               
    Zustand der Verbindung.. " "                                                                  
        Interner Fehlercode..... "RFC_GET4"
    Any idea what goes wrong here?
    Already checked very detailed the data I send to R/3 - but it doesent matter what I send - I get the same error every time.
    Thanks,
    Robert

    Reviving an old thread...
    I'm getting a similar error making RFC calls from a stand-alone program to an ABAP server using JCo:
    RFC_GET4, GET_ID-3c05 LINE 990
    Any ideas?
    Thanks.
    Tim

  • InDesign Settings When Placing Image Screen Cap from SnagIt

    I've already tried obtaining assistance from the SnagIt people, but they feel it's an InDesign setting I'm missing, which is likely since my skill with InDesign is very beginner level.  Thank you kindly for any assistance.
    I produce training materials for software and need to take screen captures that will then be inserted into InDesign. I do the production myself and then give to a printer.
    I cannot, for the life of me, get the images to look half decent in InDesign. I save at 96 dpi, 300 dpi, tif RGB, tif CMYK, PNG etc. and to be honest, the captures look worse once they hit InDesign than if I took a basic windows screen cap.
    The screen caps should be presented at a reasonable, readable size in InDesign as they are for instruction purposes. Professionally printed computer manuals is the quality I'm looking for.
    SPECS:
    CPU: Intel Core 2 Series Processor (2400 MHz) -- THIS IS A QUAD CORE
    Memory: 4095 MB
    OS Version: Microsoft Windows 7 64-bit  (Build 7600) -- ULTIMATE VERSION
    Graphics Card Vendor: NVIDIA Corporation
    Graphics Card: GeForce 8800 GTX/PCI/SSE2 -- 2 SLI'd
    Windows Graphics Driver Version: 8.17.0011.9562
    I know I'm doing something wrong. The saved images look fine on my screen (I use ACDSee to view). But the moment I put them in InDesign, they look horrid (blurry, jaggy).
    If you can't help me, do you know of someone who can?
    I tried on the SnagIt forums, and no helpful responses.
    Thank you kindly.
    Sincerely,
    Alexandria

    You don’t say what’s wrong with the screen captures, but since you list several different resolutions I can guess. You are resampling and Photoshop is trying to produce smooth results, assuming the image is a photograph and that aliased (pixelated) details are undesirable.
    Screen captures look best when they are not resampled. Save them in a lossless format like PNG or TIF and place them unmodified. If you edit them and add any layers or text (Layers panel shows anything but a single Background layer), then save as PSD or Photoshop PDF. Some print shops might either flag those low-res files as problems, or try to “help” you by upsampling them. You can avoid these issues by resampling in Photoshop using Nearest Neighbor interpolation. Use full 100% increments, ie: not from 72 ppi to 300 ppi (416.67%) but 72 to 288 ppi (400%).
    Other tricks to explore are changing the antialiasing method of your display. Sub-pixel antialiasing is often used for LCD displays, but when enlarged and printed (look at the noise around “Font Family”) can be ugly. On a Mac you can turn this off in the Appearance Preference Pane.
    Black can be a nuisance with screen captures. Your screen captures are probably saved in RGB. When they are printed the RGB values are converted to CMYK by the print shop. Normally, this is not something to be concerned with. But Black in RGB (0,0,0) is usually treated as a rich black or photographic black, and is converted to a colour with lots of each CMYK ink in it. For the fine type, dialogues, and lines of a screen grab, that is undesireable.
    I have my own way of dealing with this, and I know others who have similar, but not identical, workflows. All require Photoshop. If you want further help with this, please ask either here or in the Photoshop forum.

  • When opening image in Photoshop from Lightroom "edit it," it defaults to TIF format

    When I open an image in Photoshop CC by using the "edit with" command in Lightroom 5, after editing, the file will default to a TIF image rather than PSD. This ends up creating large, duplicate files (TIF and PSD) after I correct the problem.
    Isn't there a way to ensure Photoshop CC defaults to a PSD regardless of where it's opened.
    I do not use any editing or image-adjusting features in Lightroom. Nothing is changed in a photo until I edit in Photoshop. I open with RAW in photoshop.
    I'm using Windows 8.1 with plenty of memory and disk space.
    Thanks

    Hi EJToll,
    If you like to set the default file format of the file you Edit in Photoshop CC thorugh Lightroom then perform following steps.
    Lanuch Lightroom and go to Edit> Preference(Windows) Lightroom>Peference(Mac)
    Click "External Editing" tab
    Change the option for "File Format" to PSD as deafult format for Edit In Adobe Photoshop CC
    Click "Ok" button
    Hope this helps.
    Regards,
    Sumit Singh

  • Starting managed server's via NodeManager from command line.

    In WLS 70 weblogic.Admin utility has been enhanced to start/stop/kill
    managed servers via NodeManager.
    Here's the syntax
    java weblogic.Admin -url {admin server url} -username {admin user}
    -password {admin password} START {managed server instance name for e.g. S1}
    Pls make sure that the admin server & Nodemanager have started prior to
    executing the above command.
    Similary you can issue "SHUTDOWN S1" command which will shutdown the
    managed server.
    See weblogic.Admin for more info. With this interface you don't need to
    go to admin console to remotely start/stop managed servers.
    Hope it helps
    Kumar

    Solved: attention must be paid to the casing of the attribute name. The first character of the attribute name must be uppercase.
    So the property must be set as following:
    set JAVA_OPTIONS=-Dweblogic.ssl.ServerPrivateKeyPassPhrase=<the_password> %JAVA_OPTIONS%
    Edited by: javawarrior2003 on 24-nov-2011 18.19
    Edited by: javawarrior2003 on 24-nov-2011 18.20

Maybe you are looking for

  • Chroma Key Question

    Does it matter what shade of green is used for the Chroma Key function in FCE? I noticed that B&H, for example, sells a very expensive gallon of Chroma Key green paint. But wouldn't a much cheaper gallon of a similar shade of green from a place like

  • Why has Microsoft RDC 2.1.1 stopped working on OS X 10.8.3?

    Why has Microsoft RDC 2.1.1 stopped working on OS X 10.8.3? This has only stopped working since the recent update from Apple, is this the cause? Thanks

  • Corrupted image files in Lightroom?

    I opened up Lightroom this morning and noticed that some of my files from a recent shoot look like this: Are they corrupted? If so, how does that happen? I've never seen this before and I have thousands of images in LR.

  • Lightroom 4 blue screen

    3 days ago, I installed new released version of lightroom 4 (not beta version). During 3 days, my desktop PC was down with blue screen whenever I use lightroom 4 many time. I Just try import catalog and control temp slide bar in develop. Other slide

  • Get plant from sales org and distribution channel

    Hi expert, how to get default delivery plant from sales organization and distribution channel. thanks, neo