Nested static includes

In Weblogic 6.0 SP1, I get the following error when I have nested
          compile-time (static) includes of JSPs. It does not seem to matter what the
          included file/s contain. It seems that Weblogic JSPC does not like nested
          includes. Did not see anything in the spec to disallow nested includes, but
          I may be missing something. BTW, it compiles and runs fine in JBuilder.
          Any ideas?
          java.lang.RuntimeException: Could not parse embedded JSP code:
          weblogic.utils.ParsingException: nested TokenStreamException:
          antlr.TokenStreamException: Could not include includes/id_footer.jsp
               at weblogic.servlet.jsp.JspLexer.parseJspCode(JspLexer.java:1116)
               at weblogic.servlet.jsp.JspLexer.parseJspCode(JspLexer.java:1093)
               at weblogic.servlet.jsp.JspLexer.parseJspCode(JspLexer.java:1086)
               at weblogic.servlet.jsp.JspLexer.buildTimeInclude(JspLexer.java:864)
               at weblogic.servlet.jsp.JspLexer.mINCLUDE_DIRECTIVE(JspLexer.java:3758)
               at weblogic.servlet.jsp.JspLexer.mDIRECTIVE(JspLexer.java:3531)
               at weblogic.servlet.jsp.JspLexer.mSTANDARD_THING(JspLexer.java:1829)
               at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:1670)
               at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java:1552)
               at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java:893)
               at weblogic.servlet.jsp.JspParser.doit(JspParser.java:71)
               at weblogic.servlet.jsp.JspParser.parse(JspParser.java:139)
               at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:113)
               at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:253)
               at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java:324)
               at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:180)
               at weblogic.servlet.jsp.JspStub.checkForReload(JspStub.java:133)
               at
          weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:31
          0)
               at
          weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
          :208)
               at
          weblogic.servlet.internal.RequestDispatcherImpl.forward(RequestDispatcherImp
          l.java:157)
               at
          org.apache.struts.action.ActionServlet.processActionForward(ActionServlet.ja
          va:1759)
               at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1595)
               at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:491)
               at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
               at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
               at
          weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
          :213)
               at
          weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
          ntext.java:1265)
               at
          weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
          :1622)
               at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
               at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
          Thanks,
          Mitesh Mehta
          S1 Corp (http://www.s1.com)
          

Max Stewart wrote:
> Does this restriction also then apply when F12
previewing in a browser ?
F12 launches the page in a browser. Once it has done so, it
has nothing
to do with Dreamweaver. If you set up a testing server that's
capable of
handling SSI, everything should be displayed exactly the same
as on a
live website.
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS4",
"PHP Solutions" & "PHP Object-Oriented Solutions"
http://foundationphp.com/

Similar Messages

  • Using static include directove problem in ONE web server 6.1

    Hi,
    I am using sun ONE web server 6.1 to serve jsp pages with custom tags.
    All the jsp includes used are static (@include).
    I have card.jsp that includes common.jsp and specific_page.jsp.
    specific_page.jsp includes generic_page_header.jsp.
    common.jsp has the taglib directive.
    specific_page.jsp and generic_page_header.jsp use custom tags defined in the taglib directive.
    It appears that the custom tags in specific_page.jsp are parsed without a problem, but the custom tags in generic_page_header.jsp generate the following exception: WEB4105: End of content reached while more parsing required: tag nesting error?
    When I manually pasted the code from generic_page_header.jsp into specific_page.jsp the page was parsed successfully.
    Can anyone help with this problem?
    Thanks,
    Oded

    Hi,
    I am using sun ONE web server 6.1 to serve jsp pages with custom tags.
    All the jsp includes used are static (@include).
    I have card.jsp that includes common.jsp and specific_page.jsp.
    specific_page.jsp includes generic_page_header.jsp.
    common.jsp has the taglib directive.
    specific_page.jsp and generic_page_header.jsp use custom tags defined in the taglib directive.
    It appears that the custom tags in specific_page.jsp are parsed without a problem, but the custom tags in generic_page_header.jsp generate the following exception: WEB4105: End of content reached while more parsing required: tag nesting error?
    When I manually pasted the code from generic_page_header.jsp into specific_page.jsp the page was parsed successfully.
    Can anyone help with this problem?
    Thanks,
    Oded

  • REP-0069 error when using static includes.

    I am trying to use static include files in my report JSP file. Such as...
    <%@ include file="ServerName.jsp" %>
    Although they seem to work when I run the report, Report Builder doesn't like them. When I open the report in Report Builder I get an REP-0069 error. When I then try to display the data model it is blank. If I remove the static include the report opens fine. Beans also have this same problem.
    Dynamic includes don't generate an message. However, scriptlette variables set in the included file are not visiable to the including file.
    Jim

    Hi Jim
    I tried this with Reports 9.0.2 latest patch. When a open a .jsp report where I have put a statis include tag, I get a builder crash. I am filing a bug on this. Please let me know your mail address, I would update you once the issue is resolved.
    Thanks
    Rohit
    Oracle Reports Team

  • JSP Static Include in JDeveloper

    We've got some older-style code that statically includes a page (<%@ include file="xyz.jsp" %>) that assumes the existence of, and references, a variable (declared via <% %>) in the including page. This runs fine when deployed to an OC4J server, but of course when I try to run the including page in JDeveloper, it attempts to pre-compile all of my JSPs and then chokes on the inlcuded page, as it is attempting to reference an undeclared variable.
    Is there a work-around in order to get this to run in JDeveloper? (putting JSTL aside for the moment...)
    Thanks,
    Jim

    Hi Mike,
    Thanks for the reply.
    Both IncludingJSP.jsp and IncludedJSP.jsp are in my project. Here is a simple test case to try if you have the time/interest:
    <<IncludingJSP.jsp>>
    <%
    String s = "test";
    %>
    This is IncludingJSP.jsp
    <br>
    <%@ include file="IncludedJSP.jsp"%>
    <<IncludedJSP.jsp>>
    This is IncludedJSP.jsp
    <br>
    <%=s%>
    When I try to compile either page, or try to run IncludingJSP.jsp, I get the following result in JDev:
    C:\OraHome1\JDev9031\jdev\mywork\TestWS1\Project3\public_html\IncludedJSP.jsp
    Error(3,17): variable s not found in class _IncludedJSP
    I've done this type of thing in the past myself, but it was a project involving components that wouldn't compile or run locally (accessed Portal APIs/components that only existed on the server in the Portal environment), so we always ran/debugged on the server, where this arrangement will (and does) work fine. Its just in the JDev environment that it gets stopped up. (Similarly, in JDev, if you comment out the variable reference in the Included JSP, you can compile and run fine. If you then uncomment the variable reference and just refresh the browser - w/o recompiling and rerunning in JDev - all works fine - this is synonymous with how deployment to the server would behave.)
    A first-level (flawed) workaround is to deselect the "Make Project Before Running" option in the Project Settings:Runner:Options page. In doing so, a Make/Rebuild of the project will cause the above error, but simply running the IncludingJSP.jsp will allow things to work correctly - looks great. The problem here is that if I then introduce a Bean, say Bean1, that I reference in IncludingJSP.jsp (via jsp:useBean and jsp:getProperty, for example), then when I try to compile the Bean after making a change (something significant like changing the return type of a get method - simply changing something internal to the Bean seems to work fine, as the prior compilation of the referencing page still works), the dependency analysis gets hosed up and depending on what I do (Make/Rebuild of Bean/Project), I either get compile-time error messages or things appear fine at compile-time and then when I run, the Bean or referencing JSP are not properly compiled.
    I've tried getting tricky and having a second Project, containing my IncludedJSP.jsp file, setting its HTML Root to be the same as the other Project (thus having the IncludedJSP.jsp file available for the compilation of IncludingJSP.jsp, but not having it included in the project's dependency analysis and subsequent compile), but that hoses something up and I then can't run any JSPs in the first Project. (This is regardless of whether a file is included or not - simply having a common HTML root between two projects seems to screw things up to the point that you can't run any JSPs in either project...)
    Its kinda frustrating. I think I see/understand basically why its doing what its doing, but it'd be nice to find a way to keep it from happening! I don't know if maybe using Ant would solve this type of problem?
    Anyway, appreciate your interest - if you have other ideas, I'm open to them!!
    Jim

  • Static include in ADF page.

    Hi All,
    I tried a lot for static include in .jspx pages with ADF Faces but couldn't find a solution for implementing.
    jsp has two include directives 1) @include 2) jsp:include.
    I would like to include one jspx page in other jspx page statically similar to @include functionality of jsp. How can we achieve this with ADF Faces jspx pages?
    It is most common requirment in web development that header and footer will be created in separate files and will be statically included in all pages but ADF Faces doesn't seem to support this feature.
    SRDemo exmple says to create a template first and then use this template to create other pages but this approach can't be used as it is always possible that there is a change in template it self.

    You can perform an either static or even dynamic page inclusion (JSPX within another JSPX) regarding that you have to follow these rules:
    1 - The Included page must use a subview element instead of a view one, considering that in case of more than one simultaneous page inclusion, they must have unique identifiers.
    2 - In case that the included page has its own standalone page definition, then things become more complicated (till JDeveloper 10.1.3.3), and you have to perform some work arounds using the page element within the container-page page definition to get access to its children-pages page definitions.
    Hope this helps. Feel free for any further information.

  • Jspf is getting only statically included! please help!

    Hello,
    I am using glassfishv2ur2; I have a jsp page, that uses ...
    <jsp:include flush="true" page="WEB-INF/jspf/rightpanel.jspf"/>
    to rope in a jspf (jsp segment or fragment).
    I noticied via view source on my browser, the jspf is included in only statically! i.e, scripts and tags within the jspf are not getting processed, but simply being echoed back to the browser verbatim.
    I have been searching the fourms and the web on this issue and some of the postings indicate that some entries are needed in the web.xml for this to work.
    I don't see any servlet-mapping for the jsp tag in my web.xml and sun-web.xml - these are generated for me by netbeans. Can someone please help me ... tell me what i need to make the jspf be processed and not be statically included in glassfish?
    Thanks
    Edited by: ramboram on Aug 11, 2008 8:57 AM

    jspf files are intended to be included with the include directive - <%@ include %> not a <jsp:include>
    The include directive effectively "pastes" the contents of the file into the current jsp before it is compiled.
    <jsp:include> is designed to evaluate the resource at runtime. It pastes the result of running the JSP into the current response.
    So you should only <jsp:include> standalone jsp pages - not fragments.

  • Static includes, Tomcat and RequestDispatcher

    hi
    we are using Tomcat 4.1.18/IIS on a win2000 machine. we have one JSP statically including other JSPs, and I know that Tomcat can detect and recompile statically included pages when they are modified (whether or not the calling page has been modified). This works fine on its own. However, when we call our servlet, it does some processing then forwards the request using a RequestDispatcher like this
    RequestDispatcher rd = getServletContext().getRequestDispatcher(page);
    rd.forward( req, res );
    the problem is that Tomcat no longer detects that statically included pages have been modified. is it something to do with the request dispatcher, Tomcat or what? we have done a lot of internet research but have come up empty.
    thanks in advance
    john

    "On requesting a JSP page, the request is transferred from the normal WWW server (e.g. Apache) to Tomcat which first checks whether it has cached an already compiled version of the Java programme associated with the page. Recompilation takes place if the last modification date stamp on the JSP page is more recent than the last modification date stamp on any cached compiled version."
    Tomcat checks the timestamp when it first recieves the request. At this point you are requesting a servlet and tomcat doesn't know that the request is going to be forwarded to a JSP so it never checks the timestamp of the JSP or any included files.

  • Nested jsp:include includes wrong file

    Hi,
    I've encountered a somewhat strange problem that's upsetting me for more than 3 hours by now. I've searched on the Web, Usenet, Tomcat Bugzilla, and the java.sun.com forums, but still didn't find a solution.
    Let me explain my current JSP/servlet flow:
    A servlet retrieves an article from a database, puts the article data into a bean, sets that bean as request attribute and includes a JSP to display the content of this bean (your basic MVC pattern). This works fine.
    The page being included by the "retrieve" servlet is actually a layout page (index.jsp) including the JSP (article.jsp) which displays the bean data, so the servlet actually includes "index.jsp?c=article.jsp" (with the bean as request attribute).
    In that index.jsp, there's a jsp:include that should include the output from another MVC-style servlet/JSP-block: Servlet "poll" creates a PollBean from a database, puts that as attribute into the request and includes "polls/show.jsp".
    Here's a simplified representation of my page layout:
    +---------+---+       The outer box is the "index.jsp", which
    |         |   |      
    |         |   |       a) includes the servlet "retrieve"
    |    1    | 2 |          which in turn includes "article.jsp"
    |         |   |          at position 1 and
    |         |   |
    |         |   |       b) includes the servlet "poll"
    |         |   |          which in turn _should_ include "polls/show.jsp"
    |         |   |          at position 2
    +---------+---+Well now, my problem is: Somehow Tomcat manages it to include the "article.jsp" TWICE at position 1 AND 2, although the jsp:include at positon 2 reads (that's hardcoded):
    <jsp:include page="/poll?action=latest&limit=1" />
    And in the PollServlet (as you guess, mapped to "/poll") the file to be included is hardcoded to "polls/show.jsp".
    If there wouldn't be anything included at position 2, that would pretty clearly be an error with wrong relative paths used in the jsp:include at position 2. But what really scares me is that the "article.jsp" get's included at position 2 although some debugging statements show that the PollBean is actually in the request after the jsp:include at position 2 has been executed.
    I just don't get it why "article.jsp" is included twice, and although the poll servlet is called, the "polls/show.jsp" doesn't show up anywhere.
    I've tried to flush the "out"-JSPWriter of "index.jsp" at several different key locations in the code, even flushed() in the PollServlet after including "polls/show.jsp" but that didn't help.
    If you need some proof of this weird behavior, ask in this thread and I'll post the link the website where that happens.
    Thanks in advance,
    phil

    Try deleting all the compiled JSPs (usually in a
    directory called "work") then requesting the pageThat's what I did, too. I've gone through the whole make-Tomcat-start-all-over procedure:
    - reloaded via webapp manager: nope
    - stopped/started via webapp manager: nope
    - clear /work/ directory and restarted Tomcat: nope
    Didn't help anything.
    Have you debugged your PollServlet to see if it's
    returning/including the right (hard-coded) page?Mmh.. What should I debug there? There's not much to debug, if stuff is hard-coded like ...
    I just found the error in my code! duh I was just looking in Eclipse for a piece of code to post here when I saw my mistake:
    The CMS I'm currently adding the poll feature to is more flexible than I thought (and that although I wrote it myself!):
    The article-retrieve servlet is called by this URL:
    /retrieve?nextPage=article.jsp&id=12345And my poll servlet is called by
    /poll?action=latest&limit=1Normally this would include the "polls/show.jsp" from the PollServlet because the code in PollServlet reads:
    // Use nextPage from request or show by default
    nextPage = request.getParameter("nextPage");
    if(nextPage == null) nextPage = "polls/show.jsp";But when the PollServlet got called from the "index.jsp?c=retrive&nextPage=article.jsp&id=123" page, there actually was a "nextPage" param and it's value was "article.jsp". And because there was still an ArticleBean in the request (from the ArticleRetrieveServlet), this "article.jsp" included by the PollServlet displayed the article a second time.
    I fixed it by including my PollServlet's output with the "nextPage" parameter explicitly set:
    /poll?action=latest&limit=1&nextPage=polls/show.jsp
    The other way to test is to change your hard-coded
    page to some arbitrary HTML page so you know that at
    least it IS being included.That's something I didn't think about :)
    The other thing to test is to request this page
    (action) directly. So type
    /poll?action=latest&limit=1 into the browser and see
    what you get.Already did that, no problems.
    Sorry I can't be of more help... but I would bet the
    farm that it's not a problem with Tomcat.You're right. I'd really be shocked to have me find 2 bugs in Tomcat within the last to weeks (although the bug was already fixed in a newer version of Tomcat)
    Also... You may want to consider using Struts for your
    MVC if you can.Lots of people keep telling me that, but I'll want to do a general cleanup of the code first - maybe then I'll convert to Struts. After all I'm a freelancer and currently don't have time to learn Struts.
    Thanks for your help,
    phil

  • Nested Classes and Static Methods

    I was perusing the Java Tutorials on Nested Classes and I came across this...
    [http://java.sun.com/docs/books/tutorial/java/javaOO/nested.html|http://java.sun.com/docs/books/tutorial/java/javaOO/nested.html]
    I was reading the documentation and I read a slightly confusing statement. I was hoping some further discussion could clarify the matter. The documentation on "Nested Classes" says (I highlighted the two statements, in bold, I am having trouble piecing together.)
    Static Nested Classes
    As with class methods and variables, a static nested class is associated with its outer class. And like static class methods, a static nested class cannot refer directly to instance variables or methods defined in its enclosing class ? it can use them only through an object reference.
    Note: A static nested class interacts with the instance members of its outer class (and other classes) just like any other top-level class. In effect, a static nested class is behaviorally a top-level class that has been nested in another top-level class for packaging convenience.
    So this means a nested static inner class CANNOT refer to its own instanced variables, like a normal static method, but CAN refer to its outer class instanced variables?

    So this means a nested static inner class CANNOT refer to its own instanced variables, like a normal static method, but CAN refer to its outer class instanced variables?No, it means that a static nested class cannot refer to instance variables of its enclosing class. Example:public class Foo {
        int i;
        static class Bar {
            int j = i; // WRONG! Bar class is static context
    }~

  • How to ensure multiple nested classes static readonly initialization orders

    Hello,
    I am emulating the Java Enumeration in a first class class, with static readonly field initialization.
    In an effort to further categorize some instances, I embed them in nested classes. Something like this.
    class A : Enumeration
    public static class CatB
    public static readonly A FirstInstance = new B();
    public static readonly A SecondInstance = new B();
    public static class CatC
    public static readonly A ThirdInstance = new C();
    public static readonly A FourthInstance = new C();
    class B : A
    class C : A
    So far so good.
    One strain of Enumeration has built-in Ordinals, so I initialize them in the static ctor, or I make an effort to.
    static A()
    var values = GetValues().ToList();
    var ordinal = 0;
    values.ForEach(v => v.Ordinal = ++ordinal);
    Also, in places, so far so good.
    However, in a main method, I am referencing one of the enumerated instances, so calls to my GetValues() is returning nulls for that nested class. The other nested class instances are just fine, they return just fine.
    I could post more, but I think this illustrates the idea.
    I am suspicious that a strange static initialization order is jumbled up, as evidenced by nested static ctor debug statements I put in. I get one print and not the other.
    When I switch up which instance I reference in my main, I get the opposite behavior, more or less confirming my suspicions.
    So... Question is, what's the best way to potentially work around this issue? Hopefully without abandoning the Enumeration concern altogether, but that thought is a possibility as well. Or at least do so differently.
    Thank you...

    It is probably necessary to show GetValues() at least. I am getting the correct nested types, so that much we can at least assume.
    protected static IEnumerable<TDerived> GetValues()
    var declaringTypes = GetDeclaringTypes(typeof (TDerived)).ToArray();
    foreach (var declaringType in declaringTypes.Reverse())
    var fis = declaringType.GetFields(PublicStaticDeclaredOnly);
    var values = fis.Select(fi => fi.GetValue(null)).ToArray();
    foreach (var value in values.OfType<TDerived>())
    yield return value;
    Okay, here a bit of explanation.
    Enumeration is declared generically, with TDerived as the derived type. In this case, A.
    GetDeclaringTypes is operating okay. I get types for A, B, and C.
    The fis to values is breaking down, however. When I reference any of the CatB's, I get nulls for those instances. Conversely, same for CatC's when I reference any of those.

  • Static JSP Include throws Errors

    Hi,
    I am facing a issue in my jsp.
    I have a .html to include in my jsp.
    I have to do a static include. The code snippet is :
    The variable categoryName can have different values like weather,events,pets,etc......
    Is there anything wrong in the statement?
    jsp is giving me error's.
    <%@ include file="/community/photo/modules/carousel/"<%=categoryName%>+".html" %>
    Error is
    File "/community/photo/modules/carousel/<%=categoryName%>.html" not found
    Any help is really appreciated. or please let me know if there is any other way to do it?
    Thanks
    Deepti

    DeeptiChhabra wrote:
    Hi,
    I am facing a issue in my jsp.
    I have a .html to include in my jsp.
    I have to do a static include. The code snippet is :
    The variable categoryName can have different values like weather,events,pets,etc......
    Is there anything wrong in the statement?
    jsp is giving me error's.
    <%@ include file="/community/photo/modules/carousel/"<%=categoryName%>+".html" %>
    Error is
    File "/community/photo/modules/carousel/<%=categoryName%>.html" not found
    Any help is really appreciated. or please let me know if there is any other way to do it?
    Thanks
    DeeptiOk first thing which you need to understand here is static include is also known as compile time include now as we are trying to use a runtime variable their it is so obvious that we cannot the jasper complier cannot recognize it.
    now in order to include the content like this we need to runtime include which <jsp:include/>
    However asper the above senario we cannot directly use it aswell. my advice for you would write a servlet which can forward us to this page something like the one below.
    Sample JSP Code Snippet:
    <%
       String pageUrl = "/community/photo/modules/carousel/"+categoryName+".html";
    %>
    <jsp:include page="/forwardServlet">
        <jsp:param name="page" value="<%=pageUrl%>" />
    </jsp:include>Sample Servlet Code Snipett:
    public class ForwardServlet extends HttpServlet{
        public void processAction(HttpServletRequest req, HttpServletResponse res) throws ServletException,IOException{
           req.getRequestDispatcher(req.getParameter("page")).forward(req,res);
       public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException,IOException{
               processAction(req, res);
       public void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException,IOException{
               processAction(req, res);
    }Hope might that help :)
    REGARDS,
    RaHuL

  • Failure in Precompilation of JSPs  due to include file in WL6.1 SP2

    Hi
              We are getting the following error when we try to do precompilation of JSPs using
              precompile param to true in weblogic.xml
              We are deploying our application as war files.
              eagerly waiting for your help
              sincerely
              Ramesh
              Issue description and StackTrace:
              Issue:
              Precompilation of JSPs fail while using precompile param to true in weblogic.xml and deploy it as War file. It is througing "failure pre-compiling JSP's
              weblogic.utils.ParsingException: nested TokenStreamException: antlr.TokenStreamE
              xception: Could not include index.jsp" exception.
              OS: Windows 2000
              Jdk: Sun Jdk1.3.1
              Weblogic: 6.1 SP2
              ***Stacktrace*************
              <Dec 17, 2002 1:05:51 PM CST> <Error> <HTTP> <[WebAppServletContext(3961036,AdvW
              eb,/AdvWeb)] failure pre-compiling JSP's
              weblogic.utils.ParsingException: nested TokenStreamException: antlr.TokenStreamE
              xception: Could not include index.jsp
              at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java:1025)
              at weblogic.servlet.jsp.JspParser.doit(JspParser.java:80)
              at weblogic.servlet.jsp.JspParser.parse(JspParser.java:183)
              at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:119)
              at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:255
              

    Ramesh,
              We experienced this sympton as well. In our JSPs, we converted
              <%@ include file="xyz.jsp"%> (static include, source time) to
              <jsp:include page="licensedQuote.jsp"/> (dynamic include, run time)
              and the problem went away.
              We still use static includes at the very start of the JSPs. It seems the problem only occurs when the static include is inside of a tag whose body does JSP evaluation.
              -Charlie
              "Ramesh Danala" <[email protected]> wrote in message news:[email protected]...
              > Hi
              > We are getting the following error when we try to do precompilation of JSPs using
              > precompile param to true in weblogic.xml
              > We are deploying our application as war files.
              > eagerly waiting for your help
              > sincerely
              > Ramesh
              >
              > Issue description and StackTrace:
              > Issue:
              >
              > Precompilation of JSPs fail while using precompile param to true in weblogic.xml and deploy it as War file. It is througing "failure pre-compiling JSP's
              > weblogic.utils.ParsingException: nested TokenStreamException: antlr.TokenStreamE
              > xception: Could not include index.jsp" exception.
              >
              > OS: Windows 2000
              > Jdk: Sun Jdk1.3.1
              > Weblogic: 6.1 SP2
              >
              > ***Stacktrace*************
              >
              > <Dec 17, 2002 1:05:51 PM CST> <Error> <HTTP> <[WebAppServletContext(3961036,AdvW
              > eb,/AdvWeb)] failure pre-compiling JSP's
              > weblogic.utils.ParsingException: nested TokenStreamException: antlr.TokenStreamE
              > xception: Could not include index.jsp
              > at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java:1025)
              > at weblogic.servlet.jsp.JspParser.doit(JspParser.java:80)
              > at weblogic.servlet.jsp.JspParser.parse(JspParser.java:183)
              > at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:119)
              > at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:255
              > )
              

  • Questions concerning Nested Classes

    Hi!
    Just read some articles about nested classes (include the ones from the Java Tutorial and the Effective Java chapter), and while most of it is perfectly clear, three questions remain:
    1.) When I declare a member class, how should I declare the access specifiers (private, protected etc.) for the member class's attributes and methods? If I declare a member class as private, anything but private for the attributes and methods wouldn't make sense, would it?
    2.) The Java Tutorial says:
    Also, because an inner class is associated with an instance, it cannot define any static members itself.While this is true for static methods, it seems to be possible to declare static variables inside inner classes. This is confusing me... does it actually make sense to declare static variables inside inner classes (or member classes in general)? Or should the be placed in the declaring class?
    3.) Another confusing quote from the Java Tutorial:
    Static nested classes do not have access to other members of the enclosing class.This is true for instance variables and methods but not for static variables, which are also members of the enclosing class, aren't they?
    Thanks in advance,
    OIiver

    Trollhorn wrote:
    Hi!
    Just read some articles about nested classes (include the ones from the Java Tutorial and the Effective Java chapter), and while most of it is perfectly clear, three questions remain:
    1.) When I declare a member class, how should I declare the access specifiers (private, protected etc.) for the member class's attributes and methods? If I declare a member class as private, anything but private for the attributes and methods wouldn't make sense, would it?
        private static class MyInner implements Runnable
            @Override public void run() // Must be public!
    2.) The Java Tutorial says:
    Also, because an inner class is associated with an instance, it cannot define any static members itself.While this is true for static methods, it seems to be possible to declare static variables inside inner classes. This is confusing me... does it actually make sense to declare static variables inside inner classes (or member classes in general)? Or should the be placed in the declaring class?Wrong. It can define static final member variables and I see no reason to move them to the outer class, if they are used only by the inner class.
    3.) Another confusing quote from the Java Tutorial:
    Static nested classes do not have access to other members of the enclosing class.This is true for instance variables and methods but not for static variables, which are also members of the enclosing class, aren't they?I agree with you here.
    Edited by: baftos on Jun 6, 2009 9:18 AM

  • What is the name of a nested parameterized type?

    The draft spec gives an example of a nested parameterized class Zipper<B> inside a parameterized class Seq<A>. In the sample code the nested type is refered to as Seq<String>.Zipper<Number>. Hence I concluded that the following should work either:
    package generics;
    public class RawTypes {
    private static class Outer<T> {
    public class NonstaticInner<T> {}
    public static void main(String[] args) {
    Outer[] x = new Outer<String>();
    Outer<String>.NonstaticInner<String> var = x.new NonstaticInner<String>();
    Instead the compiler complains:
    incompatible types
    found : generics.RawTypes.Outer.NonstaticInner<java.lang.String>
    required: generics.RawTypes.Outer<java.lang.String>.NonstaticInner<java.lang.String>
              Outer<String>.NonstaticInner<String> var = x.new NonstaticInner<String>();
    When I use the raw outer type the compiler is happy. Like in:
    Outer.NonstaticInner<String> var = x.new NonstaticInner<String>();
    But that is not what I want say.
    Why does this fail to compile? Because the outer class is a nested static class instead of a top-level class? That should not make a difference, I would think. What am I missing?
    Angelika

    I am quite surprised there is no reaction at your query.
    It made me so interested in the spec I downloaded it.
    At page 3 I read that no static meber could be parametrized.
    I think this makes the behaviour of the compiler correct.No, I don't think so. The spec says:
    "The scope of a type parameter is all of the declared class, except any static members or initializers, but including the type parameter section itself."
    The spec does not say that static members could not be parameterized. It just says that the type parameter of a generic class cannot be used in any static members of that generic class, be it a static method or a static initializer or the declaration of a static field or a nested static class.
    Stuff like this would be prohibited under the quoted wording:
    class X<T> {
    static T field;
    static T getField() { ... }
    static { T tmp; ... }
    static class Y { T t; }
    What I tried is not prohibited by anything in the spec, I believe. I simply defined a generic type (Outer) inside a nongeneric type (RawTypes):
    public class RawTypes {
    private static class Outer<T> {
    public class NonstaticInner<T> {}
    The weird thing is that the nested generic type RawTypes.Outer<T> behaves differently from a top-level generic type. Compare the above to the following:
    public class Outer<T> {
    public class NonstaticInner<T> {}
    According to the spec I would refer to the class nested into class Outer<T> as Outer<String>.NonstaticInner<Integer>, for instance. That's basically the example on page 4 of the spec, where they have a Seq<String>.Zipper<Number>.
    Why is the behavior entirely different when I want to refer to a class nested into RawTYpes.Outer<T>? Why can't I say RawTypes.Outer<String>.NonstaticInner<Integer>? Why do I have to name it RawTypes.Outer.NonstaticInner<Integer>? That does not make sense to me.
    A nested static type is like a top-level type, except that is has a name prefix. Why would that change with the addition of generics to the language?
    Outer.NonstaticInner<String> var = x.new
    NonstaticInner<String>();
    But that is not what I want say.What is it then that you want to say?
    Do you want to confine the valid values of var to outer classes parametrized with the
    String type? This will lead to problems (I think even with instances) as there is
    no specific type for a parametrized class.What error would you expect when a variable
    is passed having the correct "inner parameter type" but not the requested outer parameter type?I would expect the same error message that I would get when I assigned a Seq<String>.Zipper<Number> to a Seq<Integer>.Zipper<Number>. No?
    Maybe it's just a bug in the prototype compiler, but who can tell if the spec does not say much about nested types what their names would be.
    Angelika

  • How to include the page dynamically in JSF

    Hi all
    Below is static include
    <jsp:include page="../inc/sideMenu.inc"/>
    How to include the file dynamically
    Thanks

    Hi,
    Though I have not tried it I think making use of a variable to hold the page name to be included should work. Could you try this and see if it works?
    Cheers
    Giri :-)

Maybe you are looking for