Accessing images outside the application

Hello!
I've been developing a web app as a part of my learning of JSP and now have stumbled onto a problem I haven't been able to Google out yet. Maybe I'm missing something, but here goes...
The app I'm developing is in Croatian and I've had a first test run on my server today, here: http://mapper.domagojpolovic.com/noviMapper/
All the graphics you can see are included in the WAR file. The problem is... I'm planning on adding more features in future releases, but all the images and previews are in the WAR file. Which means, when I'm updating the app, I need to replace the WAR on the server with an updated version (is that correct?). For just one alteration in one file I'll have to reupload everything (?). All the images and previews.
Is there a way to just replace the file you've updated like you can do it with PHP?
Thanks in advance! :)
Edited by: 915453 on Feb 18, 2012 3:34 PM

Actually that won't work. You are sending an URL to the client on where to find the image.
You can send any URL you like, but If the client cannot access that URL, then they cannot see the image.
In this case file:// tells it to look on the local machine - which will work on your machine, but on noone elses.
There are good reasons why you are not allowed to access stuff outside of the web app directory via HTTP. Put the image in an accessible place.
Cheers,
evnafets

Similar Messages

  • Problems while accessing images outside the web document-root folder

    Our application runs on Oracle application server on Linux. Facing problems while accessing images outside the web document-root folder. This works with changes in global-web-application.xml by including the <virtual-directory> tag. The same change does not work when done on Linux machine. It is unable to find the image. Please help in resolving this issue.
    </locale-encoding-mapping>
    </locale-encoding-mapping-list>
    </web-app>
    <virtual-directory virtual-path="/img" real-path="/home/eposuat/" />
    </orion-web-app>
    Code in the jsp:
    <img width=700 height=700 src="/img/3.tif"></img>
    <img width=700 height=700 src="/img/WB.gif"></img>

    This is one of the least satisfactory aspects of site management in Dreamweaver, and several developers, including myself, have been pressuring the Dreamweaver team for some years to improve this. Who knows? They might eventually take notice.
    The only way to do this at the moment is to create two site definitions, one nested inside the other. Set up the site definition normally based on htdocs as your site root. Then create a new site definition based on site. Dreamweaver will nag you that it can cause problems, but it won't actually stop you from doing it. The only potential problem is with site synchronization.
    The problem with using site as the only basis for your site definition is that Dreamweaver automatically puts things like the Connections, Scripts, and other folders in the site root. So, everything ends up at the wrong level of the site hierarchy. Quite frankly, the whole thing is a bit of a pain. Dynamic site development was added to Dreamweaver only in version 6 (Dreamweaver MX), and no one had really thought through the need to store files outside the site root.

  • Pages (or Numbers) Template Cannot Be Opened From Outside the Application

    Ever since the upgrade to Mavericks, I cannot open a Pages (or Numbers) template without being asked.....
    Do you want to add this custom template to the Template Chooser?  Then my only options are Cancel or Add to Template Chooser.
    If I cancel, it won't open anything.
    But this template is already in my Template Chooser.
    So the only way to open a template in Pages (or Numbers) is to open the application first, and then click "New", and choose the template.
    I can't figure out a way to open the template from outside the application, which is very very handy, rather than having to open the application every time that I want to access a template.
    How can I open a template simply by clicking on it?

    Yes, the problem is that opening the template from outside of the application will not open the application, showing the document.  I only get this....
    Do you want to add this custom template to the Template Chooser?  Then my only options are Cancel or Add to Template Chooser.
    If I cancel, it won't open anything. 
    But this template is already in my Template Chooser.
    Put your Pages or Numbers document on your desktop and open it by double-clicking it, and you'll understand.  You can't do it, even if the template is in your template chooser.
    The only way to do this now is to open the application, select "New", and the select the template.  So you cannot open a template from outside the application....only from within.

  • Numbers (or Pages) Template Cannot Be Opened From Outside the Application

    Ever since the upgrade to Mavericks, I cannot open a Numbers (or Pages) template without being asked.....
    Do you want to add this custom template to the Template Chooser?  Then my only options are Cancel or Add to Template Chooser.
    If I cancel, it won't open anything.
    But this template is already in my Template Chooser.
    So the only way to open a template in Numbers (or Pages) is to open the application first, and then click "New", and choose the template.
    I can't figure out a way to open the template from outside the application, which is very very handy, rather than having to open the application every time that I want to access a template.
    How can I open a template simply by clicking on it?

    Yes, the problem is that opening the template from outside of the application will not open the application, showing the document.  I only get this....
    Do you want to add this custom template to the Template Chooser?  Then my only options are Cancel or Add to Template Chooser.
    If I cancel, it won't open anything. 
    But this template is already in my Template Chooser.
    Put your Pages or Numbers document on your desktop and open it by double-clicking it, and you'll understand.  You can't do it, even if the template is in your template chooser.
    The only way to do this now is to open the application, select "New", and the select the template.  So you cannot open a template from outside the application....only from within.

  • Access SharePoint outside the network

    Please correct my if I'm wrong or if there are other ways to access SharePoint outside the network with AD authentication
    Option 1 - Internal SharePoint Server. Configure reverse proxy and punch a hole in the firewall to access it outside network
    Option 2- Setup SharePoint server in the DMZ then configure 1 way trust in the Internal Domain Controller
    Option 3 - If both above are not doable setup a UAG in the DMZ 
    Is there another option that I'm missing ? I'm really looking on implementing Option 1 or 2 but some of the network team doesn't want to punch a hole in the firewall or configure a trust (option 2), but without the trust the only way you can authenticate is
    FBA correct?
    Thanks in advance
    AJ MCTS: SP 2010 Configuration MCSA: Windows 7 If you find this post useful kindly please mark it as an answer :) TY

    Hi,
    According to your post, my understanding is that you wanted to access SharePoint outside the network.
    You need to set up a zone with Forms Based Authentication for the people not on the domain
    Here is a similar thread for your reference:
    http://stackoverflow.com/questions/1783884/giving-access-to-sharepoint-site-for-people-outside-organization
    More information:
    Configuring Forms Based Authentication in SharePoint 2010
    Claims Walkthrough: Creating Forms-Based Authentication for Claims-Based SharePoint 2010 Web Applications Using ASP.NET SQL Membership and Role Providers
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • On win 7 64 bit mozilla or IE 10  I get the following message This installation package could net be opened verify that the package exist and that you can access for contact the application vendor to verify this is a valid windows installer package I trie

    I get this following message when installing the latest itunes on mozilla or IE10 was working on this machine before crash and reinstalled for HP disc I tried at leat 15 times firewall off /on microsoft essentials on/off  on windows 7  64 bit  see  message
    This installation package could net be opened verify thatthe package exist and that you can access for contact the application vendor to verify this is a valid windows installer package

    If you are not already doing so, install from an Administrator account.
    If you haven't already done so, download the iTunes Installer from:
    http://www.apple.com/itunes/download/
    Then right click on the installer and select "Run as Administrator." (Even though you are using an admin account).
    If that doesn't work, try creating a new administrator account and installing from there.

  • How to stream flv files from a diffferent directory outside the applications folder

    Hi everyone,
    I want to stream the flv files from a different location
    stored in the hard disk, which is outside the applications folder
    in the FMS installation root directory. Does anyone know how to do
    it?
    Regards,
    Diptanu

    VOD changes won't help him, he said outside the applications
    folder. According to adobe any new vod folders must be in the
    applications folder, hence virtually worthless for most purposes. A
    better question may be, how do you specify a folder on a different
    local hard drive. I wish adobe wouldn't make it so complicated, it
    should be a really simple matter.

  • Upgrade to SBO 2007 : a user was added outside the application....

    Hi
    I just completed the upgrade of a system from 2005 to 2007.
    But when trying to create a new user, i've got this message :
    -> a user was added outside the application. Delete it, or perform "Restore Numbering"
    Do you have any idea on the way to overtake this message ?
    Thanks
    Stéphane

    Hi Stéphane,
    When you have this message, the first thing to do is log a message to SAP support.
    Thanks,
    Gordon

  • I can log into my iCloud account but cannot access any of the applications.

    I am able to log into my iCloud account but i am unable to access any of the applications. I always get the message that reads "there was a problem loading the application"
    I therefore cannot go beyond just signing in

    You need to ask Apple to reset your security questions; ways of contacting them include clicking here and picking a method for your country, phoning AppleCare and asking for the Account Security team, and filling out and submitting this form.
    (97586)

  • Problem in accessing images in the KM from Portal code.

    Hi All,
    I need to develop a portal application that accesses the KM and displays the images that are stored in the KM to the user. There are 8 images which are stored in the /documents/Images directory in the KM. The user should be able to see the next image in the KM by clicking on the 'Next' button of the JSP and the previous image in the KM by clicking on the 'Previous' button of the JSP.
    Below is the code which reads the KM and displays the images. However, the images that are displayed are not in a proper sequence. Also when the user clicks on the 'Next' button and arrives to the last image, although i disable the 'Next' button, when the user clicks on the 'Previous' button the user is not able to see the previous image. Infact the KM tries to display the next image which is not present and hence throws an IndexOutOfBoundsException. This happens vice versa for the 'Previous' button as well.
    Any help would be highly appreciated and rewarded.
    JSP Dynpage
    package com.ltitl.image;
    import com.ltitl.bean.ImageBean;
    import com.sap.security.api.IUser;
    import com.sapportals.htmlb.event.Event;
    import com.sapportals.htmlb.page.DynPage;
    import com.sapportals.htmlb.page.PageException;
    import com.sapportals.portal.htmlb.page.JSPDynPage;
    import com.sapportals.portal.htmlb.page.PageProcessorComponent;
    import com.sapportals.portal.prt.component.IPortalComponentProfile;
    import com.sapportals.portal.prt.component.IPortalComponentRequest;
    import com.sapportals.portal.prt.component.IPortalComponentSession;
    import com.sapportals.portal.security.usermanagement.UserManagementException;
    import com.sapportals.wcm.repository.ICollection;
    import com.sapportals.wcm.repository.IResource;
    import com.sapportals.wcm.repository.IResourceContext;
    import com.sapportals.wcm.repository.IResourceList;
    import com.sapportals.wcm.repository.ResourceContext;
    import com.sapportals.wcm.repository.ResourceException;
    import com.sapportals.wcm.repository.ResourceFactory;
    import com.sapportals.wcm.util.uri.RID;
    import com.sapportals.wcm.util.usermanagement.WPUMFactory;
    public class ImageControl extends PageProcessorComponent {
      public DynPage getPage(){
        return new ImageControlDynPage();
      public static class ImageControlDynPage extends JSPDynPage{
        public static ImageBean imageBean = null;
        public static IResource resource = null;
        public static IResourceContext resourceContext = null;
        public static IPortalComponentSession componentSession = null;
        public static IPortalComponentRequest request = null;
        public static IPortalComponentProfile profile = null;
        public static IUser user1 = null;
        public static RID rid = null;
        public static int count = 0;
        public static int total = 0;
        public static IResourceList children = null;
        public void doInitialization() throws PageException{
          request = (IPortalComponentRequest)this.getRequest();     
          componentSession = request.getComponentSession();
          profile = request.getComponentContext().getProfile();
          user1 = request.getUser();
          imageBean = new ImageBean();
           try
                   com.sapportals.portal.security.usermanagement.IUser user =  WPUMFactory.getUserFactory().getEP5User(user1);
         resourceContext = new ResourceContext(user);
         String imagepath = profile.getProperty("PathToFolder");     
         rid = RID.getRID(imagepath);
         resource = ResourceFactory.getInstance().getResource(rid,resourceContext);
         if(resource != null)
                 if(resource.isCollection())
                          ICollection collection = (ICollection)resource;
                          total = collection.getChildrenCount(true,false,false);
                          imageBean.setTotal(total);
                          children = collection.getChildren();
                          accessResource();
                     else
                          imageBean.setMsg_txt("resource " + resource.getName() + " is not a collection");
                else
                     imageBean.setMsg_txt("resource " + resource.getRID() + " does not exist");
              componentSession.putValue("imageBean",imageBean);
           } catch (UserManagementException ume) {
                imageBean.setMsg_txt("exception:" + ume.getLocalizedMessage());     
           catch(ResourceException ue) {
                imageBean.setMsg_txt("exception:" + ue.getLocalizedMessage());     
        public void doProcessAfterInput() throws PageException {
              IPortalComponentSession session = ((IPortalComponentRequest)this.getRequest()).getComponentSession();
              imageBean = (ImageBean)session.getValue("imageBean");
              if(null != imageBean) {
                   accessResource();
              else
                   imageBean.setMsg_txt("Image Bean null");
        public void doProcessBeforeOutput() throws PageException {
          this.setJspName("ImageOutput.jsp");
        public void onPrevious(Event event) throws PageException {
             --count;
         public void onNext(Event event) throws PageException {
              ++count;
    public void accessResource() throws PageException {
    try {
    if(count >= 0 && count < total)
    IResource resImg = children.get(count);
    imageBean.setCount(count);
    imageBean.setMsg_txt("count: " + count);
    imageBean.setInitialPath("/irj/go/km/docs");
    imageBean.setImageName("" + resImg.getRID());
    else
    imageBean.setMsg_txt("out of bounds count:" + count);
    } catch (ResourceException e) {
         imageBean.setMsg_txt("resource exception:" + e.getLocalizedMessage());

    ImageBean
    package com.ltitl.bean;
    import java.io.Serializable;
    public class ImageBean implements Serializable {
         public String imageName;
         public String msg_txt;
         public String initialPath;
         public int count;
         public int total;
          * @return
         public String getImageName() {
              return this.imageName;
          * @param string
         public void setImageName(String string) {
              imageName = string;
          * @return
         public String getMsg_txt() {
              return this.msg_txt;
          * @param string
         public void setMsg_txt(String string) {
              msg_txt = string;
          * @return
         public String getInitialPath() {
              return initialPath;
          * @param string
         public void setInitialPath(String string) {
              initialPath = string;
          * @return
         public int getCount() {
              return count;
          * @return
         public int getTotal() {
              return total;
          * @param i
         public void setCount(int i) {
              count = i;
          * @param i
         public void setTotal(int i) {
              total = i;
    Hope this helps.

  • Access images outside of tomcat

    Hi,
    Is it possible to have a servlet access image files from a cd or external hard drive? I keep most photos within the webapp but due to size limitations some of the photos need to be moved to external media. I wan't to be able to read and report from either a DVD or an external hard drive but I'm not sure if it is possible for tomcat to read files outside of the tomcat directories.
    Thanks

    I have a servlet called ReportController and it outputs HTML.
    response.setContentType("text/html");          
    PrintWriter out = response.getWriter();
    on my desktop i setup tomcat and i just had to do the following to display an image:
    out.println("<img src="c:/photos/"+photo_name+" height="+height+" width="+width+">");
    now that i added tomcat to my laptop and set everything up the same the images don't show up. Is there a security issue I am missing? Or something else?
    Thanks

  • Save the image in the application server directly

    Hi,
          I have developed a report which displays piechart as the output and saves the image on the presentation server. For that i have used the following code.
       when 'SAVE'.
    DATA : D TYPE GFW_EXP_DATA,
    R TYPE SYMSGNO.
    DATA: S TYPE STRING,
    N TYPE I.
    CALL METHOD GP_INST->IF_GRAPHIC_PROXY~EXPORT
    EXPORTING
    FORMAT =
    IF_GRAPHIC_PROXY=>co_format_bmp
    WIDTH = 50
    HEIGHT = 200
    name = 'C:\Documents and Settings.........'
    IMPORTING
    CONTENT_TYPE = S
    CONTENT_LENGTH = N
    CONTENT = D
    RETVAL = R
    I have a requirement where i have to save the output of the screen(piechart)  in the application server directly with out using the presentaion server.
    Is there any method to do so.
    Thanks and regards,
    Parvatha Reddy

    Hi parvatha ,
    your question is really good.
    Well i really haven't come across your scenario i many years . But my suggestion is to  can use java code to achieve the same .
    Or try to use hexadecimal type in your normal class to read the pie-chart and use transfer with same type .

  • Best practice?-store images outside the WAR file?

    I have an EAR project with several thousand images that are constantly changing. I do not want to store the images in the WAR project since it will take an extremely long time to redeploy with every image change. What is the best practice for storing images? Is it proper to put them in the WAR and re-deploy? Or is there a better solution?

    Perryier wrote:
    Can you expand on this? Where do they get deployed and in what format? How do I point to them on a jsp?
    I am using Sun Application server 9.0, and I don't really think this has a "stand alone" web server. How will this impact it?You could install any web server you want (Apache?). The request comes in and if the request matches something like .jpg or .gif or whatever, you serve up the file. If you have a request for a jsp or what not, you forward the request to the app server (Sun App Server in your case). i.e. your web server acts as a content-aware proxy.

  • Unable to access url outside the machine

    Hi All,
    when i m trying to runing my web Object project (WO 5.4) the URL bing generated is :-
    http://127.0.0.1:4002/cgi-bin/WebObjects/Test.woa
    The web Object is not generating the URL consisting of System IP (Eg 192.168.3.103)
    Due to which I am unable to aceess the application through other machines.
    When I run the this application on WO 5.2 it generates URL:-
    http://192.168.3.103:4002/cgi-bin/WebObjects/Test.woa
    Please tell me the way how i can get this type of URL,So that I can access my application thorough other machine.
    I m running my application through eclipse,details are mentioned below:
    Eclipse Version: Juno Service Release 1
    java version: 1.6.0_18
    WebObject Version = 5.4.3
    Thanks!!!
    Regards
    Mritunjay

    Hi
    The error you typed is not enough. Can you please give us more information about error in log. (wls and application log)

  • Accessing files outside the root of the site.

    Hi All
    On my web host space I have access to a directory outside the
    root of the
    website i.e. "private"
    I want to store files there for download after users have
    purchased them.
    I want to put them here to stop people ripping the files off
    by guessing the
    link or useing a website copier.
    What I plan to do is send a link to the user via email, this
    link will then
    go to a download page which records the user has accessed the
    file and then
    have the page automatically download the file.
    I can do this no problem if I have the files in a directory
    under the root
    of the site but how can I link to the files outside the root?
    TIA
    Bren
    Why do I climb mountains? Simple! because they are there
    www.3peakschallenge.co.uk

    Sorry forgot to mention I am using ASP VB
    Cheers
    Bren
    "Bren" <[email protected]> wrote in message
    news:ejgd9n$427$[email protected]..
    > Hi All
    >
    > On my web host space I have access to a directory
    outside the root of the
    > website i.e. "private"
    > I want to store files there for download after users
    have purchased them.
    > I want to put them here to stop people ripping the files
    off by guessing
    > the link or useing a website copier.
    > What I plan to do is send a link to the user via email,
    this link will
    > then go to a download page which records the user has
    accessed the file
    > and then have the page automatically download the file.
    > I can do this no problem if I have the files in a
    directory under the root
    > of the site but how can I link to the files outside the
    root?
    >
    > TIA
    > Bren
    > --
    > Why do I climb mountains? Simple! because they are there
    > www.3peakschallenge.co.uk
    >

Maybe you are looking for

  • Would like to separate my Itunes account from rest of the family

    I have one apple iTunes account for my family(myself with two daughters). This has become quite a mess as I am now receiving all of their updates, and I'm not able to backup my iphone anymore. What I would like to do is to separate my account complet

  • How do i use itunes through an external hard drive?

    i have about 10G left on my laptop's harddrive. i've been told placing itunes on an external harddrive would free up space. i put everything on the harddrive, did the whole advanced stuff by changing the location, etc. etc. but ater all that there's

  • JSP & Java Script problem.

    Hi, A oldPage.jsp page contains select list box with options coming from oracle database, after selecting any one option (eg as 3rd option) a next button is pressed which leads to newPage.jsp with same select box. The problem is as follows When the n

  • Multi Value PS Query Works in v2, but not v3 or 4

    I have been using the query below (and others like it) for a few years, but it didn't work on v3, and now it doesn't work on v4--which is supposed to be backwards compatible. Get-ADUser test01 –properties memberof, DisplayName, employeeID | Select-Ob

  • Possible Corruption in Logic Preferences?

    Hey guys This is my first question on this forum. There may be more to come. I've been reading through these pages for the last couple weeks and have found it extremely helpful. Great work to all the contributors. The problem I have encountered with