Accessing html pages outside tomcat server

Hi
I have my images and html pages stored in a directory outside the server. This is because of the WAR file. Other people are developing the html pages and uploading them. The name of the html file is in a mysql table.
With the name I have to show that page.
I have figured out how to display the images that are out side the server on my jsp pages .
how do I do the
<a href="????????<=%fileName%> ">View me</a>
if they are on c:/thedata/pages/stories/fileName.html for example to use the local host place they are.
Lena

The client cannot access local files outside the web container by a simple request. Better way is to create a FileServlet or so which streams the requested file from the local path to the client.
The ImageServlet snippet provided here might be useful to get some insights in streaming local files to the client: http://balusc.xs4all.nl/srv/dev-jep-img.html
Then let the FileServlet listen on /file and change the request to<a href="file?name=<%=fileName%>">View me</a>Be careful with this. Also see the comments in the code and the "Security considerations" at the bottom of the ImageServlet article.

Similar Messages

  • Problem accessing HTML pages using Tomcat 4

    I am very new to programming. I have created an html file (ThreeParamsForm.html) and placed it in development directoy. I am unsure of how to access that file. When i am typing http://localhost/ThreeParamsForm.html it is giving me HTTP Status 404 error. I have tried using servlets in similar way it is working fine. Please help.....

    did you include the port number if other than 80 ?
    i.e. http:\\localhost:8080\whatever

  • .swf file in html page with WebLogic Server in Netscape

    I am not able to embed .swf (flash) files in html page when accessed thru' Weblogic server in Netscape Ver. 5 and below but supported in Netscape6.0 and IE. When run as html page without WebLogic server, it is working well. Please suggest a solution for this problem to my mail id.

    I've had a quick trawl round the web, but can't find an answer to this specific problem - will let you know if i discovr anything.
    Lots of people seem to have problems because the relative url address has to be in relation to the html page, not the loading swf. All my files are in the same folder, so it;s not that. Also, the problem occurs whether running from my hard drive or web server.

  • I'm an admin of this site, but now can't access some pages in Project Server 2013 e.g. Project center, PWA setting

    I'm an admin of this site, but now can't access some pages in Project Server 2013 e.g. Project center, PWA setting

    it may be your browser.  CHeck the folloinwg
    1) Turn on Compatibilty mode
    2) Security Options / Make it a local trusted site
    3) Turn of Protected Mode in the browser under Security
    and have you tried it from Chrome
    CHeers!
    Michael Wharton, MVP, MBA, PMP, MCT, MCTS, MCSD, MCSE+I, MCDBA
    Website http://www.WhartonComputer.com
    Blog http://MyProjectExpert.com contains my field notes and SQL queries

  • Accessing HTML Pages w/out KM

    I need to upload RoboHelp files to the Portal. I’ve tried KM but this isn’t a viable solution since the default RoboHelp page refers to multiple js, html, and gif objects. KM requires that an html page reference objects with a complete URL path even though they all reside in the same directory. RoboHelp has generated 222 + files.
    I don’t recall the location on the Portal server where I can create and upload files to a directory in the Portal. This way each page doesn't require a complete URL path to each object.

    Peter, that was correct. In the Portalapps directory is where all the par files reside. So I created a new directory CRM/help then uploaded the files. The URL path which I use for my iView is http://xxx/irj/portalapps/crm/help/default.htm. Now I can call the default page which it turns calls the logical path for the js, html, or gif object. The complete URL path to each object is no longer required.

  • Access HTML Pages from Forte Applications

    We are currently looking at how to redevelop our online help facility for a
    Forte application. We are investigating the use of HTML pages.
    Has anyone written a Forte application that opens particular HTML pages? If so,
    how was it done?
    Regards,
    Steve Isaac
    Senior Consultant, Information Services Group
    Hydro Electric Corporation of Tasmania
    4 Elizabeth St, Hobart, Australia, 7000
    Phone : +61 03 6230 5161
    e-mail: [email protected]

    We have created the idea of an OnLineAssistant that uses HTML pages to drive
    help in a Wizard-like fashion.
    We use an embedded ActiveX browser control in a Forte window to display the
    HTML pages. The pages are launched by passing the application, window, and
    widget name to the OnLineAssistant window, which uses the information to load
    the correct page.
    For example: an application screen for entering customer name and address
    passes it's information to the on-line assistant, which links and displays the
    page associated with that particular step of a task wizard defined for that
    widget. The ActiveX control then allows the user to link into any of the
    other pages associated through standard HTML.
    This context-sensitive mechanism is also used to launch on-line help (without
    the task orientation) at the user's request.
    One of the benefits of this approach is that we can put the message passing
    into a generic framework ancestor without making any application code changes,
    and the OnLineAssistant HTML pages can then be created by non-programmers and
    deployed independently from the application, and HTML can do most of the
    navigation work.
    -DFR

  • Viewing HTML page saved  on the server from the browser

    Hi all
    In my application i am having some HTML pages saved on the server. I had given an option to the user to view the HTML page from my application. behind the scene what i am doing is that the view request will get handled by a servlet and from that servlet iam locating the HTML page on the server directory and sending the HTML page to browser by using the Servlet OutputStream. The HTML page is shown on the browser but the attached images are not shown. The images are also there in the server directory and are refered in the HTML file correctly. When i directly open the HTML file then the images are shown correctly.
    Can anyone suggest wat's wrong there.
    The code i m using is
    ServletOutputStream out=response.getOutputStream();
                        if(format.equalsIgnoreCase("pdf"))
                             logger.info("Seleted format is pdf..\n");
                             response.setContentType("application/pdf");
                        else
                             logger.info("Seleted format is html..\n");
                             response.setContentType("text/html");
    String file = ReportingConstants.URL_GENERATEDREPORTS+reportPath+itemName;
    // file : HTML file absolute path as string.
                        URL url=new URL(file);                    
                        BufferedInputStream bis=new BufferedInputStream(url.openStream());
                        BufferedOutputStream bos=new BufferedOutputStream(out);
                        byte[] buff = new byte[2048];
                        int bytesRead;
                        while(-1 != (bytesRead = bis.read(buff, 0, buff.length))) {
                             bos.write(buff, 0, bytesRead);
                             bos.flush();
                        }

    You have to undertsand how the browser handles images and other resources in a HTML page. In the HTML there is an image tag that has a url to an image which can be a reletive url or an absolute url (starts with a "/").
    If the url is a relative url the browser interprets the url as being relative to the url currently displayed in the address field discarding the last element of the url . So if the url in the address bar is http://www.myserver.com/myapp/mypage.html and the relative url is images/myimage.jpg, the browser will submit a request to the server for http://www.myserver.com/myapp/images/myimage.jpg
    Now let's say that you are call mypage.html from a servlet that has the url http://www.myserver.com/myapp/servlets/myservlet. Then when the browser tries to retrieve myimage.jpg it will use the url http://www.myserver.com/myapp/servlets/myservlet/images/myimage.jpg and since this is incorrect it will not be able to display the images.
    One solution to this is to change all of the image urls to absolute urls. That is the start with a slash where the slash represents the start of the url after the application domain name. For example you used an absolute url for myimage.jpg it would look like /images.myimage.jpg and when accessing the page through the servlet url (http://www.myserver.com/myapp/servlets/myservlet) the browser will discard everything after http://www.myserver.com/myapp and look for the image at http://www.myserver.com/myapp/images/myimage.jpg which is the correct url.
    A second solution is to use the HTML BASE tag which tells the browser not to interpret the image tag urls (and other resourses) using the current url in the address bar but to use the url supplied in the HTML BASE tag. The browser will still perform the same process for relative urls but now relative to the BASE tag url. Since the BASE tag url will be the same every time the page is accesssed the images should be correctly accessed no matter how the page is accessed (eg directly, using RequestDistpatcher or via your servlet)

  • Placement of objects on html page change when loaded to server

    I'm having an issue with the placement of my header on my "Gallery" page when it is uploaded to the server.  When I open the file in Firefox and Safari it opens normal, with the header on top and the images for each gallery below (I have yet to add links).  However when I access this page through the server in safari it flips the gallery images and header but NOT with Firefox.  As a note, I've played around with the css a bit trying to solve the problem and I could imitate the issue when I removed the absolute position from the div "gallerycontent".
    Here's the link
    http://frozentimephotos.com/english/gallery.html
    Thanks,
    Giuseppe

    Most browser rendering issues are code related.  Validate your code with the tools below and fix reported errors.
    Code Validation Tools
    CSS - http://jigsaw.w3.org/css-validator/
    HTML - http://validator.w3.org/
    HINT:  You have 2 sets of <body> tags in your markup.  In code view, remove this from line 12:
    <body bgcolor="#000">
    And remove this from line 37:
    </body>
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists 
    http://alt-web.com/
    http://twitter.com/altweb

  • Is it possible to serve a few plain old simple static HTML pages with ITS?

    Hi,
    I am looking for a way to serve a few plain old simple static HTML pages (together with some javascript and image files) with ITS?
    The HTML page should be served unaltered.
    Is this possible somehow?
    Thanks,
      Wolfgang

    Hello Wolfgang.
    Yes, that is possible.  What ITS are you using, Integrated or Standalone?
    With Standalone you could just put the static HTML anywhere in the web server directory. 
    With Integrated ITS you will need to upload it to the Integrated ITS and then publish your static HTML.  There is an example of this in the SYSTEM service.  Just go to SE80 > SYSTEM Internet Service > Topic SL > Mime Objects > PAGE > aboutbox.html.
    Edgar

  • Displaying HTML page when server is unavailable

    Hi,
    I would like to display the static html page when the server is down. For example when server maintanance is going on I would like to display html page with information
    Please let me know what is the process to achive this.
    Thanks

    You might also want to check Custom Error pages:
    http://help.sap.com/saphelp_nw70/helpdata/EN/9a/e74d426332bd30e10000000a155106/frameset.htm
    Regards,
    Siddhesh

  • Redirect HTTP 404, 401 errors to custom html pages ?

    Does anyone know how to set up Weblogic 6.1 to TRAP and REDIRECT http 404, 401 etc error messages to custom predefined friendly html pages on the server ?? Here, WL takes http requests directly and outputs the results directly back to the browsers (not going through a proxy server like IPlanet or other web servers).
    So how do I trap HTTP error messages in WL and redirects them to my own custom error pages ??
    Help!

    Hi Aswin,
    Vintela libraries changed in SP3. Usually a 404 error means:
    - Typo in any of the xml tags (you can check opening it in IE)
    - Typo in the SPN (cannot be found). However, you mention seeing in stdout.log "credentials obtained" so it looks that's fine
    - If you are using keytab, comment those lines in web.xml and use the password in Tomcat > Java
    If nothing mentioned above solve the issue, I will suggest you to enable debug in Tomcat and post here the stdout.log
    Regards,
    Julian

  • Syntax for calling html page in PL/SQL package

    Hi,
    I'm trying to call html page (stored on server) in my pl/sql package!
    I have already create html page in pl/sql package code and it's works fine.
    Now create better html page (interface design) and stored on server. I would like to call that stored html page in my pl/sql package.
    What is syntax for calling html page in PL/SQL or could you suggest me some literature.
    In first option I had created ces and stored it on server. Then I call it in pl/sql package like htp.p('<link rel="stylesheet" href="\download\table_style.css" type="text/css">');
    I try someting like that for calling html page but it doesn't works.
    htp.p('<link rel="form" href="\download\interface.htm" type="text/html">');
    Does anyone know syntax for calling html page in pl/sql?!?
    Thanks!

    hello
    I normally use htp.anchor(URL,linkname);
    it works
    ammar sajdi
    www.e-ammar.com/Oracle.htm

  • HTML page within a Flash Movie?

    I have an HTML page on my server that I'd like to be able to
    have inside my Flash movie, is there any way this could work? I
    don't want to use the external Text file method. I've been trying
    to use an iframe over a Flash movie to fake it but I just get all
    kinds of browser problems when I try to do that. I'd just like
    Flash to be able to display an HTML page like an iframe does. Is
    that possible?
    Thanks in advance!

    nope. this exact question gets asked here from time to time
    and the answer is really just that
    simple - no - but flash does support some HTML tags for text
    but HTML as a language is completely
    different animal from flash player.
    Chris Georgenes
    Animator
    http://www.mudbubble.com
    http://www.keyframer.com
    Adobe Community Expert
    *\^^/*
    (OO)
    <---->
    gadillion wrote:
    > I have an HTML page on my server that I'd like to be
    able to have inside my
    > Flash movie, is there any way this could work? I don't
    want to use the
    > external Text file method. I've been trying to use an
    iframe over a Flash
    > movie to fake it but I just get all kinds of browser
    problems when I try to do
    > that. I'd just like Flash to be able to display an HTML
    page like an iframe
    > does. Is that possible?
    >
    > Thanks in advance!
    >

  • How to run jsp in tomcat server

    hi this is satish1529,
    i am new to jsp technology,i have written small jsp file and html file,i don't know where to place jsp and html files in tomcat server and where i have to do setting in the server and how to run jsp file. pls give me step by step describing how to run jsp in tomcat server.
    i am showing u files
    this is jsp file
    <html>
    <body>
    <center> data recieved from client <center>
    <%
    String s= request.getParameter("t1");
    String a= request.getParameter("t2");
    %>
    username :<%=s%><br>
    address :<%=a%>
    </body>
    </html>
    this is html file
    <html>
    <body>
    <form action="http://localhost:8080/form.jsp">
    enter name <input type="text" name="t1"> <br>
    enter address <textarea name="t2"> </textarea> <br>
    <input type="submit" vaule="login">
    </form>
    </body>
    </html>

    Thanx a lot for ur promt reply.
    we r succful in running simple jsp in tomcat6.0.
    bt one more problem occured as following when we r trying to run jsp file in tomcat.
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    exception
    org.apache.jasper.JasperException: /main1.jsp(1,1) The value for the useBean class attribute webCounter is invalid.
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
         org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
         org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
         org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1200)
         org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1155)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
         org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2386)
         org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2392)
         org.apache.jasper.compiler.Node$Root.accept(Node.java:489)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2336)
         org.apache.jasper.compiler.Generator.generate(Generator.java:3374)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:210)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:306)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    note The full stack trace of the root cause is available in the Apache Tomcat/6.0.13 logs.

  • Restarting of tomcat server while using jsp

    hi,
    Iam using a jsp page on tomcat server. It actually sends message to a phone, after that it comes back to the same jsp using the same url.
    But after it comes back, the jsp is not working properly. I have to restart tomcat server each time for it to work.
    As iam redirecting it back to the same jsp , i expect it to work properly as nothing is being changed. Its not practical to restart the server each time.
    Can anyone help me with this?
    Thanks in advance
    san

    Hi,
    Iam getting error at this particular point in the code
    DirContext ctx = new InitialDirContext(env);
    The function contains the following code
    Hashtable env = new Hashtable();
    env.put(Context.INITIAL_CONTEXT_FACTORY,
    "com.sun.jndi.ldap.LdapCtxFactory");
    env.put(Context.PROVIDER_URL,
    "ldap://" + ldapServer + ":" + String.valueOf(ldapPort) + "/" + rootDn);
    env.put(Context.SECURITY_AUTHENTICATION, "simple");
    env.put(Context.SECURITY_PRINCIPAL, ldapUserId);
    env.put(Context.SECURITY_CREDENTIALS, ldapPassword);
    DirContext ctx = new InitialDirContext(env);
    //at this point its gives array out of bound , java.util.vector error
    Attributes matchAttrs = new BasicAttributes(ignoreCase);
    if (matchRules != null) {
    Iterator attrIter = matchRules.keySet().iterator();
    while (attrIter.hasNext()) {
    String key = (String) attrIter.next();
    String value = (String) matchRules.get(key);
    matchAttrs.put(new BasicAttribute(key, value));
    response = ctx.search(searchBase, matchAttrs, returnAttrs);
    lastResult = new Vector();
    while (response.hasMore()) {
    HashMap attrMap = new HashMap();
    SearchResult sr = (SearchResult) response.next();
    Attributes attrs = sr.getAttributes();
    NamingEnumeration attrsEnum = attrs.getAll();
    while (attrsEnum.hasMore()) {
    Vector values = new Vector();
    Attribute attr = (Attribute) attrsEnum.next();
    for (int i = 0; i < attr.size(); i++) {
    values.add(attr.get(i));
    attrMap.put(attr.getID(), values);
    lastResult.add(attrMap);
    First time when i run it runs fine, but the second time , it gives error.

Maybe you are looking for

  • Maximize the chances of getting and prompt response and good suggestions exponentially.

    Hi there Folks First I want to say that all issues cannot be solved by troubleshooting. There are times when the hardware of the device damage been damage or  and then is time to replace the unit. With that being said the majority of the problems tha

  • DVD Player won't read DVD then crashes when trying to load VIDEO_TS folder

    I use DVD player for movies maybe once a week. I insert a DVD. It shows up on the dekstop as it should. Once in a while, if it's a video DVD, DVD player opens and it says, "this type of media is not supported" (or whatever the message is). I can open

  • Imovie Can't Find Music

    Hey Everyone, Been working on a rather long video with about 5 music files added as background. It worked fine all day, I closed it to make dinner, come back after dinner and imovie "*The song "___" could not be used because the original file could n

  • Portege M700 tablet downgrade to xp tablet edition.. Major issues

    None of the USB ports work.. you can plug a item in.. you get the DEE - DUM sound.. but the little icon to add new hardware never pops up and no USB device of any sort will work (mouse, flash drive, external harddrive, camera.. nothing) The Blue Toot

  • Copy Recorded Programs

    Does anyone know if there is a way to copy a DVR recorded program to an external device (USB etc..) ?  I can't get a clear answer from Verizon. This is something that would be nice to do on occasion, like recording to VCR tape.  Some times there is s