Include directive not working in eclipse

Hello All,
I am using eclipse dynamic web project. I have the main project by the name of JSPEXAMPLE and then i have intro.jsp under web-inf folder for JSPEXAMPLE. i am trying to include a Header.html file. where do i need to save this html file ? i mean in which folder? JSPEXAMPLE? or WEB-INF? i tried to save the sttaic html file in Web-INF and while running my jsp file it gives me an error.
intro.jsp
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page session="false" %>
<%@ page import="java.util.Calendar" %>
<%@ include file="/Header.html" %>
<%
     out.println("The time is now " + Calendar.getInstance().getTime());
%>
<%@ include file="Footer.html" %>Here is the Header.html and Footer.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>WellCome</title>
</head>
<body>Footer.html
</body>
</html>While runing i get an error that file Header.html is not found but why? i mean i can see it under JSPEXAMPLES/WEB-INF folder
org.apache.jasper.JasperException: /intro.jsp(5,0) File "/Header.html" not found
Can anyone help? Thanks
Message was edited by:
lrngjava

I don't know the rules, but in our app we use paths
that start with "/WEB-INF" for our includes. ie:
<%@ include
file='/WEB-INF/a/b/c/partialpage.jspf' %>Presumably it looks for files starting from the base
directory, not the current directory of your jsp.
Message was edited by:
hunter9000thanks for the reply hunter. i tried /WEB-INF/Header.html still gives me error while running on tomcat. i have been searching on google for a while now no success.

Similar Messages

  • JSP include directive not working with Tomcat 5.0

    Hi.
    I'm developing a small JSF webapp under Tomcat 5.0. My idea was to use the include directive to display a navigation panel on every JSP page.
    I took the code straight from the Java Web Services Tutorial; the resulting page looks like this:
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:h="http://java.sun.com/jsf/html"
           version="2.0">
    <jsp:directive.page contentType="text/html;charset=iso-8859-1"/>
    <%@ include file="/jsp/panelpage_header.inc" %>
         <h:outputText value="Welcome!"/>
    <%@ include file="/jsp/panelpage_footer.inc" %>
    </jsp:root>However, when I try to load the page, a compilation error occurrs:
    org.apache.jasper.JasperException: /trias/welcome2.jsp(11,2) The content of elements must consist of well-formed character data or markup.
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
    ...I checked the path to the included files, and it seems to be okay. The files themselves contain the JSF tags for the view, html-head, html-body etc. The compiler doesn't even care if the files exist or not because it aborts immediately when it reaches the first include-statement.
    Did anyone see this kind of error before?

    Ok, the solution with jsp:directive.include works,
    if header.inc and footer.inc themselves are well
    formed too. If I understood the concept right this is
    because header and footer are processed during
    request time and therefore interpreted as
    'standalone' pages.This isn't true. The include directive (<jsp:directive.include>) is run a Compile Time. The code is inserted directly into the surrounding JSP (unlike <jsp:include> which forwards the request at runtime). The finished JSP, after the include, is then processed and needs to be well-formed XML.
    >
    But: What can I do when these two files define a tag
    that should enclose my current page (for example,
    header opens a panelGrid-Tag, and footer closes it).
    For this case I thought the use of the
    @include-directive would be neccessary to combine the
    three pages during compilation. By this the resulting
    page would be well-formed although header and footer
    are not.It should be, as long as you are using <jsp:directive.include>, and the rest of the included pages are also well formed (no <% %> tags, nothing else out of place...).
    Honestly, I haven't done much work with JSP documents, so I haven't run into this problem. But I do believe everything I said is correct.
    What I would do is double check the correctness of the rest of the included pages and see if your error isn't something else.

  • Auto-Deployment is not working in Eclipse - Weblogic

    I have created weblogic server instance in Eclipse.Then, I have added one project into weblogic server by using "Add/Remove Projects" menu.After I start the server , I logged into admin console and checked the deployments link. I am not finding the project listed in the list.I have selected option "Run stand alone web module directly from work space" in web logic server configuration window in eclipse.
    I am using Eclipse 3.3 and weblogic 10.0.
    I have no idea, why auto-deployment is not working.
    I would appreciate your help on this regard.I have contacted Eclipse Support, they have asked me to contact BEA team.
    Thanks,
    Prakash.A

    Hi Prakash,
    The "Run standalone web module from workspace" doesn't publish the application to the server (instead the app is deployed to a temp location).
    This is mainly to help test the app during the development stages. If your app is complete and would like to publish to the server then you might want to try the following option
    - In Server View, double click on the configuration to launch Overview
    - Select "Copy stand-alone web module into separate deployment folder"
    - Save the configuration
    - Start the server
    The application would be deployed to the server as a WAR file.

  • System.out not working on eclipse

    Greetings...
    I am no longer a newbie on Java, but I have been facing an issue lately that I have been unable to resolve myself, even though it seems to be something so silly.
    I have been using eclipse for development, and by developing a simple "Just to practice" code I have found myself unable to use System class or any of its methods at a certain point. See the code below:
    package one;
    import java.util.Scanner;
    public ClassOne {
    public static void main (String args[]){
    Scanner reader = new Scanner(System.in); /*Works just fine here*/
    int x = 0;
    System.out.println("Type in the number of objects expected"); /*Does not work at all, like if System was something I could not use at all. Not an identifier */
    Scanner readertwo = new Scanner(System.in); /*System does not work here either*/
    }Even if I rewrite the code after that, by erasing the import statement and all other System references in the code, System does not work again.
    If anybody has ever faced the same issue and knows what I am doing wrong and what I can do to fix it, I'd really be grateful.
    Thanks to all, and happy 2009.
    Santana T

    Santana_Thiago wrote:
    It works on NetBeans.
    On eclipse I get the following error:
    ERROR: JDWP Unable to get JNI 1.2 Environment, jvm->GetEnv() return code = -2+
    *JDWP exit error AGENT_ERROR_NO_JNI_ENV(183): [../../../src/share/back/util.c:820]*+
    The funniest thing is that if copy and paste the code from somewhere else into eclipse it works. What a drag!!!!
    Thank you.
    Santana TNever seen that error but it sounds to me that your Eclipse installation is screwed up!

  • Maps Directions not working after upgrading to iOS 5

    So I upgraded to iOS5 and now two things happened:
    It now uses the Chinese version of Google, instead of the international English that I had before. So now I can only see the Chinese street names in Shanghai, instead of both Chinese and English names before.
    The directions do NOT work now!! I tried emailing directions from the site maps.google.com, and they do show up on iPhone Maps. I can even calculate different type of directions (car, walking, public transit) on iPhone of the emailed directions. It just doesn't work with directions created on the iPhone itself.
    I hope somebody can help me with these two problems.
    Thanks!!

    BACK TO ENGLISH AND CHINESE LIKE BEFORE!!!
    YES APPLE OR/AND GOOGLE FIXED IT.
    now works with and without the VPN.
    THANKS!!!!!!

  • Dynamic src in ui:include ajax not working

    Hello,
    I'm migrating my application to JSF 2. We are using Richfaces 4 implementation.
    We have a need, that a menu item, triggers an Ajax function, that sets a page name (xhtml), and then re renders the output panel, that has an ui:include.
    The page is loaded fine, but any ajax in the page loaded does not work. I've read several post saying that this happens because ui:include is not a component, but a Tag handler, and that it's life cycle is different from a component. But I haven't found any solution for this yet !
    Any idea on what I need to do ?
    Thanks a lot !
    John.

    I'm 99.9% sure that the only answer is: don't use Ajax in this particular case. Its a menu, menus are used for navigation, let JSF do its regular navigation magic. But since you use Richfaces perhaps a Richfaces specific component can help you out. Such as the Richfaces dropDownMenu I spot in the showcase. If you're already using a richfaces component and you need help with it, try the actual Richfaces forum.
    https://community.jboss.org/en/richfaces?view=discussions

  • jsp:include is not working on weblogic

    I have a problem I write the following code
    html>
    <head>
    <script LANGUAGE="javascript" SRC="js/tab.js"></script>
    <LINK href="stylesheets/global.css" type=text/css rel=stylesheet>
    <title>JobSpinner Status</title>
    </head>
    <body class="bodymargin" onload="setpage(1)">
    <jsp:include flush="true" page="JobSpinnerTab.jsp"></jsp:include>
    <form id="loginForm" action="/jobspinner/JobStatus.faces" method="post">
    <input type="hidden" name="loginForm" value="loginForm" />
    <nobr>
    It is working fine on four to five PC we have checked .
    But the problem is that it is not working on a particular weblogic Server 8.1 SP2 .
    Can someone help me .
    Regs
    Amit Verma

    Are other JSP tags working on the page?
    eg
    Server info = <%= application.getServerInfo() %> <br>
    Servlet engine version = <%=  application.getMajorVersion() %>.<%= application.getMinorVersion() %><br>
    Java version = <%= System.getProperty("java.vm.version") %><br>
    Java home = <%= System.getProperty("java.home") %><br>Your page might be being interpreted as HTML rather than passed through the JSP engine.

  • IOS 6 Map Direction Not Working

    Hi this is Karthikeyan from India, I am using apple iphone 3GS, I have updated os from ios5 to ios6, the problem is io6 map is not working like previous version ios5... The main problems is in ios6 map Route Directions completely not working... anyone help to resolve this..??

    First, I would suggest looking at: http://support.apple.com/kb/HT5429.
    In ios 6, apple removed google maps as the default and provided their own mapping service. Maps is not available in all areas and there are ways to report problems inside the application.

  • Content assist not working in eclipse(Java Content Repository Perspective)

    Hi all,
    I done setup for java Content Repository Perspective in Eclipse Indigo
    followed by
    http://www.day.com/eclipse.html.
    After completion of setup, I am unable to get content assist for Day CQ API (even java api assist also not working).
    Can any suggest me, how can achieve this.
    Thanks
    Ravindra

    Hi all,
    I done setup for java Content Repository Perspective in Eclipse Indigo
    followed by
    http://www.day.com/eclipse.html.
    After completion of setup, I am unable to get content assist for Day CQ API (even java api assist also not working).
    Can any suggest me, how can achieve this.
    Thanks
    Ravindra

  • I absolutely CANNOT figure out how to add playlists to my ipod. i have followed directions - NOT WORKING.. frustrated!!!!!!  HELP.

    please help!  i am a fitness instructor that DEPENDS ON MY PLAYLISTS, and ever since i upgraded to itunes 11 last week, i CANNOT figure out how to add playlists to my ipod!  the tutorials were not helpful, as i followed instructions, and it DID NOT WORK.  i am VERY frustrated.  can someone help?
    thanks!

    revert the look and feel to itunes 10
    View > Show Sidebar
    View > Show Status bar.
    Now everything will work before.
    Click on your iPod in the lefthand window. Then use the music sync page to select your playlists. Or drag the playlists to your device

  • Eclipse plugin not working with Eclipse 2.1

    I'm trying to use the Eclipse plugin with Eclipse version 2.1 (recently
    released). I am aware that the Kodo documentation says it works with
    Eclipse 2.0. The "Kodo" menu appears in the wrong perspective (the CVS
    Repository Exploring Perspective). This makes it generally unusable.
    Anyone else tried this with better success?

    Problem solved. After closing the perspectives I had open and reopening
    them, the menu showed up in the correct perspectives.
    Ignore This wrote:
    I'm trying to use the Eclipse plugin with Eclipse version 2.1 (recently
    released). I am aware that the Kodo documentation says it works with
    Eclipse 2.0. The "Kodo" menu appears in the wrong perspective (the CVS
    Repository Exploring Perspective). This makes it generally unusable.
    Anyone else tried this with better success?

  • JCDE (Java Card Plugin) menu is not work on Eclipse

    I want to add JavaCard Applet into my existing project on Eclipse 4.2. So,
    1.I download EclipseJCDE and extract it into the plugin folder of Eclipse.
    2.When I open the eclipse, There are 2 menus appeared that is Java Card and JCWDE
    3.I add the Java Card Applet file into my project.
    Then I have a problem.

    Your reply did not help me access an update to JAVA to work with 10.8.3 to play JAVA related games. This is a REAL PROBLEM! As I subscribe to game websites and my family cannot play these games. I have contacted Apple Support and we tried uninstalling JAVA and reinstalling it from JAVA .com. We made sure my computer (IMAC) was set up to accept JAVA was turned on and I still have the same problem. JAVA related games will not play. The error message says "An updated JAVA has not been detected" So what am I to do? Who can help me with this type of problem? Apple Support asked me to contact JAVA by phone 1-800-223-1711 but they do not have any phone support. I was directed to a site called Live Support" and they charge $80.00 to resolve problems for an Apple computer or $1.00 a minute. Great choices! I accepted this offer however Apple will not allow third party developers to help. Do you have any ideas that will really help me?

  • Jsp:include does not work in 8.1 SP3?

    Hi all,
              I need to include a local file (external to the app) in jsp code. The external file includes an image map which changes very so often. So in order to avoid doing a build everytime, I thought about keeping the image map in a file which can be "included" in the jsp file, making it very dynamic to a change.
              So I have a servlet which will read this file and output the contents to response.getWriter(), which will be included in calling jsp code.
              But the jsp file does not seem to call the servlet at all.
              Here is the code in the jsp file:
              <%
              String sFileUrl = "/Prj/RenderReport?file=OrgChart.html";
              %>
              <jsp:include page="<%=sFileUrl%>" />
              What am I doing wrong? Is this not possible at all?
              Thank you all in advance.

    hi pjoshi,
              <jsp:include page="hello.jsp" /> tag is working fine in weblogic 8.1 sp3.
              I think it might be syntax error in your jsp page.
              This is the syntax to including dynamic files in jsp using <jsp:include page="" />tag as given below.
              <jsp:include page="{relativeURL | <%= expression %>}" flush="true" />
              go through the below link and you will find exact information how to include dynamic files in jsp using <jsp:include page=""/>
              http://java.sun.com/products/jsp/syntax/1.1/syntaxref1112.html
              --Anilkumar kari                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Android plugin not working in Eclipse on Arch 64bit

    Hi, I'm having some trouble getting the android plugin to work. I know there are a lot of similar threads about this on this forum and google but nothing seems to work. I have installed Eclipse 4.2 through pacman. I removed openJDK and installed Oracle's jdk/jre.
    java -version:
    java version "1.7.0_06"
    Java(TM) SE Runtime Environment (build 1.7.0_06-b24)
    Java HotSpot(TM) 64-Bit Server VM (build 23.2-b09, mixed mode)
    I manually edited Eclipse's ini file to find the jre:
    -vm
    /opt/java/jre/bin/java
    I did this before logging out or rebooting. And Eclipse would open ok and use the jre/jdk. I Then tried to install the ADT plugin and it would install without problem. I rebooted Eclipse but there were no signs of the plugin. No android project creation or android preferences. The plugin shows listed as installed.
    I then tried downloading android-eclipse from AUR and rebooted. But Eclipse looks the same. 
    I have no idea what could be wrong here.  Any help is appreciated. Thanks.

    hi
    I have same problem but not able to solve it.
    I was running elcipse 3.7.x with ADT plugin without problems.
    after eclipse update to 4.2.1 I am not able to use ADT. Eclipse is saying that it is installed but could not find anything from it in enviroment.
    I did reinstall eclipse and eclipse-emf eclipse-gef eclipse-wtp and follow http://developer.android.com/sdk/instal … g-adt.html but not sucess. Later I did find this https://developers.google.com/eclipse/d … clipse-4.2 but it is still same. ADT is installed but cannt use it.
    I am using openjdk
    pacman -Qs jdk
    local/jdk7-openjdk 7.u7_2.3.2-2
    Free Java environment based on OpenJDK 7.0 with IcedTea7 replacing binary plugs - SDK
    local/jre7-openjdk 7.u7_2.3.2-2
    Free Java environment based on OpenJDK 7.0 with IcedTea7 replacing binary plugs -Full Java runtime
    environment - needed for executing Java GUI and Webstart programs
    local/jre7-openjdk-headless 7.u7_2.3.2-2
    Free Java environment based on OpenJDK 7.0 with IcedTea7 replacing binary plugs - Minimal Java
    runtime - needed for executing non GUI Java programs
    Can be that problem?
    thanks

  • Maps - Transit directions not working!

    All of the sudden for a reason unknown to me, my Maps app stopped giving me directions! The GPS works, it will find locations and my location but will not give directions. It shows "Transit directions could not be found between these locations" and I'm not using it any differently than I ever have, no other country or anything like that so I'm stumped!! HELP PLEASE....

    I'm also experiencing a similar issue. When I attempt to get directions on the public transportation option I see the blue lines all over the place. Not sure if this was is a result of a recent update or not. The step-by-step directions are correct but the blue lines on the map are all jacked up.

Maybe you are looking for

  • Being prompted to update Flash, ignore?  v11.2.202.228 and v11.2.202.229 Google Chrome

    Just prompted by Adobe that an upgrade to Adobe Flash Player is available – within the bullets say includes security enhancements. Two weeks ago I was made aware that there were security vulnerabilities with Flash.  My laptop was infected (3/26).  On

  • How to display fixed width column in Advanced Table?

    Hi, This is probably a newbie question for OAF. My requirement is quite simple but I couldn't find the answer in either the OAF developer's guide or anywhere else so I turn to the experts here. I have a region of type Table or Advanced table with thr

  • Access MySQL Database on Server with PHP Services

    Hi there There are lots of tutorials on how to connect to a MySQL database on your local machine but I'd like to access a database on my server. When creating a new Flex Project the wizard asks me to define a Web root and a Root URL. I used '/home/ec

  • Can't open message to browser

    When I receive a message that has has an option to open something in browser it won't open. I tried to open help contents in browser and it wouldn't.

  • Organisational Reassigment

    Hello experts. I am trying to carry out the organisational reassignment action but i am facing some challanges. When i change an employee's position it is not updating the position in Organisational Management. In PA i see the new position in infotyp