Images and Js files not loading!!

Hi everyone,
I have a login servlet which is working properly now. I have another servlet which checks if the session is valid and then redirects either back to the login servlet if failed or to the new page if successful.
the problem is ..the second servlet generates the html within the servlet...but when i do this i loose all my image files and Js files as they no longer work.
Do they have to be in a special directory or is it just stupid to load the html file directly from the servlet.
at the moment im doing this in my servlet....
out.println("<html>");
out.println("<head>");
out.println("<title>Intern Training Guide Home Page</title>");
out.println("");
out.println("<link rel=\"STYLESHEET\" type=\"text/css\" href=\"ajmenu.css\">");
out.println(" <script language=\"JavaScript1.2\" src=\"ajlib.js\"></script>");
out.println(" <script language=\"JavaScript1.2\" src=\"ajmenu.js\"></script>");
out.println("");
etc...
I'm not sure of a way around this. Please help me out.
Thanks,
Dp

Hi,
Thanks for the reply...
my servlet generating html with the images looks like this....
out.println("<td valign=\"top\" colspan=\"2\"><a href=\"http://www.sun.com\"><img src=\"/images/www.sun.gif\" width=\"217\" height=\"44\" border=\"0\"></a></td>");
out.println("<td valign=\"top\" colspan=\"4\"><a href=\"http://www.sun.com\"><img src=\"/images/dot_com_md_wht.gif\" width=\"160\" height=\"50\" border=\"0\"></a></td>
etc...
and this is how my path looks like:
http://localhost:8080/examples/servlet/WTSTopSecret
I beleive im doing as you said but unfortunately it doesnt work. Any more ideas?
I agree about writting HTML in servlets being cumbersome and using JSP to to make it more maintainable. Unfortunately i don't have JSP experience and this is for my final year project which is in in a month..so i don't have much time to learn unfortuntatly.
Hope u can help further ..
thanks,
Dharmesh

Similar Messages

  • Website image and zip file download links not working in Dreamweaver Air application

    Hi
    I have successfully created and AIR app for an existing business website using the Dreamweaver AIR Extension. The site works very well in all respects except for the part where we have high resolution images and zip files available for download. The download links refuse to do anything, and right-click (PC) / ctl-click (Mac) does nto work either.
    I suspect this may be an AIR sandbox/security issue but am I correct and what can I do to fix it?
    Thanks in advance for any assistance you may be able to give.
    Martin

    I am now facing the same problem. I wrote a servlet .
    code like this
             response = (HttpServletResponse) faces.getExternalContext().getResponse();
             response.setContentType("application/x-download");
             String agent = request.getHeader("USER-AGENT");
             boolean isIE=false;            
            if (null != agent && agent.indexOf("MSIE")!=-1) { 
                isIE=true;
            if (isIE) {
                fileName = URLEncoder.encode(fileName, "UTF-8");
            } else {
                fileName = new String(fileName.getBytes("utf-8"), "ISO-8859-1");
            response.setHeader("Content-Disposition","attachment;filename="+fileName);
            ServletOutputStream os = response.getOutputStream();
            byte b[]=new byte[1024];
            int n;
            while((n=in.read(b))!=-1){
                os.write(b,0,n);
           in.close();
           os.close();
    and i open a new window refer to above jsp ,also i set a breakPoint at os.close(),the program has passed through,but nothing happened in the window.
    If i use IE or FF ,the browser will open a small window to allow me select whether open or  save the file.So can anybody give me some advice.Is it because air using webkit engine and the engine does not do this kind of job?
            Thanks.

  • I have just bought a new Imac and it will not load my copy of FCE 3.5 as it says "PowerPC applications are no longer supported". So how do I get to use the version of FCE I am used to and have paid for ?

    I have just bought a new Imac and it will not load my copy of FCE 3.5 as it says "PowerPC applications are no longer supported". So how do I get to use the version of FCE I am used to and have paid for ?

    I do not have any experience with Final Cut, but if you have existing projects that you MUST access; then you are in need of a solution on your new iMac in Mountain Lion!
    Unfortunately you got caught up in the minor miracle of Rosetta.  Originally licensed by Apple when it migrated from the PowerPC CPU platform that it had used from the mid-1990's until the Intel CPU platform in 2006, Rosetta allowed Mac users to continue to use their library of PPC software transparently in emulation.
    However, Apple's license to continue to use this technology expired with new releases of OS X commencing with Lion (and now Mountain Lion).  While educational efforts have been made over the last 6 years, the fact is that Rosetta was SO successful that many users were caught unaware UNTIL they upgraded to Lion or Mountain Lion.
    Workarounds:
    1.  Purchase a used Mac that will run Snow Leopard (with the optional Rosetta installed) and continue to run FCE on that Mac (you can actually use Screen Sharing with a "headless" used Snow Leopard Mac Mini and use the 27" screen from your iMac to view and work FCE in the Mac Mini environment);
    2.  Upgrade to an Intel compatible version of FCE and hope it converts your existing projects to its newer format correctly.  There is much debate that the newer version of Final Cut are eliminating many needed features; for example Final Cut Pro X vs. Final Cut Pro 6 -- many users are staying with version 6;
    3.  Install Snow Leopard (with Rosetta) into Parallels and then install FCE in the Snow Leopard environment:
                                  [click on image to enlarge]
    Full Snow Leopard installation instructions here:
    http://forums.macrumors.com/showthread.php?t=1365439
    NOTE: STEP ONE of the instructions must currently be completed on a Snow Leopard or Lion Mac and the resulting modified Snow Leopard.cdr install file can then be moved over to your Mountain Lion Mac for completion of the remaining steps.
    NOTE 2:  Computer games with complex, 3D or fast motion graphics make not work well or at all in virtualization.

  • Troubles with xmp files not loading...

    I'm having troubles with xmp files not loading with images but are present in the image folders. does anyone know why this is happening and if there is a way to fix this. Also when trying to load the xmp individually they are grayed out and unable to load. I have tried this on different machines (Macs) and still no luck. Any help would be greatly appreciated in this issue.

    > The information contained in the XMP file is stored in the DNG file so there is no need for a separate file.
    Aww, yuck!! That's a real drag...
    When editing lots of files (yesterday's shoot produced 8GB) I back everything up to off-line storage and then, after doing all my edits and crops in ACR, I only have to copy over the small XMP files which takes no time at all.
    So if I re-edit the DNG with ACR I have to re-copy ALL the files again to the off-line storage.
    I used to sometimes even save 2 versions of the xmp files when I needed 2 different crops of the same images, such as doing a wide screen 'cinema' crop for a corporate client's Intranet presentation of their event, as well as more standard crops to be used for their newsletters.
    Guess I won't be using DNG any more..
    Thanks for the help Kees :-)
    Russell

  • SWF files not loading onto page in Catalyst output.

    Hello,
    This is a new one that I have not yet seen.  I have a large assortment of SWF files set up in Scroll Panes and they are not loading up when I check the project using Firefox or Safari.  The site is here:
    www.electronic-lifestyle.com
    Go into any page linked from the top row and then hit a sub page.  When you see a scroll bar come up on the right side of the film strip yet nothing inside the film strip you will see the issue.
    This is really serious and could screw up my entire project so any advice would be really helpful.  I need to figure out why the SWF files are not loading in on the browser with the files from the server when they work just fine using the local deploy files.  Everything works just fine from the machine but when I try to get it to download from the server nothing.
    All of the SWF files are built in Flash CS5 using AS3 and contain some simple links and commands.  Some of the SWF files are coming up just fine, it is just the latest batch of files I have uploaded that are giving me the problem, but only off the server.  The same files work just fine in local mode.
    Thanks in advance,
    Brett

    Chris,
    This is not an apples to apples comparison but I think it will Illustrate the differences.  This is a sample of code from Catalyst that works:
    <?xml version="1.0" encoding="utf-8"?>
    <s:Group xmlns:s="library://ns.adobe.com/flex/spark" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:fclib="com.adobe.flashcatalyst.components.*" xmlns:d="http://ns.adobe.com/fxg/2008/dt">
        <fx:Script>
            <![CDATA[
                protected function mac_btn_clickHandler():void
                    navigateToURL( new URLRequest( encodeURI("http://www.mcintoshlabs.com")), "_blank");
                protected function integra_btn_clickHandler():void
                    navigateToURL( new URLRequest( encodeURI("http://www.integrahometheaters.com")), "_blank");
            ]]>
        </fx:Script>
        <fclib:SWFController loadForCompatibility="true" source="assets/images/ElectronicMain2c.swf" x="0"/>
        <s:Button skinClass="components.Button1" x="0" y="1328" d:userLabel="Mac_btn" click="mac_btn_clickHandler()"/>
        <s:Button skinClass="components.Button1" label="Button" x="0" y="1768" d:userLabel="Integra_btn" click="integra_btn_clickHandler()"/>
    </s:Group>
    This is an example of the AS3 code that was confounding the SWF load on the example I gave:
    button_1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage);
    function fl_ClickToGoToWebPage(event:MouseEvent):void
        navigateToURL(new URLRequest("http://www.mcintoshlabs.com"), "_blank");
    button_2.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage_2);
    function fl_ClickToGoToWebPage_2(event:MouseEvent):void
        navigateToURL(new URLRequest("http://www.integrahometheater.com/"), "_blank");
    Now these are from the same page, the first of which is online right now here:
    www.electronic-lifestyle.com/AS/Main.html
    This particular code is used on the Electronics page.  When I look at the two side by side it seems there are some syntax differences but I do not know enough about AS3 to tell what the important differences are.
    Thanks for looking,
    Brett

  • Xml file not loading from different server

    Hi,
    I have a simple flash banner that is pulling a number from an xml file on a different server. When it gets to the frame where the number should be it just says "transferring data from eckul.com" and will not actually pull in the number. Unfortunately I can't put the files on the same servers. Any help would be much appreciated, below are the links and the xml code I'm using followed by the action script. Cheers
    http://www.sainters.net/newsletters/2010/flash_test_membership2.html
    http://www.eckul.com/number.xml
    <?xml version="1.0"?>
    <inventors>
        <person>
            <name>892</name>
            </inventors>
    function loadXML(loaded) {
    if (loaded) {
    _root.inventor = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
    _root.comments = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
    name_txt.text = _root.inventor;
    comment_txt.text = _root.comments;
    } else {
      trace("file not loaded!");
    xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
    xmlData.load("http://www.eckul.com/number.xml");

    so, in frame 1 of your fla before you execute that cross-domain load method, use:
    System.security.loadPolicyFile("http:www.yourcrossdomain.com/subdirectoriesIfNeeded/crossd omain2.xml");
    where the following (crossdomain.xml) is in www.yourcrossdomain.com's root (IF you want to allow allow subdirectory policy files):
    <!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
    <cross-domain-policy>
    <site-control permitted-cross-domain-policies="all"/>
    </cross-domain-policy>
    and in the subdirectory (and its descendents) that you want to allow access put crossdomain2.xml:
    <?xml version="1.0"?>
    <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
    <cross-domain-policy>
      <allow-access-from domain="www.thedomainthatstryingtoloadcrossdomaindata.com" />
    </cross-domain-policy>

  • I have iphoto 9.2.1 and it will not load. The loading screen after I click on the app keeps circling. Can anyone help Please?

    I have iphoto 9.2.1 and it will not load. After I click on the app it opens but the screen continousley tries to load. Please Help

    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Rebuild iPhoto Library Database from automatic backup.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. This will create a new library based on data in the albumdata.xml file. Not everything will be brought over - no slideshows, books or calendars, for instance - but it should get all your albums and keywords back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. .
    Regards
    TD

  • SWF Files Not Loading

    I created a master fla and swf files to load into the master
    file externally. Everything loads into the master file just fine
    when I view it in flash or flash player. However I need to add a
    background to it along with a couple other things that I only now
    how to do in dreamweaver. Dreamweaver will load the master flash
    swf but it wont load the external swfs. Please help if you can.
    Thanks.

    I am not sure I completely understand what you are trying to
    do. Can you give us a link to the page in question?

  • Imported Jar file not loaded at run time ORA-105100

    Oracle 9iDS forms Version 9.0.2.9.0
    Oracle 9iAS Release 2
    I have imported java classes from a jar file into my form. I have it working in client server. Added the entries to the classpath in the default.env and system environment variable for development of the form and for execution.
    Moved the jar file, form and testing html to the application server. Modified the classpath in the default.env file. Tested the form. Got the ORA-105100 error. MetaLink note 261650.1 states that error frm-40735 When-Button-Pressed triger raised exception ORA-105100 if calling a java function from a jar file. Cause: Jar file not loaded at run time. Solution: add in your default.env CLASSPATH parameter your jar file including the whole directory of the jar file location. That has been done and the OC4J has been restarted. Still get error.
    Oracle support has not been able to give me much help as of yet. Does anyone have any further ideas, or documentation that I can read to help get this working?
    Thanks in advance for any assistance that is offered.

    Hey people any clues?

  • E5 memory card images and videos are not visible i...

    am using nokia e5,it was working all well but few days before i tranferred files from laptop to my cell(images) using Mass Storage option by data cable.soon after that images and videos saved in memory card is not visible on phone.test mesgs and music files are visible but phone isnt showing my images and video files which ive recievd through bluetooth and saved in memory card.why is this so???plzzz help me am in mess cant help it

    Hi saaraaz,
    Welcome to the forum! I tried to transfer pictures via bluetooth and they were saved to gallery like they should. Please try the following actions and between them test if it works.
    Firstly please make a back up with Nokia Suite. Then type in *#7780# = soft reset, no data lost.
    If it's still the same, type in *#7370# = hard reset, the phone memory will be wiped. Restore back up. You can also try to make the back up without settings and then format and restore.
    Reinstall the software. The process is the same when updating, but at the end select "reinstall". 
    Hope you get the device working again, please let me know if this is not the case.
    Jampe
    If the answer solves your issue, please click the ACCEPT AS SOLUTION button so other users can benefit from it as well. Giving a kudos (the white star) if my answer has helped will be appreciated.

  • Images and titles are not showing up

    I took a screen shot of it, but when I load tumblr and reddit specifically, but there are other pages, smaller images and title do not show up. I tried the trouble shooting, and the reset, and looked at extensions. Nothing worked, I still have the problem.
    When I use tumblr, and click on the number of likes/reshares and it opens the list below the pictures, all I see is small icons instead of showing me the names of who did what.
    On reddit, the top tabs (new, hot, etc) aren't showing up.

    * http://kb.mozillazine.org/Websites_look_wrong
    * http://kb.mozillazine.org/Images_or_animations_do_not_load

  • Images and js files within a deployed war file are generating 404 errors.

    Greetings,
    I have an odd situation in that image files and js files that are part of a deployed war file are generating 404 (not found) errors when accessed via https but ARE found when accessed via http.
    Unfortunately we are required to use https.
    I have verified via jar -tf that the files are indeed part of the war file. So, it is not that they are missing as is evident when accessed via http. (they appear as expected)
    A work around is to create the sub directories under the document root, on the ohs, and populate the sub directories with the images and js files that were used as part of the war file build. While this works, it doesn't explain why they would generate a 404 error when referenced from within the war via https.
    The war file works correctly on our 10g installation.
    I also have a very simple deployed war file and it too seems to have an issue finding direcotries/files that are part of the war file when referenced via https but not http.
    We are using Oracle 11g OHS and using the WLS Admin Console to do the deploying. We also are using the OSSO for the performing the required authentication.
    I have an SR in with oracle and have been working with them but I thought I would post here too.
    Suggestions?
    Thanks in advance.
    Edited by: emmett on Jan 5, 2011 2:47 PM

    Don't crosspost. Continue here: http://forum.java.sun.com/thread.jspa?threadID=5251627

  • Images and audio files in a database

    how does one put images and audio files in oracle 8? What are the data types going to be in the tables for images and audio files..?
    null

    One of the most important reasons that one would choose to store multimedia in the database is to be able to manage this content safely and efficiently. Having multimedia in the database allows you to use database itegrity techniques to keep your data safe and consistent. If you choose to use BFILE storage, you will NOT have these advantages. You will have to back up the database, and the filesystem(s) where the multimedia is stored, and devise a way to keep this data consistent. You will not be able to rely upon the database backup entirely, you would need filesystem backups to be coordinated with database backups.
    I would suggest that you store the multimedia in BLOBs within the database.
    From the LOB application developer's guide:
    * External (BFILE) LOBs do not participate in transactions. Any support for integrity and durability must be provided by the underlying file system as governed by the operating system.

  • How to create table and insert images and audio files ...

    hello to all , i am doing my b.e cse .
    at current v r studing DB and pl/sql codes ....
    i just need to know simple way of code to insert images and audio files in a table .
    i tried some of these ,
    CREATE TABLE myTable(Document varbinary(max))
    INSERT INTO myTable(Document)
    SELECT * FROM
    OPENROWSET(BULK N'C:\Image1.jpg', SINGLE_BLOB)
    but not workiing
    it shows some errors.
    i use oracle 10g. thank u :) and also i tried using blob and bfile datatypes , table created but cannot insert values !
    ROBOK

    hello to all , i am doing my b.e cse .
    at current v r studing DB and pl/sql codes ....
    i just need to know simple way of code to insert images and audio files in a table .
    i tried some of these ,
    CREATE TABLE myTable(Document varbinary(max))
    INSERT INTO myTable(Document)
    SELECT * FROM
    OPENROWSET(BULK N'C:\Image1.jpg', SINGLE_BLOB)
    but not workiing
    it shows some errors.
    i use oracle 10g. thank u :) and also i tried using blob and bfile datatypes , table created but cannot insert values !
    ROBOK

  • Identifying image and video file names in my presentation

    I want to identify the file names of all the images and videos in my Keynote presentation so that I can re-assemble the presentation in Final Cut Pro . . .  I thought that just using Inspector might give me the file names, but it only shows me what the image or video looks like, but not the file names.
    My photo images are not in iPhoto (I don't use iPhoto), they're in various other folders.
    Thank you.

    There are two ways to find file names of media used in Keynote:
    1
    for a few images, select the images on the slide
    Inspector > Builds
    click on more options
    if there are no builds set up, choose an effect
    the file name will display in the build order:
    2
    It is more usefull and easier  to do the following:
    right click the Keynote file and select     Show Package Contents
    all the images and QuickTime files will be listed
    you can make a screen grab to make a note of the file names (in finder -  command shift 4)
    the files can be copied to a folder and imported into other applications for further work

Maybe you are looking for