Jsp:include of html file not working

          Hi
          I wrote:
          <jsp:include page="include.html" />
          <% pageContext.include("include.html"); %>
          in my jsp, but there is no output and no error message.
          What could be the problem?
          If I include include.jsp it works.
          Does jsp:include only work with jsp, not with html???
          I am wondering whether our servlet registrations could be responsible. We have:
          weblogic.httpd.defaultServlet=*.jsp
          weblogic.httpd.register.*.jsp=weblogic.servlet.JSPServlet
          weblogic.httpd.register.*.htm=weblogic.servlet.FileServlet
          weblogic.httpd.register.*.html=weblogic.servlet.FileServlet
          so that the default servlet is the JSPServlet, not the ServletServlet. We don't
          want to use the ServletServlet because it can deliver source code.
          What we want to do is a dynamic including of a file, like so:
          <% String s = ...; %>
          <jsp:include page="<%= s %>" />
          Thanks for any help.
          Alex
          

          By changing the weblogic servlets that are registered, I can get it to work. The
          combination that works is:
          weblogic.httpd.defaultServlet=file
          weblogic.httpd.register.*.jsp=weblogic.servlet.JSPServlet
          weblogic.httpd.register.file=weblogic.servlet.FileServlet
          I am surprised that it doesn't work if *.html is mapped explicitly to the FileServlet
          (which would leave the defaultServlet unused). Why is that?
          And why can't I map defaultServlet to "weblogic.servlet.FileServlet" directly,
          without the intervening virtual name "file"?
          What are the security implications of having FileServlet as the default servlet?
          Thanks
          Alex
          

Similar Messages

  • Jsp:include static svg does not work

    I am running tomcat4- and I have a jsp file that outputs svg content like so:
    <?xml version="1.0" encoding="US-ASCII"?>
    <%@ page contentType="image/svg+xml"%>
    This works fine- the problem is that up until now I have included other svg widgets like this:
    <g id="radio_off" >
                   <%@ include file="../graphics/radioButton.svg" %>
              </g>
    which also works just fine. Now, I have to change this to pass in a dynamic directory containing the image (there will be various directories with same file name- I determine at runtime which directory to use)- so I have to use a jsp:include instead.
    When I do this:
    <g id="radio_off" >
    <jsp:include page="graphics/radioButton.svg" flush="true"/>
              </g>
    When it is run I just get:
    g id="radio_off" >
              </g>
    Just blank inside the <g> . If I change radioButton.svg to radioButton.jsp and say:
    g id="radio_off" >
    <jsp:include page="graphics/radioButton.jsp" flush="true"/>
              </g>
    Then I get what I expect with
    g id="radio_off" >
    <svg width="15" height="15">
    ....and so on
              </g>
    I thought jsp:include would include the static content of a file (like html or svg), but apparently only the OUTPUT of that file.....
    Is this correct- I cannot get my svg content to be included in the svg by using jsp:include or am I missing something?
    I think it will be strange that I have to rename all my svg files jsp to get them included...Anu ideas???
    Thanks,
    Jim

    Michael,
    You are right- I reread your post more closely and saw that you are suggesting to basically just map all my static files (like the .svg) into .jsp extensions- which is basically what I was asking was true- that for svg, xml, htm, any static content to be included as in the <%@include directive but using the action <jsp:include it needs to either be changed to the extension .jsp or, as you suggested, mapped in the web.xml to .jsp. I have remapped my svg to .jsp so as to preserve their .svg extensions- (of course now the first user is hit by about 20 jsp:init's on that page!!- but is then cached as in all jsp's).
    I guess kinda makes since since the include action gets the actual response from the page (which is blank image)- but as jsp it is the actual code....Well needed confirmation- and that's what I got along with the reminder to use the mapping in web.xml.
    So thanks alot- even put extra duke in for you !!
    Jim

  • Jsp:include an html file in a subdir

    I have the following directory structure and files
    $CONTEXT/articles.jsp
    $CONTEXT/articles/article1.html
    $CONTEXT/articles/images/image01.gif
    When I browse to
    http://$SERVER/$CONTEXT/articles/article1.html
    the article and its image display fine. The file article1.html references the image via an href to "images/image01.gif".
    However, when I try to access the article from articles.jsp via a <jsp:include page="articles/article1.html" flush="true"/>, the article1.html can't find its image. Obviously this is a problem with the relative path to the image.
    I want to be able to correctly view article1.html from directly browsing it and from including it from articles.jsp. How can I include the article1.html from articles.jsp and somehow allow article1.html to find its images? Is this possible?
    Best regards and thanks,
    John

    I have just tried what you say doesn't work, but I have no problem getting it to work. You may want to check your syntax.
    My directory structure is as follows
    SERVERNAME/CONTENT/jspinclude.jsp
    SERVERNAME/CONTENT/inc/inc.html
    SERVERNAME/CONTENT/inc/images/myimage.gif
    my jsp file looks like this:
    <HTML>
    <HEAD>
    <TITLE>Untitled Document</TITLE>
    <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </HEAD>
    <BODY bgcolor="#FFFFFF" text="#000000">
    This is a test of a jsp.include
    <jsp:include page="inc/inc.html" flush="true" />
    </BODY>
    </HTML>
    my html file looks like this
    <HTML>
    <HEAD>
    <TITLE>Untitled Document</TITLE>
    <META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </HEAD>
    <BODY bgcolor="#FFFFFF" text="#000000">
    <P>This is some sample text</P>
    <P><IMG src="images/myimage.gif"> </P>
    </BODY>
    </HTML>
    This seems to work fine. Perhaps the problem exists somewhere else.
    Rob

  • HTML file not working ..!

    Okay so i`ve created a website on flash mx , converted it into html .. uploaded on domain on member.webs.com.. here is the link of file nawazbaig.webs.com/website2.html .. it shows up the blank page . ? it is running perfectly fine on my computer.. but on domain it is not working.. here is the code of html
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>website2</title>
    </head>
    <body bgcolor="#ffffff">
    <!--url's used in the movie-->
    <!--text used in the movie-->
    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="100%" height="100%" id="website2" align="middle">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="movie" value="website2.swf" />
    <param name="quality" value="high" />
    <param name="bgcolor" value="#ffffff" />
    <PARAM NAME="SCALE" VALUE="exactfit">
    <embed src="website2.swf" quality="high" bgcolor="#ffffff" width="100%" height="100%" name="website2" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash"SCALE="exactfit" pluginspage="http://www.macromedia.com/go/getflashplayer" />
    </object>
    </body>
    </html>
    "  I would really appreciate your comment on this problem..!

    relaxatraja may be right, it could just be your path which is wrong.....
    But you are already using a "relative" path... so that can stay the same... it just might be the wrong one.
    From an old article on pathing:
    Pathing issues
    Almost always when it works on the local machine and not the server, it's a pathing problem.
    You can put your Flash related files in whatever folders you want, they do NOT have to be in the root, they do NOT all have to be in the same folder. But if you have a problem and if sticking them all in the root folder works, then you know that the issue was a pathing problem.
    Just remember that paths used in the .swf become relative to the Web page on which the .swf is placed, NOT it’s physical location.  So for example, if your .swf is in the flash/data folder and you use that .swf on a Web page in the root folder, you are in effect, removing that .swf from flash/data and putting it in root. So if the .swf is loading any related files (xml, images, video, etc), the path used inside the .swf to load the .xml file has to be relative to it's new location in root and then back down into flash/data. This is true even though when testing the .swf by itself, it can be inside flash/data and work just fine, since relative to it's location, the path is just fine, they are in the same folder. But if that same path is used when the .swf is placed on a page two folder levels up, the relative path has changed, the old "same folder" path will not work.
    In fact if you are placing the .swf on a web page in a different folder than the .swf is stored in, and that .swf calls external assets, then direct clicking and opening of the .swf in it’s folder should NOT work! That’s because the paths to the external assets should be relative to the Web page and not the physical location of the .swf.
    So just be sure that you use addresses relative to the final Web page locations (not physical file locations) and you can put the Flash related files in what ever folders you want.
    Best wishes,
    Eye for Video
    www.cidigitalmedia.com
    Best wishes,
    Adninjastrator

  • In IE7 CLSID In HTML File Not Working With 1.4 and 1.5 Plugins Installed

    Thanks in advance.
    I'm using JRE 1.4.2_03 with a CLSID attribute in my HTML file. It works fine with Internet Explorer 6. If I install a newer version of the JRE (i.e. 1.5.0) IE6 still uses the 1.4.2_03 plugin.
    But, when we install Internet Explorer 7, IE ignores the CLSID in the HTML file and starts the 1.5.0 plugin.
    Has anyone encountered this problem? If so, then how do I solve it?
    Thanks.

    Yes, I solved it by using this classid in the <OBJECT> tag in my HTML file:
    classid = "clsid:CAFEEFAC-0014-0002-FFFF-ABCDEFFEDCBA"
    The "FFFF" in the middle tells the IE browser to use the highest build of the major version of the JRE that you specifiy in the clsid. In the case of my example, above, the browser selects the highest build of JRE 1.4.2. But, the catch is that you have to install JRE 1.5.0 (I think it's 1.5.0_07) or later. Just install 1.5.0_11 and it will work. This may seem strange, but, for some reason, Sun didn't implment the fix in 1.4.

  • Locally stored html files not working in default b...

    I use html files transferred from my computer till my Nokia 5800. But after I upgraded to the latest firmware 21-something, the links between the pages don't work anymore. All the links are relative and refer to pages and pictures stored in the same folder. It worked before the upgrade. 
    Any ideas to what the problem might be? 
    The link look like this in the source:
    <a href="_2NameIndex.html">Name</a><br> 

    These files, which display the html snippet in the webpage, are missing :
    http://www.mackenzieproductions.com/Scripts/Widgets/HTMLRegion/Paste.js
    http://www.mackenzieproductions.com/Scripts/Widgets/HTMLRegion/Paste.css
    And this is the widget :
    http://www.mackenzieproductions.com/Mackenzie_Films_files/widget0_markup.html

  • Destinations from an HTML file not working with Acrobat XI

    When the link is executed in Acrobat X it opens to the correct destination. When opened with Acrobat XI it doesn't. In fact, when I open the PDF (created with Acrobat Pro X) with Acrobat Pro XI I don't see any destinations... I don't see where to view them if they do exist. I already tried disabling the protected settings in XI and that didn't work. What happens is a dialog for downloading the PDF opens and your only choice is opening the PDF to the first page (instead of the destination). This is also happening on all browsers... so I am suspecting something buried in the Control Panel. Please help.

    Thank you but this doesn't help... I know where the destination pane is... that's how I created them... Acrobat XI is not showing the destinations but the issue is Acrobat XI opening a download dialog instead of following the destination. I think it's an application or Windows issue but I don't see it...

  • Cookies in local HTML files not working

    I'm developing a widget and using Safari as a testing place for development. It is working well, however, I've noticed a problem with cookies.
    I'm temporarily using cookies to set preferences until I move to the widget world where I have a separate place to store preferences. The problem is, this isn't working.
    Cookies don't appear to work for files that are stored locally. I run the same exact page in Firefox and it works fine, but whenever I try to read a set cookie from safari it comes back as null. Also ... there are no errors in the Safari javascript console.
    Is this a limitation of Safari? If so, how do you program preferences for widgets since Apple has clearly stated to use Safari to test widgets when in development?
    This is with the latest versions of Safari (2.0.2) and Firefox (1.5).

    Nah, no use posting code, I'm pretty sure it is just a limitation of the browser, for whatever reason.
    I didn't have that much persistant stuff, so I just moved to the dashboard for development and that worked out okay.
    Here's my final product, if you're interested:
    http://www.apple.com/downloads/dashboard/games/widgzee.html

  • How to include a html file in jsp

    hi all
    I have a question about including a html in jsp.
    here's the sample of my jsp file:
    <%
    String filename = "helloworld.html";
    %>
    <%@ include file="helloworld.html" %>
    how will you go about doing it so that the included file depends on the variable "filename"? I've tried doing the following but I got an error:
    <%@ include file=filename %>
    Thank you very much :)

    try this:-
    <%
    String filename = "helloworld.html";
    %>
    <jsp:include page='<%= filename %>' />
    This should work.

  • Include an HTML file that needs parameters??

    I have a JSP that includes an HTML file template.
    Lets say I don't know all the contents of the HTML at the time. How do I add it?
    Simple Example:
    myHTML.html
    <HTML>
    <HEAD>
      <TITLE>myVariablePassedFromJSP</TITLE>
    </HEAD>
    <BODY></BODY>
    <HTML>myJSP.jsp
      String title = "My Title To Display";
      <%@ include file="myHTML.html" %>
      etc...and the result should be
    <HTML>
    <HEAD>
      <TITLE>My Title To Display</TITLE>
    </HEAD>
    <BODY></BODY>
    <HTML>

    If the included file can be a JSP instead of a plain HTML file you can use the <jsp:include> tag with parameters. The parameters will become request parameters in the included JSP. You can use them anywhere in the JSP.
    e.g.
    *** 1.jsp ***
    <jsp:include page="2.jsp" flush="true">
    <jsp:param name="title" value="the window title" />
    <jsp:param name="someBody" value="something for the body" />
    </jsp:include>
    *** 2.jsp ***
    <HTML>
    <HEAD>
    <title><%= request.getParameter("title") %></title>
    </HEAD>
    <BODY>
    <%= request.getParameter("someBody") %>
    </BODY>
    </HTML>
    Be careful with includes because you can end up with multiple conflicting tags. For example, if 1.jsp has <html>, <head>, and <body> tags, and 2.jsp does, too, then you may run into a problem.

  • Home button in HTML Help Not Working

    My Home button in HTML Help Not Working.
    Also the Home option from the Options menu does not work. I receive the "This program cannot display the webpage" error.
    I have the correct file name (titlepg.htm) in the Advanced Windows Ptoperties "Default" field and the "Home" field. However, I still receive the "This program cannot display the webpage" error.
    How can I correct this situation? Thanks, your help is appreciated!

    Can you post a couple of screen captures please?
    One where you show the Project Explorer with the desired topic in view. Another where you show the dialog where you specify the Home page destination.
    Another thing you may wish to try is to define a totally new window, assign the values there and ensure you point to the window in the Single Source Layout recipe.
    Oh, and one other thing. Are you using RoboHelp HTML or RoboHelp for Word?
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7, 8 or 9 within the day!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • Including static html file (WebServer)  with JSP (App server)?

    Hi,
    I want to know how can a static html file that runs on a Web Server (iPlanet) in a JSP that runs on an App Server (WebLogic 6.1).
    What would be the tag used and how the html file is referenced? Is there any other extra settings involved while integrating iPlanet with WebLogic 6.1?
    Responses are highly appreciated.
    Thanks and Regards,
    Madanlal.

    Web servers usually work with the MIME Types. In the mime type settings will determine how a request for a particular mime type is served. Usually HTML, JPG,GIF... are served by the web server itself. A JSP request will be forwarded to the APP Server for peocessing.
    The HTML and the image files need to be in a directory visible to the web server from the document root.
    See the files
    config\mime.types
    config\obj.conf
    under the web server installation directory.
    Refer to the web server's admin guide for more info.

  • Little video player (1 playback component, 3 buttons linked to 3 .flv files) not working in the published html! Why?

    Hey everyone out there that is smarter than me. I have made this little prototype video player, and it isn't working. It'll eventually become a nice little player show videos from our summer camp for the last few years, but first I want to make it work in a basic stripped down version.
    There is a playback component with one of the skins right above the three buttons.
    Here's the ActionScript:
    btn1.addEventListener(MouseEvent.CLICK, vid1);
    btn2.addEventListener(MouseEvent.CLICK, vid2);
    btn3.addEventListener(MouseEvent.CLICK, vid3);
    function vid1(e:Event):void{
    vidPlayer.source = "Video1.flv"
    function vid2(e:Event):void{
    vidPlayer.source = "Video2.flv"
    function vid3(e:Event):void{
    vidPlayer.source = "Video3.flv"
    It runs fine when I test in in flash and even the .swf file runs fine alone, but when I put it in a .html file  via Dreamweaver and in the published .html it doesn't run. What up?

    Oh yeah, all the files are in the same directory.

  • WebLogic 9.0 - HTC files not working when specified as a part of cascading

    Same problem as described in:
    http://support.bea.com/application?namespace=askbea&origin=ask_bea_answer.jsp&event=link.view_answer_page_clfydoc&answerpage=solution&page=wls/S-10511.htm
    but resolution does not work for me.
    I have created a mimemappings.properties file in BEA directory BEA\user_projects\domains\myDomain\config\mimemappings.properties with following content:
    htm=text/html
    gif=image/gif
    jpg=image/jpeg
    htc=text/plain
    png=image/png
    CSS file:
    .calendarClass {behavior:url(calendar.htc)}
    Web.xml:
    <mime-mapping>
    <extension>htc</extension>
    <mime-type>text/plain</mime-type>
    </mime-mapping>
    I also tried htc=text/x-component.
    Stop / Start of server, Redeploy of War, this does not work.
    Any idea ?

    Thanks Ben!
    That helped. I also was using that
    from the examples, and it did not play well in the HTMLPanel.
    I appreciate the quick assistance, as I am pretty new to Spry. I have been creating version 2 of my website code, and one of the conversions has beenfrom JQuery to Spry for almost everything. Spry is a lot easier to conceptualize, except I completely missed the setting you gave me.
    One of my problems is lack of knowledge on how to see what is happening, or not ahppening with javascript on a page.  I have firebug, and that seems to give me some info.  But when I tried to look at stuff with scripts running on the HTMLPanel, I was unable to see anything.
    Thanks again,
    Jamie

  • JSP include from jar file

    I have a service that is packaged in a jar file that contains a jsp file that I want to use inside a <jsp:include>
    in my webapplication. Is this possible?
    <jsp: include .. jspFileInJarInWEB-INFLIB.jsp/>

    The JSP fragment page in question is actually a HTML form page. It is a form to be used specifically by a particular servlet. That is why they are "bundled" together in the same project, in the same package structure.
    I have multiple web applications that I want to include that form/servlet, so it gets added to these projects in the /WEB-INF/lib folder as a JAR library. But I don't want to recreate the form over and over again for each application. It would be nice if I could write a JSP page that wraps the fragment using an include directive to bring that fragment into the new page.
    So to do that with any other fragment I would write:
    <%@ include file="/WEB-INF/jsp/SOME_FORM.jsp" %>
    which works great if my fragment page is in the /WEB-INF/jsp subfolder. But if I want to access the JSP fragment as it is bundled in a JAR file, this:
    <%@ include file="/WEB-INF/lib/FORM.jar/SOME_FORM.jsp" %>
    doesn't work so good. It's just all wrong.
    I was wondering how I could just write one include statement to get what I need. There are work-arounds galore, but I thought if I could get this working it would be the simplest solution overall.

Maybe you are looking for

  • Printing Problem with Epson R320 (Print CD)

    Problem: I cannot print using Print CD with a new Epson Stylus Photo R320, however I can print from applications using the gimp beta driver provided in OS software, via <Print Using> dialogue box. Power Mac G4 dual 450, running 10.4.6. After phoning

  • Messages arrive with body not visible

    I am starting to see a number of mail messages arriving in my Inbox which I cannot read because the content is not visible. The message size in the Message viewer suggests that there is content (15kB, for example) but no amount of manipulation -- e.g

  • Network drive keeps droping

    Hello everyone, It's been a while (few months) since I've gone back to using my MAC a lot more than once a week. Now I'm using it almost every day. Recently, I've tried to connect to another PC's hard drive as a network drive. No problems in connecti

  • How do i take out background noise?

    Hi I need help, I am editing a audio of a lecture where in the background a little baby is crying and also a phone is ringing... at one point there is an automated msg from the tele conference pops up while the speaer is speaking.... all of these hap

  • Smart playlist keeps copying to ipod although it's not selected

    I've tried changing the name. I've made sure it's not selected to copy to the ipod. But a particular "smart playlist" that I've created keeps copying over to my ipod touch. Any idea what I can do to stop it, aside from totally deleting the playlist?