Servlet for plain HTML files? (i.e. not JSPs)

Hello,
I have a webapp that includes plain-old HTML files (in a WAR) and a servlet that executes and then dispatches the request to a plain-old HTML file.
When this runs I get this error:
500 Internal Server Error
Cannot get request dispatcher for path foo/bar.html
I am not sure what the problem is, but I think it may be that this is an HTML file (as opposed to a JSP file), and my OC4J instance is not configured to handle HTML files.
So, my question is: How do I configure OC4J to handle plain HTML files?
In config/global-web-application.xml I see several servlets, one for JSPs, one for CGI, for SSI, for Perl, for PHP.... but how do I handle just HTML?
Thanks,
Otis

Hello Steve,
I think this exception may explain what I'm seeing:
java.lang.ClassNotFoundException: introduction.videos._tasks__welcome
     at oracle.jsp.runtimev2.JspClassLoader.loadClass(JspClassLoader.java:758)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
     at oracle.jsp.runtimev2.JspPageInfo.getInstFacade(JspPageInfo.java:167)
     at oracle.jsp.runtimev2.JspPageInfo.compileAndLoad(JspPageInfo.java:451)
     at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:542)
     at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:304)
     at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
     at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
So, it looks like OC4J is using a JspServlet and JspClassLoader to try to load:
_introduction._videos._tasks__welcome.class
However, that "_tasks__welcome" is not a Java class - it is a regular .html file that lives in my WAR file as:
tpri/introduction/videos/tasks_welcome.html
So it looks like I have to tell OC4J not to try to load .html files as JSPs and treat them as plain HTML files that they are. Is there a way to do this with OC4J? (9.0.4.0.0)
Thanks,
Otis

Similar Messages

  • Servlet for downloading a file

    i am writing a servlet for downloading a file on a GET action in the form..the web-xml is deployed correctly as far as i can interpret..bt i am encountering an error during the run time..
    HTTP Status 500 -
    type Exception report
    message
    description The server encountered an internal error () that prevented it from fulfilling this request.
    here is the log file..
    Jul 11, 2008 12:07:14 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet DwnFile threw exception
    java.lang.NullPointerException
         at com.example.web.dwnfile.doGet(dwnfile.java:17)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    it has some more content bt it is just the exceptions thrwn...
    and here is my *.java file*
    package com.example.web;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    public class dwnfile extends HttpServlet
    public void doGet(HttpServletRequest request,HttpServletResponse response) throws IOException,ServletException
    response.setContentType("/image/jpeg");
    ServletContext ctx=getServletContext();
    InputStream is=ctx.getResourceAsStream("/2004.jpeg");
    int read=0;
    byte[] bytes=new byte[1024];
    OutputStream os=response.getOutputStream();
    while ((read=is.read(bytes))!=-1)
    {os.write(bytes,0,read);
    os.flush();
    os.close();
    the bold line is whre the exception is pointing..i think..
    thanks in advance..
    Edited by: Sun_Rockz on Jul 10, 2008 7:13 PM

    response.setContentType("/image/jpeg");
    ServletContext ctx=getServletContext();
    InputStream is=ctx.getResourceAsStream("/2004.jpeg");there was an error in this part of code..the image extension of .jpeg is not allowed it seems..on changing it to jpg worked..and
    in the first line the contenttype mst not be preceded by a forward slash..
    now one more doubt relating to the same servlet..
    response.setContentType("application/x-zip");
    ServletContext ctx=getServletContext();
    InputStream is=ctx.getResourceAsStream("/servlet_spec.zip");
    if i keep this in my servlet the required action is taking place..i.e.i am gettin a download option bt the problem is tht the file is getting downloaded as a download.do file.....
    download.do is the url pattern tht i am using in my html web page..
    i tried replacing different types of allplications and files bt all are downloaded wit the same name. i.e. download.do
    so what do u think is reason behind this..
    thanks for all the replies.
    Edited by: Sun_Rockz on Jul 11, 2008 10:47 AM
    Edited by: Sun_Rockz on Jul 11, 2008 10:51 AM

  • Using Firefox 3.6.20 and Windows XP Home SP3. Firefox sporatically deletes bookmarks from the bookmarks toolbar. Additionally, when I try to import from a saved HTML file, Firefox does not import the complete file. Results are inconsistent.

    Using Firefox 3.6.20 and Windows XP Home SP3. Firefox sporatically deletes bookmarks from the bookmarks toolbar. Additionally, when I try to import from a saved HTML file, Firefox does not import the complete file. Results are inconsistent.

    A possible cause is a problem with the file places.sqlite that stores the bookmarks and the history.
    *http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox

  • "recover database until cancel" asks for archive log file that do not exist

    Hello,
    Oracle Release : Oracle 10.2.0.2.0
    Last week we performed, a restore and then an Oracle recovery using the recover database until cancel command. (we didn't use backup control files) .It worked fine and we able to restart the SAP instances. However, I still have questions about Oracle behaviour using this command.
    First we restored, an online backup.
    We tried to restart the database, but got ORA-01113,ORA-01110 errors :
    sr3usr.data1 needed media recovery.
    Then we performed the recovery :
    According Oracel documentation, "recover database until cancel recovery" proceeds by prompting you with the suggested filenames of archived redo log files.
    The probleme is it  prompts for archive log file that do not exist.
    As you can see below, it asked for SMAarch1_10420_610186861.dbf that has never been created. Therefore, I cancelled manually the recovery, and restarted the database. We never got the message "media recovery complete"
    ORA-279 signalled during: ALTER DATABASE RECOVER    LOGFILE '/oracle/SMA/oraarch/SMAarch1_10417_61018686
    Fri Sep  7 14:09:45 2007
    ALTER DATABASE RECOVER    LOGFILE '/oracle/SMA/oraarch/SMAarch1_10418_610186861.dbf'
    Fri Sep  7 14:09:45 2007
    Media Recovery Log /oracle/SMA/oraarch/SMAarch1_10418_610186861.dbf
    ORA-279 signalled during: ALTER DATABASE RECOVER    LOGFILE '/oracle/SMA/oraarch/SMAarch1_10418_61018686
    Fri Sep  7 14:10:03 2007
    ALTER DATABASE RECOVER    LOGFILE '/oracle/SMA/oraarch/SMAarch1_10419_610186861.dbf'
    Fri Sep  7 14:10:03 2007
    Media Recovery Log /oracle/SMA/oraarch/SMAarch1_10419_610186861.dbf
    ORA-279 signalled during: ALTER DATABASE RECOVER    LOGFILE '/oracle/SMA/oraarch/SMAarch1_10419_61018686
    Fri Sep  7 14:10:13 2007
    ALTER DATABASE RECOVER    LOGFILE '/oracle/SMA/oraarch/SMAarch1_10420_610186861.dbf'
    Fri Sep  7 14:10:13 2007
    Media Recovery Log /oracle/SMA/oraarch/SMAarch1_10420_610186861.dbf
    Errors with log /oracle/SMA/oraarch/SMAarch1_10420_610186861.dbf
    ORA-308 signalled during: ALTER DATABASE RECOVER    LOGFILE '/oracle/SMA/oraarch/SMAarch1_10420_61018686
    Fri Sep  7 14:15:19 2007
    ALTER DATABASE RECOVER CANCEL
    Fri Sep  7 14:15:20 2007
    ORA-1013 signalled during: ALTER DATABASE RECOVER CANCEL ...
    Fri Sep  7 14:15:40 2007
    Shutting down instance: further logons disabled
    When restaring the database we could see that, a recovery of online redo log has been performed automatically, is it the normal behaviour of a recovery using "recover database until cancel"  command ?
    Started redo application at
    Thread 1: logseq 10416, block 482
    Fri Sep  7 14:24:55 2007
    Recovery of Online Redo Log: Thread 1 Group 4 Seq 10416 Reading mem 0
      Mem# 0 errs 0: /oracle/SMA/origlogB/log_g14m1.dbf
      Mem# 1 errs 0: /oracle/SMA/mirrlogB/log_g14m2.dbf
    Fri Sep  7 14:24:55 2007
    Completed redo application
    Fri Sep  7 14:24:55 2007
    Completed crash recovery at
    Thread 1: logseq 10416, block 525, scn 105140074
    0 data blocks read, 0 data blocks written, 43 redo blocks read
    Thank you very much for your help.
    Frod.

    Hi,
    Let me answer your query.
    =======================
    Your question: While performing the recovery, is it possible to locate which online redolog is needed, and then to apply the changes in these logs
    1.   When you have current controlfile and need complete data (no data loss),
          then do not go for until cancel recovery.
    2.   Oracle will apply all the redologs (including current redolog) while recovery
         process is    on.
    3.  During the recovery you need to have all the redologs which are listed in the    view    V$RECOVERY_LOG and all the unarchived and current redolog. By querying  V$RECOVERY_LOG  you    can find out about the redologs required.
    4. If the required sequence is not there in the archive destination, and if recovery process    asks for that sequence you can query V$LOG to see whether requested sequence is part of the    online redologs. If yes you can mention the path of the online redolog to complete the recovery.
    Hope this information helps.
    Regards,
    Madhukar

  • Cookie preference not remembered for local html files

    I use Firefox's very useful "ask every time" cookie screening facility and have selected "Use my choice for all cookies from this site". However, it will not remeber my preference for local files.
    The Adobe Acrobat Editor's help uses html files on my PC's local C: drive. Whenever this is launched Firefox always displays a "Confirm setting cookie" message "The site file:// wants to modify an existing cookie." 16 times before the html is fully displayed and at least once every time I select a link within the html.
    Firefox's address bar displays:
    "file:///C:/Program Files/Common Files/Adobe/Help/en_US/Acrobat Pro/9.0/help.html"
    How can I avoid this annoying, time-consuming behaviour with local files whilst still screening cookies for internet sites?

    I've tried variations of the theme of "http://localhost/" like:
    "http://localhost/C:/Program Files/Common Files/Adobe/Help/en_US/Acrobat Pro/9.0/help.html" in the Firefox address, desktop shortcuts and cookies exceptions. These all result in errors.
    What browser address should I use instead of:
    "file:///C:/Program Files/Common Files/Adobe/Help/en_US/Acrobat Pro/9.0/help.html"?

  • Firefox will not automatically convert local pdf URL to include file:// like it does for local html files

    I have some local PDFs sorted by navigating some local html files. Firefox recognizes that the html files need to be addressed file:///C:/SD_Online/datasc.html. When clicking the link for a PDF it remains c:/SD_Online/L-R4-106.pdf and I get an error saying "Firefox doesn't know how to open this address, because one of the following protocols (c) isn't associated with any program or is not allowed in this context."

    Press the '''Alt''' or '''F10''' key to bring up the tool bar.
    Followed by; '''File > Open File.'''

  • I want to put my old bookmarks onto my new computer. I tried the tutorial but it is looking for an html file not the jnos

    ''Duplicate post, continue here - [/questions/768056]''
    I made a backup file. I sent it to myself from another computer as an email. I can download it but can't open it when I chose import bookmarks. It's looking for a html format.

    What format did you back the bookmarks to?
    If it was a JSON file, use the restore process in the [[Backing up and restoring bookmarks]] article. If it was an HTML file follow the procedure in the [[Importing Bookmarks from an HTML File]] article.

  • Can RequestDispatcher.forward() forward to a plain html file

    Hi,
              I'm using the 4.5.1 eval weblogic server to service my jsps and servlets.
              I'm using IIS 4.0 to serve the web pages. I've set up IIS4.0 to send all
              *.jsp, *.jhtml, and *.servlet files to weblogic. I'm trying to forward the
              request from a servlet to an plain old html file. The html file is located
              in c:\inetpub\wwwroot. I have my weblogic.httpd.documentRoot set to
              c:\inetpub\wwwroot. I can't find a way to make this work. I've tried
              various combinations include
              equestDispatcher.forward( "/register2.html",req,resp) ....
              forward( "/file/register2.html",req, resp ) ... Any suggestions? BTW
              everything works fine if register2.html is renamed to register2.jsp and kept
              in the same directory.
              Thanks,
              John
              

    Sorry (and thankyou very much for your response).... but, I'm not confident that I understand fully what you mean....
    Since, what I want to do is write the output generated from my servlet to a specific frame in the frameset.
    How does
    "<a href="http://myDomain.com/servlet/MyServlet" target="frameName">My Servlet</a>"
    help me to do that?
    -- Are you assuming that I am invoking the servlet from somewhere in the frameset to begin with?
    Thanks again for your input!

  • When I try to attach my css style sheet Dreamweaver gives me an error saying that my .css file appears to be an .html file and will not attach. How do I fix this so I can attach my style sheet?

    I have built a css style sheet in Dreamweaver. When I try to attach it to my html website, it prompts me that my "css file appears to be an .html file and cannot attach". I've tried removing the /* */ as suggested by other forums, but this has not resolved the issue. I was using css style sheets with no problem 2 days ago. Now I get that error message. How do I fix this so I can attach my style sheet?

    What does the code of the CSS file look like?
    An external CSS file needs to be written in CSS only (no html tags like <html>, <body>, <head>, etc ).
    It also must have a .css file extension, if yours has a .html extension it won't work.

  • Retrieving URL for local html file in jar

    I can't seem to load an html file from my jar file. I did
    public URL howtouse=this.getClass().getClassLoader().getResource("howtouse.html");and then added a hyperlinklistener to a editorpane that contained:
    "<a href='"+howtouse+"'>how to use</a>";which opens in the default browser on click:
    if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
                     BareBonesBrowserLaunch.openURL(e.getDescription().trim());
               }it works, but not in an exec jar file. How can I make it work? thanks!

    Is the jar on the classpath? If not, the file can't be found.

  • StageWebView for Local HTML file

    I simply cannot get this to work.  I see a lot of people offering advice on the web for how to implement it, I've been trying all day and it doesn't work with Adobe AIR 2.5 for Android Flash CS5 plug-in.
    Instead of linking to an external website:
         webView.loadURL(http://www.google.com);
    I want to use StageWebView (because of the nice scroll capability) to load a local html file.  I have tried EVERYTHING, and it doesn't work.
    I have included the file in the APK (tried as a subdirectory and eventually, to simplify testing, I just included it in the same directory so no complex path).
    I have tried what others had recommended:
        webView.loadURL("test.html");
    I have tried using the filesystem and resolving the path:
        import flash.filesystem.File; 
        var file:File = File.applicationDirectory.resolvePath("test.html") ;
        webView.loadURL(file.nativePath) ;
    I have tried numerous change-ups on the filesystem approach, including:
        var file:File = new File("app:/test.html");
    and
        webView.loadURL(file.url);
    NONE OF THESE THINGS WORK.  Can anyone help me?  I'd like to have scrollable content, included inside the Android app - like a license html file or others.
    If none of this will work, any suggestions on creating simple, scrollable content that looks nice (scroll pane, scroll list, anything?)

    Hi Joe,
    can you show code snippet for the 1st solution? With loadString you can't load anything else into that page (i..e stylesheet)
    Edit: soon after I've posted this question I have found a solution:)
    var resultsPageUrl:String = File.applicationDirectory.resolvePath("output-html/result_html_pattern.html").nativePath;
    //and later
    webView.loadURL(resultsPageUrl);
    Edit2: above was just enough to have it working in adl still no joy
    Here is an example of temporary file being loaded, this works, http://forums.adobe.com/message/3443946
    var source:File = File.applicationDirectory.resolvePath("output-html");//copy entire folder (with css)
    var destination:File = File.applicationStorageDirectory;
    source.copyTo(destination, true);//copy to the application storage
    //get path to the html page within copied folder
    var resultsPageUrl:String = "file://" + destination.resolvePath("result_html_pattern.html").nativePath;
    best regards

  • Do I need seperate folders for each html file

    I would prefer to keep all of my html files in the same
    folder.
    Is there a way to get the css files etc in a seperate folder,
    or do I have to have each html file and its related
    css files etc, in their own folders?

    There is no structural requirement for your site files other
    than the one
    you impose. Put them anywhere you want within your site....
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Travistee" <[email protected]> wrote in
    message
    news:e4f90t$472$[email protected]..
    >I would prefer to keep all of my html files in the same
    folder.
    >
    > Is there a way to get the css files etc in a seperate
    folder, or do I have
    > to
    > have each html file and its related
    > css files etc, in their own folders?
    >

  • I-text for saving html files using java

    hi,
    i'm writng a small application and it has some report generation part based on some html templates.
    These templates have some images which are given the relative path in the html template files.
    when i generate my reports they generated and save in some other location and the thing is quite naturally all the image files are missing. can anyone help me to overcome this problem??
    thanks in advance.

    If you are using Windows take a look at what Internet explorer does when you save a web page
    If the files is save as MyFile.htm the browser will create a folder called MyFile_Files and store all the images there. and it will modify the code of the html file to refer those images.
    I think that you will have to do the same.
    Or
    Find some API which can convert HTML page in to PDF and save PDF then you will get a one file with everything in it. I think that is a better solution.
    But the way If you found such an API dont foget to post here about it . I have the same problem and I dont like the solution one

  • Can HTML files be parsed as JSP

    I currently have my web-app configured to process html files as JSP. Is it possible to configure NitroX so that it will parse .html files as JSP?
    I thought changing the Editor in the Preferences: Workbench->"File Associations" might work, but it didn't.

    Thanks, that solution works great. It would be terrific if options such as that were configurable within the NitroX Preferences.
    Another great preference setting would be a way to change the specified webroot. (I figured out how to do it manually.) The reason I had to do this was due to complications in getting JSTL support in the NitroX JSP editor for my existing webapp.
    I use JSP 1.2 and Resin 2.x for my production server. Since JSTL is automatically provided within the container, I do not have the JSTL tld's within my WEB-INF subdirectories. In order to get the JSTL support in the NitroX JSP Editor, (without having to edit my ant build script, directory/file structure, etc), I had to create a new project, choose JSTL support, and then manually edit the .m7project file to specifiy my existing webroot folder, and then restart NitroX (or close and reopen the project). One great enhancement that would be nice, would be the ability to specify the webroot directory while creating a new Web Application.
    A solution to my dilemma, and for many other people I imagine, would be to provide JSTL support inherently by allowing the developer to set a flag for the project (during and after creation). When setting that flag, the developer could then be given the option of copying the files as well. Then JSTL could be available via the corresponding standard taglib uri, such as the uri http://java.sun.com/jstl/core for the core JSTL taglib.
    I am still in the trial period of NitroX. I almost gave up after spending 3-4 hours trying to get JSTL and EL to work. Things finally look promising and I can't wait to see how NitroX for JSF pans out. If some of these issues are taken care of, I imagine our company will buy a couple of licenses.
    Thanks,
    Jeffrey Lilly
    HomeGauge

  • How do i specify the filename for a binary file generated by a JSP?

    I am writing a report generator that has the ability to generate Excel files. The user clicks on a link (exporter.jsp), the page's content-type has been set to "application/vnd.ms-excel" which naturally prompts the user to either save to a file or open directly in Excel.
    It works fine, but requires the user to manually rename the generated file from "exporter.jsp" to "whatever.xls". Furthermore, Firefox will not let you rename the file in save dialog box, it just automatically saves the file as "exporter.jsp", you must rename it from the file browser.
    How do specify the output file name from within JSP?
    Btw, right clicking and selecting "save link as" allows for specifying the file name, but the file that is created is empty.
    Thanks

    You need to set the content-disposition header as well as the content-type.
    here is one article on the subject
    res.setContentType("application/vnd.ms-excel");
    res.setHeader("Content-Disposition", "attachment; filename=" + filename);

Maybe you are looking for

  • Sync RFC call from XI

    Hi I've a requirement for a XI Inbound Order that I need to check for each MATNR on the Order Line it's associated Division (SPART).  Once I know the Division I'll then split up the Order per Division. Can I from my BPM collect the message, call a RF

  • Swipe left and right with magic mouse doesn't work in safari

    Hey there, I accidently deleted something in the navigation bar in safari. Now when i swipe left and right with my magic mouse, it doesn't go to the previous pages anymore. But the wierd thing is it still works with my magic trackpad. And even wierde

  • Modify title of drill down tabs

    Hi All,    Just a quick questions regarding the titles embedded in the drill down tabs. Is it possible to modify the titles? As an example, if I drill down to a level that is grouped by month, I would like the drill down tab to display "Month". Thank

  • Apple ID disable, how to enable?

    Pop up on ipad apple store when I try to download apps saying my apple id was diable. How to I enable it?

  • Is there a keyboard shortcut to nudge play head position?

    I think I'm going crazy here... but in the old Garageband, you could nudge the playhead position forward or back a bar at a time by tapping the left and right arrows on the keyboard... Now in the latest Garageband I can't find any way to affect the p