"include directive or jsp:include "

Hi,
Which amongst <%@ include file="header.jsp" %> and
<jsp:include page="header.jsp"/>to be used, when performance is taken into account.

Code copy from serverside.com
Is it the same as --> jsp:include and %@ include directive.
Actually, <jsp:include> vs. <%@ include %> is a different story.
<%@ include %> is a "compile-time" include. The included file is inserted into the JSP when the JSP compiles.
<jsp:include> is a "run-time" include. If JSP-1 includes JSP-2, JSP-2 is invoked when JSP-1 executes, and the output of JSP-2 is inserted into the output stream of JSP-1.
The run-time include runs a bit slowly, but can save a lot of system memory, so in general, the run-time include is preferable. Only use the compile-time include if the include code must be in the same page.
For example, if you want to use an include that defines a bunch of tag libraries with the taglib directive, it will have to be a compile-time include. If you just want to insert a standard header and footer in your page, a run-time include will be more effecient.
I hope its enough for you to get an clear cut idea,

Similar Messages

  • JSP:Include directive - can I access data?

    Hi,
    I am using the 'include' directive (either jsp:include method or <%@ include.... /> ) to include another jsp page.
    I want the included file to access variables that have been set up in the main page (the one with the include directive in it). I've tried several things, including setting up a Bean class, but nothing seems to work
    Is this possible? I really appreciate any help with this.
    Thanks.

    You cannot use <%@ include ..%> because that is resolved at translation time. <jsp:include /> is resolved dynamically and should give you what you need. In the main page, store references to the bean or other data as request attributes and then retrieve them in the included page.

  • How to use bean:write inside jsp:include ?

    I got a problem about JSP's syntax. The following is my code:
    <%@ include file="<bean:write name="HelloForm" property="target" />"%>
    The double quotes inside bean:write is my problem. Could you please teach me how to use bean:write within JSP's include? Thank you!

    http://java.sun.com/products/jsp/syntax/1.2/syntaxref12.html
    Include Directive vs <jsp:include>
    The include directive <%@include %> is done at page translation/compile time.
    It effectively pastes in a static file, and then compiles the JSP as if it was all one file.
    As such, you cannot provide a runtime expression to it.
    To do runtime inclusion, you need to use the <jsp:include> tag which does except runtime parameters.
    <%String test = request.getParameter("pageInfo");%>
    <%String link = test + ".jsp"; %>
    <jsp:include page="<%= link %>" %>Unfortunately you can't use the tag with a bean:write tag as well, you can only use runtime expressions, not tag. So you have to do the include with
    <jsp:include page="<%= HelloForm.getTarget() %>" />
    Cheers,
    evnafets

  • Jsp:Include VS @ include

    Hi,
    Is there a big diffrence between using <%@ include file="url" %> and <jsp:include page="relative URL" flush="true"/>?
    I know that the first is put in the servlet at the translation and the second is included when the page is requested. I use this for my web pages header which is the same for every page. Which one would be the best?
    thanks,
    Stephane

    Hi,
    Is there a big diffrence between using <%@ include
    file="url" %> and <jsp:include page="relative URL"
    flush="true"/>?This question has been answered many times :-)
    http://www.google.com/search?q=difference+between+include+directive+and+jsp+include
    >
    I know that the first is put in the servlet at the
    translation Here's the full official description on include directive:
    http://java.sun.com/products/jsp/syntax/2.0/syntaxref209.html#1003408
    and the second is included when the page
    is requested. Here's the description on jsp:include
    http://java.sun.com/products/jsp/syntax/2.0/syntaxref2020.html#8828
    I use this for my web pages header
    which is the same for every page. Which one would be
    the best?Think about the future changes, in the future will you ever add dynamic content to the header? Then go with jsp:include or if you are into JSTL use c:import
    If you are very sure that you don't need to add dynamic code to the header then go with the include directive. But be sure of this, otherwise you;ll have to change all JSP headers -- probably with search and replace --- but still it will be a PITA.
    Another option is you could set coda and prelude in web.xml , that will auto include static content in all JSP pages --- with coda and prelude specified in web.xml you don't have to include files in the JSP pages themselves. But the disadvantage is that the header and footer will appear before the opening html and after the closing html tag.
    >
    thanks,
    Stephane

  • Jsp:include directives compilation errors

    hi,
    we have lot of <%@ include file="" %> files in out jsp page. when we trying to change this to <jsp:include page="" %>. we r getting lot of comilation errors
    The file size is increasing more than 64mb.
    Can u tell how to contain them within 64mb .
    thank you.

    The stack trace isn't very indicative of whatever problem you may be having.
    However, there is a major difference between <%@ include %> and <jsp:include />. The include directive <%@ include %> slams the content of the included resource into your JSP at compilation time, it is "static". No individual evaluation of the included resource is done, it becomes a part of the JSP that included it.
    <jsp:include /> is a dynamic include--it is evaluated at run-time. The content of the included resource is accessed and written to the output stream with the JSP is accessed. If the included content is a JSP, it is compiled and accessed as a separate servlet.
    So, it looks like your included JSPs do not qualify as valid, standalone JSPs. Typically, this is because of some dependency on variables or beans declared in the including JSP.
    Good luck.
    -brian

  • What is the difference between jsp :include and server side include

    what is the difference between jsp :include and server side include(request dispatcher include method)????
    i understand that both request dispatcher include method and jsp:include take dynamic data,so when would one use request dispatcher include and when jsp:include.
    Is the usage interchangeable?i believe jsp include is used only for jsp/html but include directive can be used to include servlets ,jsp and html....correct me if i m wrong and
    do suggest if u hav ny other diff in this context...

    The difference really is: in what format do you want your inclusions? If your environment has many Java developers and only a few designers that focus mainly on, say, Flash, that might push you more towards the server-side include() directive. Or, if you have a large set of pages that receive dynamic content that is displayed in a consistent fashion (such as a workflow header area on a page).
    If, on the other hand, you have more web designers, there may be a greater desire to deal in markup rather than Java code. Java developers themselves might prefer to view markup (JSP) that more resembles the eventual output than something occuring in Java code.
    Finally, there are considerations of tiering. While it is totally possible to (and I have previously) implement 'view classes' that render markup or generate layout templates, JSP's offer, IMO, a subtle, psychological advantage. By forcing a developer to work in a different format, markup versus Java source, the separation on view from controller and model becomes a bit easier. It is still possible to make mistakes, but if a developer at some point notices, "Wait, I'm in a JSP, should I be importing a java.sql class?", then the choice to use JSP includes has paid off in spades.
    - Saish

  • A variable in the include directive

    Hello,
    I'm trying to store a part of the name of the file to include in a variable like this:
    <%@ include file=templatepath + "settings.jsp" %>
    but it doesn't work. Can someone tell me if there is a working way to do something similar
    Thanks,
    Store

    You can use the jsp:include tag to specify the page to include dynamically.
    <jsp:include page="templatepath + "settings.jsp" flush="true"/>You can't use the include directive to dynamically specify a page since the page is included at compile time, rather than run time.

  • JSP includes

    Hello. I have some jsp pages that include other jsp pages using the @include directive. The included files reference variables in the parent jsp and I am getting compiler errors on the include files. What is the best practice here? How can I get a clean compile?
    Thanks!

    user755269 wrote:
    Thanks Joachim. I am in between a rock and a hard place. I am porting a legacy web app to weblogic 10.3. It is a mandate that we precompile our JSPs. Is there a slick way to exclude the include files or do I have to find each one manually and manually exclude?Ideally you'd have all your included-JSP files in a directory that hints at that use, but given that you're working with a legacy web app, I doubt that this is the case.
    I don't know of any automatic way to exclude them except some grep/sed/awk magic to find the offending JSP files.

  • Why this does not works??? (I use jsp: include. to contain two jsp files)

    I have a main.jsp, and in this main.jsp, I have two part, leftButton.jsp and view.jsp, I want to include the leftButton.jsp and view.jsp to main.jsp.
    The code of main.jsp is like follows:
    <%@ page language="java" contentType="text/html" %>
    <html>
    <head>
    <title>JSP include element test</title>
    </head>
    <body>
    <table>
    <tr>
    <td><jsp: include page="leftButton.jsp" flush="true"></jsp: include></td>
                             <td>     <jsp: include page="view.jsp" flush="true"></jsp: include></td>
                        </tr>
         </table>
    </body>
    </html>
    Why the include does not works? by the way, I embeded a flash.swf file in view.jsp.

    Hi Mellon,
    You might be better off using a JSPF segment for leftButton.jsp & view.jsp and the <%@ include file="relativeURL" %>.
    Be careful that the included file does not contain <html>, </html>, <body>, or </body> tags. Because the entire content of the included file is added to the including JSP page, these tags would conflict with the same tags in the including JSP page, causing an error.
    Note: It is conventional to put JSP segements under the WEB-INF/jspf/ folder so the file cannot be accessed directly by a URL
    Note: JSPF files end with .jspf, so your files would be leftButton.jspf and view.jspf.

  • Jsp:include... tags not being parsed

    We currently have a customer using one of our products with WebLogic 8.1. This product is deployed via a war file and when accessing the application, nothing included via a jsp:include shows up. When viewing the source output via a browser the <jsp:include... tags exist in the actual HTML. It is aparent they have never been parsed. Other jsp tags appear to be working though.
              The application works fine on Oracle 9iAS, Tomcat 4.x and 5.x and I believe there are several users with IBM Web Sphere using it with no problems. This is the first customer using this particular server and the first time with this behavior. Any ideas as to what the problem may be? I have downloaded and installed WebLogic 8.1 and can reproduce the error at will.

    Argg. Thats an ugly bug.. It has to do with which attribute of the include
              directive appears first.
              So the following doesnt seem to work
              <jsp:include flush="true" page="/lib/axscripts.jsp" />
              but if you change the 'page' atribute to appear first, it does.
              <jsp:include page="/lib/axscripts.jsp" flush="true"/>
              That said please contact [email protected] and request a patch for CR189880
              --Nagesh
              "Andrw Hale" <[email protected]> wrote in message
              news:9704331.1090501692204.JavaMail.root@jserv5...
              > Well, I have my main page that includes a header using the <@% include
              file=... %>. This gets included fine. The file it includes I have reduced
              to:
              > <jsp:useBean id="webBean" class="webBean" scope="session"/>
              > <jsp:include flush="true" page="/lib/axscripts.jsp" />
              > <jsp:include flush="true" page="/menus/document-menu.jsp"/>
              > <jsp:include flush="true" page="/menus/device-menu.jsp"/>
              > <jsp:include flush="true" page="/menus/admin-menu.jsp"/>
              > <jsp:include flush="true" page="/menus/help-menu.jsp"/>
              > <jsp:include flush="true" page="/menus/logout-menu.jsp"/>
              >           >
              > The jsp:useBean tag is parsed and used correctly while all of the
              jsp:includes remain in the body of the HTML.
              

  • What's the difference between include directive & include action tag?

    I no that the directive is used for including static content,
    while the action is also used for dynamic content.
    So the first one will include the content into the JSP only at compilation time. The second one will include the content every time you access the JSP.
    *<html>*
    *<body>*
    *<h1> Include Action test PAge</h1>*
    *<h2> Using the include directive</h2>*
    *<%@ include file="included2.html"%>*
    *<%@ include file="included2.jsp"%>*
    *<h2> Using the include action</h2>*
    *<jsp:include page="included2.html" flush="true"/>*
    *<jsp:include page="included2.jsp" flush="true"/>*
    *</body>*
    *</html>*    I tried withis code. But its giving the same result.I didn't modified the source. I modified in the included file.As I request for the JSP page I got the same result for both.
    so i just want to know that is thier any way or example by which i can see the difference between these two clearly..
    please help me out.
    thnx.

    As our almighty Google says: @include is compiletime and jsp:include is runtime.
    Install Google at your machine. It's really great. It has answers on almost all questions.

  • Try again: jsp:include fails with NPE in ValueBindingImpl

    JSF 1.1, RichFaces 3.1.3, WebLogic 9.2.2.
    I asked about this a couple of weeks ago, but I didn't get any useful responses.
    I have a simple "toy" application using a tabpanel that works fine right now. There is one tab that I will want to repeat several times, with only variations in the data in the fields (and the tab title). So, I copied the current template of that tab into an include file and I'm trying to include it with "jsp:include" from the original page, with a parameter. I've read all the suggestions about how to get jsp:include working with JSF, but it still doesn't work.
    When I display the page, I just get this:
    java.lang.NullPointerException
         at com.sun.faces.el.ValueBindingImpl.(ValueBindingImpl.java:98)
         at com.sun.faces.application.ApplicationImpl.createValueBinding(ApplicationImpl.java:292)
         at javax.faces.webapp.UIComponentTag.setProperties(UIComponentTag.java:890)
         at org.ajax4jsf.webapp.taglib.UIComponentTagBase.setProperties(UIComponentTagBase.java:80)
         at org.ajax4jsf.webapp.taglib.HtmlComponentTagBase.setProperties(HtmlComponentTagBase.java:78)
         at org.richfaces.taglib.TabTag.setProperties(TabTag.java:568)
         at javax.faces.webapp.UIComponentTag.createComponent(UIComponentTag.java:1017)
         at javax.faces.webapp.UIComponentTag.createChild(UIComponentTag.java:1036)
         at javax.faces.webapp.UIComponentTag.findComponent(UIComponentTag.java:749)
         at javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:429)
         at jsp_servlet.__main._jsp__tag42(__main.java:1603)
    ...more...The JSP code for the tab looks like this:
    <rich:tab id="property0"
                name="#{ratingRequest.propertyList[0].propertyID}"
                label="Property: #{ratingRequest.propertyList[0].propertyID}"
                rendered="#{ratingRequest.propertyList[0].used}">
         <f:subview id="propertysubview0">
              <jsp:include page="/faces/propertyTab.jsp">
                   <jsp:param name="propertyIndex" value="0" />
              </jsp:include>
         </f:subview>
    </rich:tab>The file this tries to include is this:
    <%@ taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
    <%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <f:subview id="includedPropertyPage">
         <h:panelGrid id="propertyPanelGrid" columns="3">
              <h:outputText id="propertyIDOut" value="Property ID"/>
              <h:inputText id="propertyIDIn"
                              value="#{ratingRequest.propertyList[0].propertyID}">
                   <a4j:support id="propertyIDInSupport" event="onchange" reRender="propertyTable"/>
              </h:inputText>
              <rich:message for="propertyIDIn" showDetail="true"/>
              <h:outputText id="valueOut" value="Value"/>
              <h:inputText id="valueIn"
                              value="#{ratingRequest.propertyList[0].value}">
                   <a4j:support id="valueInSupport" event="onchange" reRender="propertyTable"/>
              </h:inputText>
              <rich:message for="valueIn" showDetail="true"/>
         </h:panelGrid>
    </f:subview>For more background, here's the code in the tab before I changed it to use jsp:include, and remember that this works:
    <rich:tab id="property0"
                name="#{ratingRequest.propertyList[0].propertyID}"
                label="Property: #{ratingRequest.propertyList[0].propertyID}"
                rendered="#{ratingRequest.propertyList[0].used}">
         <h:panelGrid id="property0PanelGrid" columns="3">
              <h:outputText id="propertyIDOut" value="Property ID"/>
              <h:inputText id="propertyIDIn" value="#{ratingRequest.propertyList[0].propertyID}">
                   <a4j:support id="propertyIDInSupport" event="onchange" reRender="propertyTable"/>
              </h:inputText>
              <rich:message for="propertyIDIn" showDetail="true"/>
              <h:outputText id="valueOut" value="Value"/>
              <h:inputText id="valueIn" value="#{ratingRequest.propertyList[0].value}">
                   <a4j:support id="valueInSupport" event="onchange" reRender="propertyTable"/>
              </h:inputText>
              <rich:message for="valueIn" showDetail="true"/>
         </h:panelGrid>
    </rich:tab>I don't have the source for the JSF implementation, but when I disassemble the class with the NPE, I see that the exception occurs in the ValueBindingImpl constructor that takes a Application object, and the NPE might occur because either the FacesContext or ExpressionInfoInstancePool is null (I think the former is the most likely, but I don't know why).

    Done. The results are ironically very similar to what happened with the BEA implementation, but I have a feeling this is something else, because it's failing not on the included page, but on a value binding on the main page. Perhaps I'm missing some property settings in my web.xml while using the RI.
    The entire stack trace is pretty large. I would have only included the excerpt from the root cause, but the JSF RI stack trace seems to have some interesting info up to that point. You'll see from the code at the top of the stack that either the FacesContext or the Application is null.
    org.apache.jasper.JasperException: Exception in JSP: /index.jsp:2
    1: <% session.invalidate(); %>
    2: <jsp:forward page="/faces/main.jsp"/>
    Stacktrace:
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    root cause
    org.apache.jasper.JasperException: Exception in JSP: /main.jsp:104
    101:                <rich:tab id="ratings" name="ratings" label="Ratings">
    102:                     <h:panelGrid id="ratingsPanelGrid" columns="3">
    103:                          <h:outputText id="field3Out" value="Field3"/>
    104:                          <h:inputText id="field3In" value="#{ratingRequest.field3}"/>
    105:                          <rich:message for="field3In" showDetail="true" passedLabel=" "/>
    106:                          <a4j:commandButton id="processRequest" value="Submit Request"
    107:                                             action="#{ratingRequest.processRequest}"
    Stacktrace:
         org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:355)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:346)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:152)
         org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
         org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:214)
         org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
         org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
         org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:686)
         org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:656)
         org.apache.jsp.index_jsp._jspService(index_jsp.java:45)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    root cause
    javax.servlet.ServletException: javax.servlet.jsp.JspException: null
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:837)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:774)
         org.apache.jsp.main_jsp._jspService(main_jsp.java:134)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:346)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:152)
         org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
         org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:214)
         org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
         org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
         org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:686)
         org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:656)
         org.apache.jsp.index_jsp._jspService(index_jsp.java:45)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    root cause
    java.lang.NullPointerException
         com.sun.faces.util.Util.getValueBinding(Util.java:987)
         com.sun.faces.taglib.html_basic.InputTextTag.setProperties(InputTextTag.java:265)
         javax.faces.webapp.UIComponentTag.createComponent(UIComponentTag.java:1027)
         javax.faces.webapp.UIComponentTag.createChild(UIComponentTag.java:1046)
         javax.faces.webapp.UIComponentTag.findComponent(UIComponentTag.java:761)
         javax.faces.webapp.UIComponentTag.doStartTag(UIComponentTag.java:451)
         com.sun.faces.taglib.html_basic.InputTextTag.doStartTag(InputTextTag.java:506)
         org.apache.jsp.main_jsp._jspx_meth_h_005finputText_005f3(main_jsp.java:1375)
         org.apache.jsp.main_jsp._jspx_meth_h_005fpanelGrid_005f3(main_jsp.java:1309)
         org.apache.jsp.main_jsp._jspx_meth_rich_005ftab_005f3(main_jsp.java:1278)
         org.apache.jsp.main_jsp._jspx_meth_rich_005ftabPanel_005f0(main_jsp.java:950)
         org.apache.jsp.main_jsp._jspx_meth_a4j_005fform_005f0(main_jsp.java:208)
         org.apache.jsp.main_jsp._jspx_meth_f_005fview_005f0(main_jsp.java:162)
         org.apache.jsp.main_jsp._jspService(main_jsp.java:124)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:346)
         com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:152)
         org.ajax4jsf.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:108)
         org.ajax4jsf.application.AjaxViewHandler.renderView(AjaxViewHandler.java:216)
         com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:107)
         com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
         com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:137)
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:214)
         org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:141)
         org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:281)
         org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:686)
         org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:656)
         org.apache.jsp.index_jsp._jspService(index_jsp.java:45)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

  • Servlet not found (jsp include)

    Trying to include a servlet from a jsp. Put the servlet under the default_web_app\web-inf\classes\<package dir structure>\<servlet class name>, and included it with "<jsp:include page="servlet.package.hierarchy.ServletName" flush="true"/>
    That I could think of. OC4J is serving jsps fine through Apache, but OC4J can't find the servlet. Ideas?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Robert Cote ([email protected]):
    Added "/servlet/" to the start of the include name -- that fixed it. Now, however, I can't seem to get oc4j to find my beans (located in the same hierarchy). Using <jsp:usebean...> syntax, the usebean statment seems to get processed, but accessing the bean through it's id yields:
    Syntax error in source
    /mapsis/contacts4_mockup.jsp.java:30: Undefined variable or class name: <bean id>
    I'll try messing w/ the syntax, but thanks in advance for any ideas.<HR></BLOCKQUOTE>
    Is your bean part of a package ?
    Here is an example
    <%@ page import="java.sql.* , oracle.jsp.dbutil.*" %>
    <jsp:useBean id="cbean" class="oracle.jsp.dbutil.ConnBean" scope="session">
    <jsp:setProperty name="cbean" property="User" value="scott"/>
    <jsp:setProperty name="cbean" property="Password" value="tiger"/>
    <jsp:setProperty name="cbean" property="URL" value="jdbc:oracle:thin:@dlsun:1521:P817"/>
    <jsp:setProperty name="cbean" property="PreFetch" value="5"/>
    <jsp:setProperty name="cbean" property="StmtCacheSize" value="2"/>
    </jsp:useBean>
    Hope this helps.. sorry for the delay in replying..

  • Problems with Tomcat 4.0 and jdk 1.3.1 (jsp:include) Help Gurus...

    Im running examples of the include:
    <jsp:include page="xxx.jsp" flush="true">
    and received error:
    org.apache.jasper.JasperException: No se puede compilar la clase para JSP
    An error occurred at line: 17 in the jsp file: /jsp/include/include.jsp
    Generated servlet error:
    /Programas/Tomcat4/work/localhost/examples/jsp/include/include$jsp.java:79: Method include(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String, javax.servlet.jsp.JspWriter, boolean) not found in class org.apache.jasper.runtime.JspRuntimeLibrary.
    JspRuntimeLibrary.include(request, response, "/jsp/include/foo.html" + jspxqStr, out, true);
    ^
    Please Help me Im running this equal with:
    <%@ include file="xxx.jsp" %>
    and runnig fine....

    The two means of including files are different in their approach.
    Using <jsp:include .../> compilation of the included jsp is done at run -time not during compilation.
    Using <%@ include .../> compiles at compile time.
    Looking at the error it seems that the method JspRuntimeLibrary.include is not being found which suggests that you may have a classpath problem. Check that there is not a servlet.jar in the classpath that is from a earlier spec than the one provided with Tomcat.
    Dave

  • SunOne Websever 5 sp 5 dynamic jsp:include

    Hi,
    I'm just trying to migrate from another webserver to SunOne.
    I have a number of pages that rely on dynamic JSP includes.
    IE
    <jsp:include page="<%= someString %>" flush="true">
    All pages which use this fail to compile and I get a server error (no errors show up in the logs).
    While using a static value (the same value) works fine.
    <jsp:include page="somevalue" flush="true">
    Has anyone has this problem ? has this functionality been discontinued ?
    regs
    Michael

    Hi,
    That page refers to the JSP Spec. version 1.1 which is used in WebServer 6.0.
    It is documented in the Release Notes for WebServer 6.0 that jsp:include throws an exception when used with the POST method. Is this what you are experiencing?
    http://docs.sun.com/source/816-5695-10/rn60sp2.html
    Problem 556917. JSP: <jsp:inlcude page="*.html" flush="true" /> Throws Exception If Using With POST Method.
    Which version of webserver are you using?? Your subject line refers to "Websever 5 sp 5" but do you mean Webserver 6.0sp5 or WebServer 6.1sp5??
    WebServer 6.1sp5 uses JSP Spec. version 1.2, so the page that you were referring to is not relevant if you are using this version of WebServer.
    Please note that JSP Specs can be downloaded from:
    http://java.sun.com/products/jsp/reference/api/index.html
    Let us know exactly which version of WebServer you are using :)

Maybe you are looking for

  • How do I fix?  Your photo library is either in use by another application or has become unreadable

    My computer shut down yesterday because I ran out of power and didn't have my  power cord.  I was in Iphoto at the time.  I'm assuming this has something to do with why I got this message when I turned on the computer this morning and tried to open i

  • Looking for sample code to create my own pub/sub!

    I am a new bee in JMS. So I would really appreciate if some one could give me some hint to start up with my school project. I am looking for a sample Java code that will: For the Publisher: 1. Connect to a broker [create it, if it does not exist] 2.

  • Two credit cards

    Does the on-line Apple Store allow two credit cards to be stored?  I would like to store a business and a personal credit card so I can charge purchases to the appropriate card.

  • Oracle.classloader.util.AnnotatedNoClassDefFoundError

    I am trying to access my webservice from my application module and when i run it standalone it is running fine, but when i create data control out of it and use it from my jsp page it is throwing me this error. Any suggestion how to get rid of this.

  • Can't Open Logic Pro

    I am running Logic Pro with 10.6, and after downloading firmware for  Digitech piece, I was directed to a security page and promted to download this code resources security patch.Now I cannot open Logic Pro I was promted to download this code resourc