JSP's include embedded in a String ???

Hi All,
I'am building an HTML string, which includes a JSP file as,
"<%@ include file=\"../jsp/SST_Links.jsp\" %>"
When the JSP is converted to a servlet the above line becomes,
"<%@ include file=\"../jsp/SST_Links.jsp\"
which means, the rest of the string is cutoff.obviously,
'%>' is interpreted as probably the end of the string.
It also throws up an error,
org.apache.jasper.JasperException: Unable to compile class for
JSPC:\tomcat\work\localhost_8080%
2Fsst\_0002fjsp_0002fSST_0005fPDFReport_0002ejspSST_0005fPDFReport_jsp_13.java:137: String not terminated at end of line.
"<%@ include file=\"../jsp/SST_Links.jsp\"
is there any syntax error ???
please help !
thanks,
nazhat
p.s.
have tried unsuccessfully,
"<%@ include file=\"../jsp/SST_Links.jsp\" >"
"<%@ include file=\"../jsp/SST_Links.jsp\" \%>"
"<%@ include file=\"../jsp/SST_Links.jsp\" %%>"

Hi! I have all my files in the same folder so I am not sure how to give the actual path but this is what I am doing and works just fine.:
<%@include file="header.html"%>
Make sure there are no double quotes around the <% %>.
hope this helps.

Similar Messages

  • Jsp:forward param not getting included in my query string

    Hi,
    On a particular JSP page, mine.jsp, I am forwarding to a servlet ...
    <jsp:useBean id="HotelResortDBBean" class="com.lvcva.database.HotelResortDBBean" scope="request" />
    <jsp:forward page="/meetings/meeting-venues/results">
         <jsp:param name="sqftRange" value="${empty param.meetingsqft ? -1 : param.meetingsqft}" />
    </jsp:forward>This forwards to a servlet, when I query "request.getQueryString", it comes up null. However, when I enter the URL, "mine.jsp?sqftRange=-1", the query string returns "sqftRange=-1" as expected. Can someone tell me what I'm doing wrong in the above that is causing the jsp:param to not be added to the query string?
    - Dave

    a forward does not create a new request, and thus the query string is not altered. If you want the query string to change, use a redirect in stead.
    note: even though the query string does not change, the new parameter IS added to the HttpServletRequest object, so you can still fetch the new parameter from it even with the forward.

  • Unable to run jsp as include using jsp:include tag

    I am trying to run the basic jsp:include sample provided by Oracle in OC4J 10g. When I run the code, It seems like include file is treated as text/html and not run at all. Can somebody help me in figuring out what I am missing here..
    Here is the code for main.jsp
    <jsp:include page="content.jsp">
    <jsp:param name="a" value="1"/>
    <jsp:param name="b" value="2"/>
    <jsp:param name="c" value="3"/>
    </jsp:include>
    Here is the code for content.jsp
    <p> Included Content </p>
    <p> Parameters - ${param.a}, ${param.b}, ${param.c} </p>
    When I run this code in JDeveloper10g using the embedded OC4J as well as Application Server 10g, I get the following output.
    Included Content
    Parameters - ${param.a}, ${param.b}, ${param.c}
    Note that the parameter values are not substituted properly.
    Thanks in advance
    Niraj

    javax.servlet.ServletException: com/sun/tools/javac/Main (Unsupported major.minor version 49.0)
    This is your problem either your tomcat or eclipse is pointing to a wrong jre
    here the problem is you are trying to run a code that was compiled using j2sdk1.5 in j2sdk1.4

  • Render a JSP page into HTML in a String

    I am using a mail template system that gets templates as JSP pages placed in /WEB-INF/mailtemplates/
    I want to internally parse JSPs as if they were real JSPs in my tomcat but:
    - Get get them using getResourceAsStream (or any other way)
    - make JSP engine translate JSP into HTML into a String object.
    - Send a mail with this HTML. (this part is already finished)
    What I need is a method with the following proposed signature:
    public String getMailTemplate(java.io.InputStream jspPageStream, javax.servlet.HttpServletRequest request) {}
    The method must get the JSP from the stream, render it into the HTML and return it as a String.
    Of course, it must render the JSP as a real JSP, using the apserver JSP engine. It must so replace any tags and EL objects:
    ${session.user.name} -> The name of the user
    <c:forEach, ...
    etc. etc. etc.
    �Any ideas / directions on how to achieve this?
    thanks,
    Ignacio

    Ok, just tried it out myself, and I'm getting the same result you are.
    Nothing makes it out to the RedirectingServletResponse.
    It appears to be buffering it somewhere in the included page.
    If you put a command to flush the buffer on the jsp page being included: <% out.flush; %> then it works.
    So why doesn't it work normally? Why doesn't the call to requestDispatcher.include (or forward) flush/commit its response?
    I will admit to being stuck on this one. I'm figuring its something in the internal workings of Tomcat/JSP to do with when a page is flushed or not, but I can't thing of anything right now.
    Here is the test I put together to try this out (along with a few corrections to my previous code). I will admit to being stumped :-)
    The response wrapper:
    package web;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.io.PrintWriter;
    import javax.servlet.ServletOutputStream;
    import javax.servlet.ServletResponse;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpServletResponseWrapper;
    public class RedirectingServletResponse extends HttpServletResponseWrapper {
        RedirectServletStream out;
         * @param arg0
        public RedirectingServletResponse(HttpServletResponse response, OutputStream out) {
            super(response);
            this.out = new RedirectServletStream(out);
        /* (non-Javadoc)
         * @see javax.servlet.ServletResponse#flushBuffer()
        public void flushBuffer() throws IOException {
             out.flush();       
        /* (non-Javadoc)
         * @see javax.servlet.ServletResponse#getOutputStream()
        public ServletOutputStream getOutputStream() throws IOException {
            return out;
        /* (non-Javadoc)
         * @see javax.servlet.ServletResponse#getWriter()
        public PrintWriter getWriter() throws IOException {
            return new PrintWriter(out);
        /* (non-Javadoc)
          * @see javax.servlet.ServletResponseWrapper#getResponse()
         public ServletResponse getResponse() {
              return super.getResponse();
         /* (non-Javadoc)
          * @see javax.servlet.ServletResponseWrapper#setResponse(javax.servlet.ServletResponse)
         public void setResponse(ServletResponse arg0) {
              super.setResponse(arg0);
         private static class RedirectServletStream extends ServletOutputStream {
            OutputStream out;
            RedirectServletStream(OutputStream out) {
                this.out = out;
            public void write(int param) throws java.io.IOException {
                out.write(param);
    A JSP using this class: requestWrapperTest.jsp
    <%@ page import="java.io.*" %>
    <%@ page import="web.RedirectingServletResponse" %>
    <%@ page contentType="text/html;charset=UTF8" %>
    <%!
    public String getEmailText(HttpServletRequest request, HttpServletResponse response, String emailURL) {
         try{
           // create an output stream - to file, to memory...
           ByteArrayOutputStream out = new ByteArrayOutputStream();
           // create the "dummy" response object
           RedirectingServletResponse dummyResponse;
           dummyResponse = new RedirectingServletResponse(response, out);
           // get a request dispatcher for the email template to load 
           RequestDispatcher rd = request.getRequestDispatcher(emailURL);
           // execute that JSP
           rd.include(request, dummyResponse);
           // at this point the ByteArrayOutputStream has had the response written into it.
           dummyResponse.flushBuffer();
           byte[] result = out.toByteArray();
           System.out.println("result = " + result.length);
           // now you can do with it what you will.
           String emailText = new String(result);
           return emailText;
         catch (Exception e){
              e.printStackTrace(System.out);
              return "DANGER WILL ROBINSON!";
    %>
    <html>
    <body>
    <h2> Server Info Virtual!!</h2>
    Server info = <%= application.getServerInfo() %> <br>
    Servlet engine version = <%=  application.getMajorVersion() %>.<%= application.getMinorVersion() %><br>
    Java version = <%= System.getProperty("java.vm.version") %><br>
    <hr>
    <%
      String result = getEmailText(request, response, "/testLoad.jsp");
      System.out.println(result);
    %>
    <%= result %>
    </body>
    </html>------------------------------------------------------------------
    And the template page being included: testLoad.jsp
    This is the page loaded for testing
    <%
       System.out.println("in the inner jsp");
       // uncomment the following line to see this example work
       //out.flush();
    %>

  • 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

  • Weblogic 9.1/10 not working on jsp:directive.include file="file.jspf"/

    Does anyone know how to get rid of this problem? I have a jsp page including a sun java studio creator created page fragment using the tag:
    <jsp:directive.include file="myHeader.jspf"/>
    here myHeader.jspf is a page fragment.
    after deployment, weblogic server report error as:
    weblogic.servlet.jsp.CompilationException: Failed to compile JSP /Page1.jsp
    Page1.jsp:15:57: Error in "C:\bea\user_projects\domains\base_domain\servers\AdminServer\tmp\_WL_user\proj\grb4mk\war\myHeader.jspf" at line 1: The encoding "null" specified in the XML prolog is unsupported.
    <jsp:directive.include file="myHeader.jspf"/>
    ^----------------^
    Any idea? I tried both weblogic 9 and 10, same error, change to
    <jsp:include page="myHeader.jspf"/>
    works. the question is: why not read jsp 1.2 tag? Any way to make it work with jsp:directive.include tag?
    thanks in advance.
    Edited by: user10243594 on Sep 10, 2008 10:22 AM

    The "jsp:directive.include" tag is only valid in an well-formed XML file that specifies all the relevant namespaces. The "jsp:include" tag is used in a JSP file. I'll bet the beginning of your file shows that you don't have a valid and well-formed XML file.
    If you found that "jsp:include" worked, then that confirms you have an ordinary JSP file here. Why are you trying to use the XML form? The result of "jsp:include" in a JSP file will be exactly the same as the analogous tag in an XML file.

  • jsp:directive.include file=("page3" pubType + ".jsp") flush="true" /

    this isnt working, im trying to add different files in depending on the pubType variables. is there any way i can do this?

    <jsp:directive.include file=("page3" + <%= pubType %> + ".jsp") flush="true" />
    Is that fine?
    Sandesh

  • Are not interpreted JSTL tags in a JSP page including in a servlet.

    Hi people,
    I have a project where una page (index.jsp) includes a servlet (MyServlet), that consult a persistence class and get a List of objects (Users),      
    then the servlet passes the List to a Request object and includes another JSP page (showUsers.jsp). And this is conceptually correct, but don´t works, the JSTL tags are not interpreted in showUsers.jsp.
    This is my code...
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
        pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>Insert title here</title>
    </head>
    <body>
    <c:out value="Show me some things index.jsp"/>
    <div style="border-color:red; border:solid; padding-left:60px">
          <jsp:include flush="true" page="pepe/MyServlet"/>
    </div>
    </body>
    </html>...and the Servlet...
    public class MyServlet extends HttpServlet
         public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
              UserManager um = new UserManager();
              List users = um.getUsers(); //This use Hibernate to return a Users List
              request.setAttribute("users", (ArrayList) um.getUsers());
              request.getRequestDispatcher("/showUsers.jsp").forward(request, response);
    }...Finally, we have the showUsers.jsp file....
    <c:out value="Show me some thing showUsers.jsp"/>
    <table>
         <tr>
              <th>ID</th>
              <th>Name</th>
              <th>e-Mail</th>
              <th>Type</th>
         </tr>
         <tr>
              <c:foreach items="${requestScope.users}" var="user">
                   <td><c:out value="${user.id}" /></td>
                   <td><c:out value="${user.name}" /></td>
                   <td><c:out value="${user.email}" /></td>
                   <td><c:out value="${user.type}" /></td>
              </c:foreach>
         </tr>
    </table>This i get as result page...
    ID       Name       e-Mail       TypeFinally, this is the code of showUsers.jsp...
    <c:out value="Show me some thing showUsers.jsp"/>
    <table>
         <tr>
              <th>ID</th>
              <th>Name</th>
              <th>e-Mail</th>
              <th>Type</th>
         </tr>
         <tr>
              <c:foreach items="[src.User@18f729c, src.User@ad97f5, src.User@d38976, src.User@1e5c339, src.User@17414c8, src.User@7a17]" var="user">
                   <td><c:out value="" /></td>
                   <td><c:out value="" /></td>
                   <td><c:out value="" /></td>
                   <td><c:out value="" /></td>
              </c:foreach>
         </tr>
    </table>Somebody can help me?
    Many thanks,
    Gonzalo

    Thanks you all guys,
    I appreciate very much your help. In response to everyone ...
    BalusC wrote:
    Is JSTL taglib declared in top of that JSP page? I don't see it back in the posted code snippet. In this example I stuck...
    request.getRequestDispatcher("/showUsers.jsp").forward(request, response);By mistake, but this is just a test, the original line of my servlet is...
    request.getRequestDispatcher("/showUsers.jsp").include(request, response);As you can see, both (the servlet and the showUser.jsp file) are included in the index.jsp file. So the header...
    <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>...in the index.jsp file should works (I hope so).
    njb7ty wrote:
    I assume in your web.xml, you have ''pepe/MyServlet' defined as a servlet tag and servlet map tag? Without that, I don't think your JSP will find the servlet. I'm >not sure you need it in web.xml since I never call a servlet from a JSP page.
    I suggest putting System.out.println() throughout your servlet code and out.println() in your JSP pages to see exactly what is called and when.
    As a general rule, JSP files are to display data only, and submit back to a servlet. The servlet does all the business logic and dispatches to the appropriate >JSP page. The JSP shouldn't have any business logic. Including the servlet looks kinda like including business logic. Actually, in a MVC design, your >presentation, control, busines, and database layers have their own isolated responsibilities.
    I suggest the servlet put data as one java bean in request scope via request.setAttribute() and dispatch to the JSP page. The JSP page gets the data via ><useBean> tag. The JSTL gets the variables from the useBean tag and uses the data from there to display it. Really, this is my web.xml file...
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
         version="2.4">
         <servlet>
              <servlet-name>MyServlet</servlet-name>
              <servlet-class>src.MyServlet</servlet-class>
         </servlet>
         <servlet-mapping>
              <servlet-name>MyServlet</servlet-name>
              <url-pattern>/pepe/MyServlet/*</url-pattern>
         </servlet-mapping>
    </web-app>Regarding putting System.out.println() and out.println(), i did it and thats works.
    Respect of your last comment, I am not a expert in MVC, but I understand that the view layer can make calls to the Controller layer, I am wrong?
    evnafets wrote:
    It's not. However thats not code, but the generated HTML.
    As Balusc pointed out it's the result of running this JSP page without importing the tag library at the top.
    Because the tag library is not declared, it treats the <c:forEach> and other tags as template text, and basically ignores them.
    It then evaluates the ${items} attribute as an expression in template text, calling toString() on it.
    Cheers,
    evnafets      The file showUsers.jsp are included into the index.jsp page, that's have the header taglib. Could this works?
    BalusC wrote:
    njb7ty wrote:
    By the way, I dont think this is the correct format for the foreach tag:
    <c:foreach items="[src.User@18f729c, src.User@ad97f5, src.User@d38976, src.User@1e5c339, src.User@17414c8, src.User@7a17]" var="user">You're right friend.
    And that's my problem. Any ideas?
    Thanks everyone,
    Gonzalo

  • jsp:directive-include fails when deployed to 10gAS (10.1.2)

    I am working on an ADF-Faces application (EA17) but am struggling with some issues that only appear when we deploy the application. One is an IllegalStateException that I mention in an earlier posting and an other is that the < jsp: directive-include > tag is supported in our JDeveloper release but when we deploy it the pages will not display and we see from our error log that the < jsp: directive-include > is not supported.
    I did a find . -name "jsp*jar" in the $ORACLE_HOME folder of the deployment system and my local JDeveloper and my local $ORACLE_HOME and in all cases came up with the same jsp-el-api.jar and jsp-api-2.0.jar files (3086 and 49510 bytes respectively) Not being a J2EE expert I'm a little confused as to what is going on. If the same JSP jars are in both cases why does it work on my local JDeveloper but not on the server?
    Thanks, Mark

    OC4J 10.1.2 is a J2EE 1.3 server, so it is not JSP 2.0 - it's JSP 1.2. You don't deploy jsp-api-2.0 JARs into a J2EE server - it already has its own version of JSP.
    OC4J 10.1.3 is a J2EE 1.4 server, which includes JSP 2.0. Is your local JDev 10.1.3 or 10.1.2?

  • Dynamic menu doesn't work with f:verbatim and jsp:directive.include

    Is it not possible to include fragment part in a panel page containing some dynamic menus ?
    This work fine:
    <af:panelPage title="Application home">
    <f:facet name="menu1">
    <af:menuTabs var="menuTab" value="#{menuModel.model}">
    <f:facet name="nodeStamp">
    <af:commandMenuItem text="#{menuTab.label}"
    action="#{menuTab.getOutcome}"/>
    </f:facet>
    </af:menuTabs>
    </f:facet>
    But replacing these entry by a fragment doesn't work, as this:
    <af:panelPage title="Application home">
    <f:facet name="menu1">
    <f:verbatim>
    <jsp:directive.include file="/menuTab.jspf"/>
    </f:verbatim>
    </f:facet>
    the fragment code:
    <f:subview id="menuTab">
    <af:menuTabs var="menuTab" value="#{menuModel.model}">
    <f:facet name="nodeStamp">
    <af:commandMenuItem text="#{menuTab.label}"
    action="#{menuTab.getOutcome}"/>
    </f:facet>
    </af:menuTabs>
    </f:subview>

    Oh, God, why not tell me earlier!!!!!! I do use tomcat 3.1 and it just support servlet. I have no way out but modify all my jsp:include to encoding into a servlet page. I almost re-do all my work. But anyway, thank you! Next time I will know.

  • JSP Error: Include limit reached

    Hi All,
    I am developing on iAS 6.0 SP1 on WinNT. I have my initial index.jsp
    which uses
    <%@ include file=xx.jsp %> to layout the main page depending on a set of
    session values.
    At the moment I have about 31 such includes. But I get the following
    error with that jsp.
    I remember there was a limitation of 20 includes in NAS 4.0.
    I feel that same limitation is with iAS.
    If so is there a way to overcome this limitation?
    TIA
    Dhaninda Weerasinghe
    plate: /cat/index.jsp, JSP Error: Include limit reached
    Exception Stack Trace:
    java.lang.Exception: JSP Error: Include limit reached
    at com.netscape.jsp.JSP.parseAt(Unknown Source)
    at com.netscape.jsp.JSP.parseNext(Unknown Source)
    at com.netscape.jsp.JSP.parseBlock(Unknown Source) . . .

    Hi,
    CALCLIMITFORMULARECURSION configuration setting is not valid for ASO cubes and only applies to BSO cubes. The equivalent configuration setting for ASO cubes is MDXLIMITFORMULARECURSION.
    Syntax
    MDXLIMITFORMULARECURSION TRUE | FALSE
    TRUE - Imposes a limit of 31 on the number of MDX formula execution levels. The default setting is TRUE.
    FALSE - Imposes no limit on the number of MDX formula execution levels.
    Description
    MDXLIMITFORMULARECURSION limits the number of execution levels of MDX calculated members or formulas. MDX calculated member or formula execution may be recursive (for example, a formula can refer to itself, or a calculated member can refer to itself). By default, Essbase limits the number of MDX formula execution levels, because formulas with excessive execution levels may lead to stack overflow errors and crash the server. However, setting MDXLIMITFORMULARECURSION to FALSE prevents Essbase from imposing the limitation. You can use this setting when you know that a recursive execution in a formula/calculated member will eventually terminate, and you wish to have a recursion depth greater than 31.
    If an MDX formula reaches 31 execution levels and MDXLIMITFORMULARECURSION is not set, or is set to TRUE, Essbase stops processing that formula and writes
    error messages in the application log. If a formula reaches 31 execution levels and MDXLIMITFORMULARECURSION is set to FALSE, Essbase continues processing that formula.
    CAUTION: before setting MDXLIMITFORMULARECURSION to FALSE, be sure that the MDX formulas in the outline are not infinitely recursive; for example, be sure that formulas do not depend on each other. Infinite formula recursion may crash the server.
    This is a known issue and is fixed in version 11.1.1.3.500 and you may consider upgrading Essbase.
    KosuruS

  • How to include servlet in JSP using Include Directive?

    Hi experts,
    am a beginner to JSP.. I want to know,
    is it possible to include a servlet in jsp using include directive? could any one explain me...

    No it is not possible.
    Include directive is like copying and pasting some text into a JSP file, and then translating/compiling it.
    So the only thing you can include with the <%@ include %> directive is a jsp fragment
    It is a static translation/compile time include and thus will always be the same
    By contrast <jsp:include> is a runtime include, and includes the result of running the imported url.
    That URL has to be a complete/standalone jsp/servlet/whatever. However as it is runtime, it can take parameters where the include directive can not.
    Does that answer your homework question?
    Cheers,
    evnafets

  • Can't Profile my JSP's on embedded OC4J - what am I doing wrong?

    I can profile (Event and Execution) my executable client-side classes (ie, fired off via a main method) fine, but cannot get any profiling info on my JSP's - any suggestions on what I'm missing?
    I'm using JDev 9.0.3. I've tried it with and without the .jsps package in the Profile "Classes and Packages to include" path. I've tried it with and without the "Remote Profiling" option checked. I'm using the exact same section of code in my class and jsp, and the class works fine for both Execution and Event profiling, so I don't think its the code or my use of the API that's flawed. I've set the project's "Default Run Target" to the JSP (for attempts to profile the JSP - its set to the class for profiling of the main-invoked class).
    ojvm is selected under the Runner "Java Virtual Machine" option. The standard defaults are selected under the Tools:Preferences Embedded OC4J options.
    The profiler window just acts as if the JSP never runs (though in the log window, I get the "Profiler UI connected..." and the OC4J startup messages just fine.
    Most frustrated and appreciate any assistance!
    Thanks,
    Jim

    I can profile (Event and Execution) my executable client-side classes (ie, fired off via a main method) fine, but cannot get any profiling info on my JSP's - any suggestions on what I'm missing?
    I'm using JDev 9.0.3. I've tried it with and without the .jsps package in the Profile "Classes and Packages to include" path. I've tried it with and without the "Remote Profiling" option checked. I'm using the exact same section of code in my class and jsp, and the class works fine for both Execution and Event profiling, so I don't think its the code or my use of the API that's flawed. I've set the project's "Default Run Target" to the JSP (for attempts to profile the JSP - its set to the class for profiling of the main-invoked class).
    ojvm is selected under the Runner "Java Virtual Machine" option. The standard defaults are selected under the Tools:Preferences Embedded OC4J options.
    The profiler window just acts as if the JSP never runs (though in the log window, I get the "Profiler UI connected..." and the OC4J startup messages just fine.
    Most frustrated and appreciate any assistance!
    Thanks,
    Jim Jim,
    your solution is not inconsistent with how the execution and event profiler work. In the online documentation it states that "samples that have accumulated from the start of the program (or the last clear) are displayed when you pause the Execution Profiler or when the program terminates." You can hit 'pause' as you mention, 'snapshot', or stop the process to get results from the execution and event profilers. Basically, you need to tell the profiler when to provide a sample. Also if you plan to do any remote profiling of JSP's you will need to manually start the application and start a browser to invoke the JSP or servlet.
    I hope this

  • Dynamic JSP's includes from JSF Java Beans

    Hi!
    I�m David from Barcelona.I'm testing different JSF components.
    I'm working with MyFaces components, with Tabs, binding the component like this to create sub tabs dynamically:
    <t:panelTabbedPane binding="#{editorPanelBean.pane}"/>
    Now, in the bean, I use the Application class to create
    my pane and child tabs:
    UIComponent pane = app.createComponent(TABBEDPANE);
    UIComponent childtab = app.createComponent(PANELTAB);
    HtmlPanelTab tab = (HtmlPanelTab) childtab;
    I want to start adding contents to my child tabs.
    Am I locked into doing it programmatically or is it possible to somehow refer back to a JSP page
    with an include to generate the contents of each tab child?
    I can do it without binding the panelTabbedPane component, but the problem it's when I construct the component with a binding, then the include JSP doesn't work. I have tried with a Verbatim and HtmlOutputText but no results, like this:
    HtmlTabItem aHtmlTabItem = (HtmlTabItem) application.createComponent(HtmlTabItem.COMPONENT_TYPE);
    aHtmlTabItem.setValue(valor);
    aHtmlTabItem.setId(viewRoot.createUniqueId());
    UIOutput verbatim1 = (UIOutput) application.createComponent("javax.faces.Output");
    //verbatim1.setValue("<f:subview id=\""+viewRoot.createUniqueId()+"\"><jsp:include page=\"ficha_paciente_tab2.jsp\" flush=\"false\"/></f:subview>");
    verbatim1.setValue("<%@ include file=\"ficha_paciente_tab2.jsp\" %>");
    verbatim1.getAttributes().put("escape", Boolean.FALSE);
    verbatim1.setId(viewRoot.createUniqueId());
    aHtmlTabItem.getChildren().add(verbatim1);
    How can I include dynamically from my bean a JSP page with the HTMlL design of each tab and anything I want to ?
    Any help would be great !
    Thanks!

    1. username and password should be simple String properties, don't make it any more difficult than it needs to be.
    2. if (result == "success")
    Oh dear, Java 101 mistake. You want to use result.equals("success") to make that work.
    Another observation: you may want to move all the database code to a separate class. If you put database logic in seperate classes with specific methods (login(), logout(), getAllUsers(), etc.) you not only make your code more readable but you make it possible to re-use those methods in different parts of your code.

  • [jsp] about include files

    I have a question as follow.
    <%
    String head = "abc.html";
    %>
    <%@ include file="\"" + head + "\"" %>
    this program code doesn't work.
    can I include files by variant?
    thank you.

    Hello,
    Yes, one can include files by variants this way:
    <jsp:include page="<%=fileName%>" flush="true" />
    I do not know why the include directive does not allow it. However, I hope it helps.

Maybe you are looking for

  • Can I embed fonts in IBook author

    I want to use a different font from those available in IBook author Is ther a way of embedding different fonts in an IBook file?

  • Acrobat X Pro Compare Documents To Sensitive

    Hi, I am testing the "Compare Documents" functionality for my company in Acrobat Pro X. I must say I am pleased with the results for the most part but it seems like the compares are picking up to much information. For instance, If I insert a table ro

  • A Function in Flash 8 help file should be changed

    At curveTo Function,there is an example how to create a circle by ActionScript: quote: this.createEmptyMovieClip("circle2_mc", 2); circle2_mc.lineStyle(0, 0x000000); drawCircle(circle2_mc, 100, 100, 100); function drawCircle(mc:MovieClip, x:Number, y

  • Re: BI Query in Portal

    Hi All, How to publish a BI query to a portal user. How to restrict(authorisation) the portal user to view HR data. Regards, Anand

  • How to set default Action

    Hi Team, I have one input text and one button. whatever i am entering in input text field and pressing button its displaying below. Now I want the same to be done on pressing Enter key means without clicking button. I want to give my button a default