Jsp( %@ include file )

suppose
abc.jsp
<% ! x=4 ; %>
xyz.jsp
<%@ include file = "abc.jsp" %>
< % x=4; %>
< % System.out.println ' x' =+x %>
what will happen ?

sorry zodak,
i cant close my eyesWell, maybe you could turn off your monitor?
Anyway, do people misspell my name as an insult? because they can't type? I don't understand. It is 5 letters. (I don't know why it intrigues me but they always switch the a and the o)

Similar Messages

  • Variables defined in JSP include files.

    hi..
    i was wondering how to access the variable defined in a JSP include file from the page where it is included.

    If you are thinking of scriptlets, then you would do it in the same manner that you would access variables local to your jsp. A word of caution - jsp pre-compilation may not work.
    A neater solution would be store it as an attribute in 'page' scope.
    cheers,
    ram.

  • JSP:  Include file paths

    Hi;
    I'm using Tomcat 3.2.
    I am trying to use the path "../common/copyright.html" for an include
    path. It isn't working.
    For some reason it seems you can't "go backwards" with a file path
    with Tomcat 3.2/JSP include file paths.
    Is there a way around this or does anyone know anything about it?
    ( I read the specs, they weren't of much help and I couldn't find
    much be searching google.)
    Thanks in advance
    Steve

    Try using the full (or absolute) path. If that does not work, then talk to Tomcat developers. If it does, then look at where the JSP pages lies in relation to the path you are trying to use the "../" method on.
    Example:
    JSP path: www.you.com/jsp/pages/hello.jsp
    Include path: ../jsp/pages/open.jsp
    This will cause an error becuase the path of the JSP page does not exist within the include path.

  • Reloading a jsp include file

    Lets say I have a container,
    <div id="mindmapcontainer">and within this container, I have a jsp include
    <%@ include file="mindmap.jsp"%>and within the parent page there is a flash map. I have manipulated the css in such a way that this container (and its include file) will not show unless the user clicks on a country (using visibility hidden/visible). I understand that the external file loads on the server side when the parent page loads,despite it being hidden.
    Now the problem is, I'm missing some fancy effects that is shown only when the external jsp first loads. Is there any way I can make it reload onClick?
    I'm using ammap and js-mindmap btw.

    nope using window.location.reload() will reload the entire page.and i dont want that because it will get me back to my flash map screen and not the mindmap screen.thanks for your answer anyway.is there is a way to make it reload a div only or a jsp include?

  • Structure of jsp:include file?

    When using the jsp:include action, what should the format of the included file be, ie, what tags, if any, should exist in the file that is to be included? Should it just be the raw source?
    Further to this, if I want to encapsulate all code for a common function into a file that I'm going to be using in an include call, what if it uses a javascript file - can I include the reference to that in the file too?

    I understand the difference between the 2 options, I'm wondering more about the structure of the file that would be 'included' in either case and how I would specify the inclusion of a javascript (.js) file in the file - should there be html, head, body, etc tags in it or is it raw code?
    My scenario is that we use 'bubble help' in our web app to display tips to the users, so I want to encapsulate all the code for the bubble help in a single file that I will just include on all the pages that need it, hopefully the reference to the Javascript file would be in there as well

  • Jspf (jsp include file) not recognized

              It looks like weblogic doesn't recognize the jspf extension as belonging to "fragments
              of JSP code that will be incorporated using a static include" as recommended by
              the JSP 1.2 spec. That means that such included files are treated as static text,
              not compiled.
              Does anyone know how to teach wls about this extension?
              Ray
              

              Nothing in the JSP Specification indicates that jspf extensions should be used for
              static includes, it only address the naming convention. I think it's relevant to
              point out that a dynamiclly included jspf-ragment is not a top level page.
              In Tomcat 4.x this is achived by adding a servlet mapping from *.jspf to the jspservlet
              in the default web.xml file.
              Where can I add an extra mapping from *.jspf to whatever *.jsp is mapped to in Weblogic
              6.1sp1?
              Thanks // Torben
              Robert Patrick <[email protected]> wrote:
              >..jspf files are pieces of a jsp and are never inteneded to be translated
              >
              >into a JSP outside the context of another JSP file. Therefore, .jspf
              >files should only be included using static includes (like #include in
              >C/C++). A dynamic include means that the included page is compiled and
              >
              >executed as a stand-alone JSP and its output is included in the output
              >stream of the including JSP.
              >
              >Hope this helps,
              >Robert
              >
              >Ray Schnitzler wrote:
              >
              >> What about dynamic includes? Should I expect them to be treated as jsp?
              >>
              >> "Alex Worden" <[email protected]> wrote:
              >>
              >>>If you statically include any file into a top-level .jsp file, its contents
              >>>will be treated as JSP. That includes .jspf files. So, this is supported
              >>>since WLS5.1 !
              >>>
              >>>Why are you not seeing this behavior I wonder? Static includes are just
              >>>in-lined into the including page and compiled as JSP code....
              >>>
              >>>Can you send me an example that doesn't work for you?
              >>>
              >>>Thanks,
              >>>
              >>>Alex
              >>>
              >>>
              >>><[email protected]> wrote in message news:[email protected]...
              >>>
              >>>>WLS 6.x supports the JSP 1.1 spec. ( see below). For JSP 1.2 see WLS
              >>>>
              >>>7.x
              >>>see
              >>>
              >>>>below) . The JSP 1.2 final release is very new and I am sure keeping
              >>>>
              >>>up
              >>>with the
              >>>
              >>>>constantly evolving space is difficult for any product.
              >>>>--------------------
              >>>>
              >>>>http://e-docs.bea.com/wls/docs61/jsp/intro.html
              >>>>http://e-docs.bea.com/wls/docs70/jsp/intro.html#49347
              >>>>---------------------------
              >>>>"Ray Schnitzler" <[email protected]> wrote:
              >>>>
              >>>>>It looks like weblogic doesn't recognize the jspf extension as belonging
              >>>>>to "fragments
              >>>>>of JSP code that will be incorporated using a static include" as
              >>>>>
              >>>recommended
              >>>
              >>>>>by
              >>>>>the JSP 1.2 spec. That means that such included files are treated
              >>>>>
              >>>as
              >>>
              >>>>>static text,
              >>>>>not compiled.
              >>>>>
              >>>>>Does anyone know how to teach wls about this extension?
              >>>>>
              >>>>>Ray
              >>>>>
              >>>>>
              >>>
              >>
              >
              

  • Jsp taglibs in include files not detected, throws errors, no code insight

    I have a jsp which is included in all the other jsp. it looks something like this
    taglibs.jsp
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
    <%@ taglib uri="http://www.springframework.org/tags" prefix="spring" %>
    <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
    test.jsp
    <%@ include file="/jsp/menu/taglibs.jsp"%>
    <html>
         <head>
              <title>Tours</title>
         </head>
         <body>
    <form:form commandName="testCommand">
                   <form:hidden path="tour.firstname" id="tour.firstname" />
    and so on.
    I am having 2 problems
    1. the jsp editor show errors all over the place saying
    element path not expected
    element commandName not expected etc.
    2. no code insights.
    but if i include the taglib def in test.jsp it dosn't show any error and also provides code insights. but seldom do people include all taglibs in all jsps.
    is there a way for Jdeveloper to show code insights in jsp pages which includes a jsp or like xml schemas could be added at some place(tools-pref-xml schemas) and when used anywhere, would provide code insights.

    am not sure, try with this
    <jsp:include   .../>

  • JSP tag spanning @include files

    Weblogic 5.1 sp 9
              Windows 2000
              inc1.inc:
              <x:customtag>
              inc2.inc:
              </x:customtag>
              body.jsp:
              <%@ include file='inc1.inc' %>
              ...[body stuff here] ...
              <%@ include file='inc2.inc' %>
              hitting this page gives:
              java.lang.RuntimeException: Could not parse embedded JSP code:
              weblogic.utils.ParsingException: Could not complete parsing, unmatched tags:
              customtag
                   at weblogic.servlet.jsp.JspLexer.parseJspCode(JspLexer.java:1079)
                   at weblogic.servlet.jsp.JspLexer.parseJspCode(JspLexer.java:1057)
                   at weblogic.servlet.jsp.JspLexer.parseJspCode(JspLexer.java:1050)
              Why is this not valid? Other JSP engines allow this. Doesn't the @include
              directive just pull in code at .java source generation time?
              Thanks,
              j
              

    This does look like a bug. I have tried it too with SP6. Contact support with
              the same problem. [email protected]
              Shiva.
              Jason Collins wrote:
              > Weblogic 5.1 sp 9
              > Windows 2000
              >
              > inc1.inc:
              > <x:customtag>
              >
              > inc2.inc:
              > </x:customtag>
              >
              > body.jsp:
              > <%@ include file='inc1.inc' %>
              > ...[body stuff here] ...
              > <%@ include file='inc2.inc' %>
              >
              > hitting this page gives:
              >
              > java.lang.RuntimeException: Could not parse embedded JSP code:
              > weblogic.utils.ParsingException: Could not complete parsing, unmatched tags:
              > customtag
              > at weblogic.servlet.jsp.JspLexer.parseJspCode(JspLexer.java:1079)
              > at weblogic.servlet.jsp.JspLexer.parseJspCode(JspLexer.java:1057)
              > at weblogic.servlet.jsp.JspLexer.parseJspCode(JspLexer.java:1050)
              > ...
              >
              > Why is this not valid? Other JSP engines allow this. Doesn't the @include
              > directive just pull in code at .java source generation time?
              >
              > Thanks,
              > j
              

  • %@ include file= ... does not work properly in Portal

    I am devloping a portlet based on a jsp that uses some <%@include ..> tags. I have
    a problem in that variables declared and used in one jsp is not visible in a jsp
    that is included later on. Also, the scope of the page import tag of the main
    jsp does not cover the included jsp's.
    <%@ page import="javax.servlet.* ......>
    <%@ include file="variables.jsp" %> // Classes imported above are not recognised
    in this jsp
    <%@ include file="code.jsp" %> // Variables declared and used in variables.jsp
    are not visible here
    The exact same code runs very well in a Tomcat container (as pure jsp, not portlet)
    Can anybody help here please?

    Geir -
    I have the same problem. If you do solve it, please post it to this thread.
    Thanks
    Kunal
    "Geir Willumsen" <[email protected]> wrote:
    >
    I am devloping a portlet based on a jsp that uses some <%@include ..>
    tags. I have
    a problem in that variables declared and used in one jsp is not visible
    in a jsp
    that is included later on. Also, the scope of the page import tag of
    the main
    jsp does not cover the included jsp's.
    <%@ page import="javax.servlet.* ......>
    <%@ include file="variables.jsp" %> // Classes imported above are not
    recognised
    in this jsp
    <%@ include file="code.jsp" %> // Variables declared and used in variables.jsp
    are not visible here
    The exact same code runs very well in a Tomcat container (as pure jsp,
    not portlet)
    Can anybody help here please?

  • Jsp include issue

    hi
    i've tested a new version of my jsp include file (a header which is referenced by about 40 pages) on one jsp page, and its wokred ok. i've changed the coding of the include page though none of the other jsp pages have picked up the new include and are still looking to the old one ? i've stopped and started tomcat but its till not changed.
    does anyone have any ideas ? i've included a couple of new tag libraries but they are working ok and i cant see why it would be anything other than tomcat ? should i try stopping the app itself ?
    cheers
    chris

    not restart, you need to clear the work directory, or at least modify all the files that use the included file to get them to recompile. The server doesn't check for changes in included files for some reason.

  • Calling custom tags in jsp  with jsp:include

    Hi,
    I have a large jsp file , which uses jstl fmt tags for labels.
    Since the size of jsp was too big iand i was unable to compile it because of 64 kb class size limit,
    I removed the tag lib defination from the jsp file and put it in another jsp file. and used jsp:include to include this file inside the first jsp.
    It is compiling successfully but labels r not showing up.
    but when i use <%@include to include second jsp in the first one i get the labels properly.
    I cannot use <%@include as this starts giving me compilation error related with jsp class file size beyond 64 kb.
    Pls suggest why jsp:include is not working.
    thanks,
    Pramod

    Hi Anil,
    Ur suggestion was good but could not solve my problem.
    I have put a small sample code to illustrate the problem.
    labeldemo.jsp:
    <%-- <%@ include file="WDCComInitLabelsjunk.jsp" %> --%>
    <jsp:include page="WDCComInitLabelsjunk.jsp" flush="true" />
    <table width="100%" cellpadding="3" cellspacing="0" border="0" class="tablebg">
                                  <tr class="headtd">
                                       <td colspan="4"><span class="headtext"><fmt:message key="Cash_Management"/> </td>
                                  </tr>
                                  <tr> hi </tr>
                             </table>
                             </fmt:bundle>
    WDCComInitLabelsjunk.jsp:
    <%@ page language="java" %>
    <%@ page contentType="text/html"%>
    <%@ page import="com.tcs.wdc.core.*" %>
    <%@ page import="com.tcs.wdc.core.login.*" %>
    <%@ page import="com.tcs.wdc.core.service.navigation.*" %>
    <%-- Include tag library --%>
    <%@ taglib uri="/WEB-INF/tld/fmt.tld" prefix="fmt" %>
    <%-- Get language from IDCUserSession & set it in session --%>
    <%
    /*SessionManager sm = new SessionManager(session);
    IDCUserSession ius = sm.getIDCUserSession();*/
    session.setAttribute("language","nl_NL");
    %>
    <%-- Set the locale for the language obtained --%>
    <fmt:setLocale value="${language}" />
    <fmt:bundle basename="labels" />
    If i uncomment the <%@ include file="WDCComInitLabelsjunk.jsp" %> tag in the code above it is working fine ,
    but it is not working with <jsp:include page="WDCComInitLabelsjunk.jsp" flush="true" />
    pls suggest.
    Thanks,
    Pramod

  • Jsp:include problem in custom tag

    I call <jsp:include page="emailbody.jsp" /> within a custom tag(in a file
              caller.jsp), which does emailing.
              When I invoke caller.jsp from browser, I do get the output(body of the
              email) on the browser screen, but not the output is not send as the body of
              the email.
              When I use static include namely, <@include file="emailbody.jsp" />, the
              output is directed to the body of the email.
              The above means, for a static jsp include file, it is parsed and included in
              the body-evaluation of the custom tag.
              For a dynamic include file, it is NOT parsed and NOT included in the
              body-evaluation of the custome tag.
              The reason could be, How Weblogic loads classes for custom-tag for dynamic
              include files.
              Can anybody at BEA throw loght on this and the solution.
              Thanks in advance.
              Chandra
              

    Well I found out jsp:include is not supported inside custom tags for JSP
              spec 1.1.
              This was stated in section 5.4.5 of spec 1.1.
              May be in future spec 1.2.
              Thanks
              Chandra
              "Cameron Purdy" <[email protected]> wrote in message
              news:[email protected]...
              > Have you sent this to [email protected]?
              >
              > It sounds serious.
              >
              > Peace,
              >
              > --
              > Cameron Purdy
              > Tangosol, Inc.
              > http://www.tangosol.com
              > +1.617.623.5782
              > WebLogic Consulting Available
              >
              >
              > "matthew mcclain" <[email protected]> wrote in message
              > news:[email protected]...
              > > I have run into the same problem.
              > > I'm certain it's because CustomTags have their own buffer and
              > > jsp:include or pageContext.include() or requestDispatcher.include()
              > > all bypass the buffer and write to the underlying stream.
              > >
              > > I attempted to define jspx:include by wrapping the response object
              > > which is sent to requestDispatcher.include and then wrapping the
              > > OutputStream returned from the response with a stream which
              > > writes to the "out" of the pageContext for my tag.
              > >
              > > Unfortunately, I get a class cast exception because weblogic expects
              > > it's own class to be there as a ServletOutputStream:
              > >
              > > java.lang.ClassCastException:
              com.allmystuff.wif.IncludeServletResponse$1
              > > at
              > >
              >
              weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImp
              > > l.java:202)
              > > at
              > >
              >
              weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImp
              > > l.java:172)
              > > at com.allmystuff.wif.Include.doStartTag(Include.java:37)
              > >
              > > So any chance, jsp:include will get fixed?
              > >
              > > Thanks,
              > > Matthew McClain
              > > [email protected]
              > >
              > >
              > > "chandra" <[email protected]> wrote in message
              > > news:[email protected]...
              > > > I call <jsp:include page="emailbody.jsp" /> within a custom tag(in a
              > file
              > > > caller.jsp), which does emailing.
              > > > When I invoke caller.jsp from browser, I do get the output(body of the
              > > > email) on the browser screen, but not the output is not send as the
              body
              > > of
              > > > the email.
              > > > When I use static include namely, <@include file="emailbody.jsp" />,
              the
              > > > output is directed to the body of the email.
              > > >
              > > > The above means, for a static jsp include file, it is parsed and
              > included
              > > in
              > > > the body-evaluation of the custom tag.
              > > > For a dynamic include file, it is NOT parsed and NOT included in the
              > > > body-evaluation of the custome tag.
              > > > The reason could be, How Weblogic loads classes for custom-tag for
              > dynamic
              > > > include files.
              > > > Can anybody at BEA throw loght on this and the solution.
              > > > Thanks in advance.
              > > > Chandra
              > > >
              > > >
              > >
              > >
              >
              >
              

  • 3 level jsp include

    I did a "framework" jsp file, because I have a bunch of pages, that need to look the same, except for the content.
    "framework" pseudo code:
    DoStuff
    *include file X;*
    DoSomOtherStuff
    *include file Y;*file X depends on the jsp including this framework, example:
    myFirstPage.jsp:
    X = "myFirstPartX.jsp";
    Y= "myNextPartY.jsp";
    <%@ include file="framework.jsp" %>Ok, so what type of include can I use in the framework to include X and Y files?
    I didn't find any way to create constants in MyFirstPage.jsp that I could use in the include directive so I have to use the jsp:include taglib, where X and Y are variables.
    Super, my only problem with the jsp:include is:
    - it is more resource consuming isn't it?
    - I cannot access variables I declared in myFirstPage.jsp
    - a can only pass objects to myFirstPartX.jsp and myNextPartY.jsp via the request.setAttribute
    It's seems like a trivial problem, being able to use a different include directive based upon the top level page (macros, constants?), is there no better solution than a jsp:include ?

    JohnnyTheHun wrote:
    - it is more resource consuming isn't it?
    - I cannot access variables I declared in myFirstPage.jsp
    - a can only pass objects to myFirstPartX.jsp and myNextPartY.jsp via the request.setAttribute1. compare to static include, dynamic will more consuming.
    2. if you need to pass string type information you can use jsp:param
    <jsp:include page="x.jsp">
       <jsp:param name="param1" value="value1"/>
       <jsp:param name="param2" value="value2"/>
    </jsp:include>
    <jsp:include page="y.jsp">
       <jsp:param name="param1" value="value1"/>
       <jsp:param name="param2" value="value2"/>
    </jsp:include>
    ...3. for object type information & continous sharing information(main.jsp > x.jsp > main.jsp > y.jsp > main.jsp), u can use request attribute. request attribute is designed for foward & include purpose.
    Edited by: j_shadinata on Feb 5, 2008 10:37 PM

  • Writing JSP dynamically & using  JSP includes

    Need help with this one --
    I am pulling data from various fields of the DB and then placing the data into session vars so that based on what a user selects, the right information is displayed.
    My problem is this - I want to be able to display a jsp include file based on what the user selects. So the flow would go something like this
    EXAMPLE
    // USER selects a fruit (from a drop-down form) --> apple
    "apple" is stored in session var named fruit.
    // USER SUBMITS and expects to see a page based on his <%=fruit %> selection.
    //show_page.jsp
    I want to use the include tag that will call the right page based on the user selection -- like this:
    <%@ include file="<%= fruit%>.jsp" %>
    And in my thinking this would return - <%@ include file="apple.jsp" %> and thus include the right file for the user.
    Anyone know if embeding JSP to include a session var is possible?
    Thanks for any help
    Mark
    I know my synax is wrong. It's like I'm trying to embed a JSP tag inside inside a JSP include tag.
    Is there any way to do this

    learn the syntax...you won't get so many errors.
    "Professional JSP", WROX Press is great.
    scriplets ("<%....%>") can't have action tags in them.
    example:
    <%
    String include = "some_page.jsp"
    %>
    <jsp:include page="<%=include%>" />
    good luck.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Including Files and Caching

    I currently have a small web site (running on Apache Tomcat 4.0) that implements jsp:include a lot on every page. This was done so that I could change a single JSP file and that "component" would be changed all throughout the site. (Which is basically the point of having jsp:include !!)
    My problem is that if I change the included file and refresh a JSP page that uses it, the browser shows that the change was made. But if I then move to any other page, the same old version of the included file is still being shown. (Am I making any sense here?)
    The only way I can get all of the JSP files that use the include file to get the NEW version of the include file is to either:
    (1) make a change to each individual JSP file so that it forces the webserver to recompile the JSP page using the new JSP include file or
    (2) shutdown the webserver and restart it
    I'm sure there has got to be a better way of doing this. Any suggestions?

    I've had the same problem and unfortunately there is no way around it :(
    what i'm doing now is calling one single index.jsp page where i keep all my includes and so instead of having to go to a brand new page I just have a switch statement that calls the page depending on the parameter you pass on the query string
    index.html?page=editTools
    I also have a hash table that maps the strings to an integer..
         case 1:{
              %>
         <%@ include file="includes/admin_editTools.jsp" %>
         <%
         break;
    this way whenever you make a change to one of your includes you only have to reload one
    page index.jsp. It works great!
    Chris

Maybe you are looking for

  • IPod on iPhone 3G won't play in my car after iOS 4 upgrade

    I have a 2010 Hyundai and my iPod played fine w/ the use the the Hyundai iPod cable until I upgraded to iOS 4. I used to get the airplane mode warning but once it went away it always played fine. Now instead of the airplane mode warning I get "This d

  • How to find out the service conformation details based on service order

    Hi. I open the CRMD_ORDER In this i open a service order. I got all the information of that particular service order number in the CRM_ORDER_READ program. But i unable to find out conformation details of that particular service order. In CRM_ORDER_RE

  • Need help Please can't upload videos on facebook

    I'm try to up load video on facebook for 3 days now and it shows that My video was encoding, but now it's gone , every time video is 48.5 MB , 1 min and 40 sec it's small formate (.m4v) the problem with my macbook not facebook as i tried to upload wi

  • Novatel Wireless XU870 and kernel panic

    I have installed both Novatel drivers and Apple WWAN Update to a Mac Book Pro (OSX version 10.4.8). When I put Novatel Wireless XU870 card in ExpressCard slot Mac Book Pro goes grazy. In Finder top bar icons (clock, display, etc) disappears and after

  • Used part of the tablespace

    Hi I appreciate if anyone can clear my doubts. create tablespace test datafile 'C:\test.dbf' size 50M extent management local uniform size 10M When I check the used space of this tablespace: I notice that 1-)Even the tablespace is empty, it shows 10M