Using JSP include function

Using JSP include function + collapse/expand table
(1) I've got a page A (A.jsp) and a page B (B.jsp) which includes 3 files : the header (head.html) and the side panel of icons (icons.jsp) are the same files for both A.jsp and B.jsp
but the 3rd file containing the contents, are different for A and B
(2) icons.jsp
This is what the side panel of icons is suppose to do. E.g. click on icon1, its submenu will appear and the 3rd file is suppose to link to e.g. A.jsp
When click on icon2, icon1's submenu will collapse and icon2's submenu will expand and the 3rd file is suppose to link to B.jsp
The expand/collapse function is written in javascript
(3) Problem : e.g. when i click on icon1, its submenu wont remain expanded, when it changes to another page, icon1's submenu will collapse back, even though the other page includes the icons.jsp too.
Hence, i've decided to pass a parameter using JSP to achieve the desired effect. as a result, i include the icons file like this
<%@ include file="icons.jsp?item=icon1" %>, but the icons.jsp file isnt included into the page at all.
Is the above include file method possible? And is it possible to use JSP to achieve the effect i've stated?
Thanx

sounds more like a html problem.
Do you have a target with the <a href> of your icons? Sounds like the icon page is being refreshed as well.
<html>
<frameset .....>
<frame src=header.jsp name=head>
<frameset name=bottom>
<frame src=icons.jsp name=navigate>
<frame src=dummy.jsp name=content>
</frameset>
</frameset>
try <img src=niceIcon1.gif>

Similar Messages

  • Problem using jsp:include from inside a custom tag

    Hi, All !
              I have a problem using <jsp:include> from inside a custom tag. Exception is:
              "java.lang.ClassCastException: weblogic.servlet.jsp.BodyContentImpl"
              Apparently, weblogic tries to cast BodyContentImpl to JspWriterImpl and
              could not do this. Is it a bug, since in the 1.1 spec is said: "The
              BodyContent is a subclass of JspWriter that can be used to process body
              evaluations so they can retrieved later on."
              My code is:
              <wfmklist:items>
              <jsp:include page="item.jsp" flush="true"/>
              </wfmklist:items>
              

    This is an area of contention with WL. It is not so tolerant with regards to
              the spec. I spent several days recently trying to convince it to accept the
              specification in regards to bodies and includes and it appears to have
              successfully rebuffed my efforts.
              Frankly, this is very disappointing. It appears that some shortcuts were
              taken on the way to JSP 1.1 support, and the result is a very hard-coded,
              inflexible implementation. As I have not seen the implementation myself, I
              hate to assume this, however one could posit that the term "interface" was a
              foreign concept during the implementation, other than as some annoying
              intermediary reference requiring an immediate cast to a specific Weblogic
              class, which in turn is apparently required to be final or have many final
              methods, as if being optimized for a JDK 1.02 JIT.
              I am sorry that I don't have any positive suggestions other than to use a
              URL object to come back in an execute the necessary "include" directly. You
              lose all context (other than session) and that can cause its own problems.
              However, you can generally get the URL approach to work, and you will
              hopefully avoid further frustration.
              Peace,
              Cameron Purdy
              Tangosol, Inc.
              http://www.tangosol.com
              Tangosol: How Weblogic applications are customized
              "Denis" <[email protected]> wrote in message
              news:[email protected]...
              > Hi, All !
              > I have a problem using <jsp:include> from inside a custom tag. Exception
              is:
              > "java.lang.ClassCastException: weblogic.servlet.jsp.BodyContentImpl"
              >
              > Apparently, weblogic tries to cast BodyContentImpl to JspWriterImpl and
              > could not do this. Is it a bug, since in the 1.1 spec is said: "The
              > BodyContent is a subclass of JspWriter that can be used to process body
              > evaluations so they can retrieved later on."
              >
              > My code is:
              > ...
              > <wfmklist:items>
              > <jsp:include page="item.jsp" flush="true"/>
              > </wfmklist:items>
              > ...
              

  • Using jsp:include in iPlanet6SP2

    I'm trying to include a common jsp file, say [proj_common]/common.jsp, from
    another jsp file, say [proj_parent]/parent.jsp, using <jsp:include>. After
    deployment both files sit under their respective folders (for example in
    c:\iplanet\ias6\ias\APPS\modules) as [proj_common]/common.jsp and
    [proj_parent]/parent.jsp. I've included a relative path from [proj_parent]
    to [proj_common], and here's the code I've added in
    [proj_parent]/parent.jsp:
    <jsp:include page="../[proj_common]/common.jsp">
    <jsp:param name="p1" value="v1"/>
    </jsp:include>
    I'm using only static HTML in common.jsp as a test. The following error then
    occured when I view [proj_parent]/parent.jsp :
    500 SC_INTERNAL_SERVER_ERROR
    Error: 500 SC_INTERNAL_SERVER_ERROR
    javac error:
    c:\iplanet\ias6\ias\APPS\modules\[proj_parent]\WEB-INF\compiled_jsp\jsp\APPS
    \[proj_parent]\..\[proj_common]\common.java:1: Identifier expected.
    package jsp.APPS.[proj_parent]....[proj_common];
    ^ (pointing under 2nd dot of ....)
    c:\iplanet\ias6\ias\APPS\modules\[proj_parent]\WEB-INF\compiled_jsp\jsp\APPS
    \[proj_parent]\..\[proj_common]\common.java:11: Superclass HttpServlet of
    class common not found.
    public class common extends HttpServlet {
    ^ (pointing under HttpServlet)
    2 errors
    I believe this is not a path error (since that error explicitly tells me the
    included file cannot be found). I have read other previous messages and
    learn that there is a problem with <jsp:include> and relative paths... Also
    a test when both files are in the same directory shows no problem at all. Is
    there a solution to this problem of parsing relative paths in SP2?
    Thanks and regards,
    Anthony Yuen

    Another strange thing happened:
    We have been including html and jsp files. From a certain point the system was
    not able to include html files. When we renamed html includes to jsp, it was
    working again.
    Has anyone experienced the same thing?
    Does anyone know the resolution?
    Regards,
    Gyorgy
    Anthony Yuen wrote:
    I'm trying to include a common jsp file, say [proj_common]/common.jsp, from
    another jsp file, say [proj_parent]/parent.jsp, using <jsp:include>. After
    deployment both files sit under their respective folders (for example in
    c:\iplanet\ias6\ias\APPS\modules) as [proj_common]/common.jsp and
    [proj_parent]/parent.jsp. I've included a relative path from [proj_parent]
    to [proj_common], and here's the code I've added in
    [proj_parent]/parent.jsp:
    <jsp:include page="../[proj_common]/common.jsp">
    <jsp:param name="p1" value="v1"/>
    </jsp:include>
    I'm using only static HTML in common.jsp as a test. The following error then
    occured when I view [proj_parent]/parent.jsp :
    500 SC_INTERNAL_SERVER_ERROR
    Error: 500 SC_INTERNAL_SERVER_ERROR
    javac error:
    c:\iplanet\ias6\ias\APPS\modules\[proj_parent]\WEB-INF\compiled_jsp\jsp\APPS
    \[proj_parent]\..\[proj_common]\common.java:1: Identifier expected.
    package jsp.APPS.[proj_parent]....[proj_common];
    ^ (pointing under 2nd dot of ....)
    c:\iplanet\ias6\ias\APPS\modules\[proj_parent]\WEB-INF\compiled_jsp\jsp\APPS
    \[proj_parent]\..\[proj_common]\common.java:11: Superclass HttpServlet of
    class common not found.
    public class common extends HttpServlet {
    ^ (pointing under HttpServlet)
    2 errors
    I believe this is not a path error (since that error explicitly tells me the
    included file cannot be found). I have read other previous messages and
    learn that there is a problem with <jsp:include> and relative paths... Also
    a test when both files are in the same directory shows no problem at all. Is
    there a solution to this problem of parsing relative paths in SP2?
    Thanks and regards,
    Anthony Yuen

  • Using jsp:include in showOneTab - main form not loaded on submit

    I have a JSP page with JSF and ADF components. It is a large JSP containing some main details and then an af:showOneTab component to create a set of tabs. It works fine with JDK 1.5 and Tomcat 5.0 but when changed to Oracle Application Server 9.0.4 and JDK 1.3 We get the following error:
    JspCompileException:.... code too large for try statement catch( Throwable e}....
    Finding this to be caused by large size of JSP, we divided the page as follows - a main jsp containing the main form details and 1 jsp for each tab. Whenever one of the tabs is clicked the corresponding JSP is dynamically loaded using jsp:include tag as follows:
    <af:showDetailItem text="Tab1" id="tab1" styleClass="menu">
              <f:subview id="viewTab1">
                   <jsp:include page="Tab1.jsp" />
              </f:subview>
    </af:showDetailItem>
    There is a Submit button in the main jsp, when this is clicked the main jsp is reloaded.
    But when the user navigates to any of the tabs and then clicks the Submit button in the main form, the main form is not reloaded - only the jsp for the currently selected tab is loaded.
    (I am using f:view and h:form in the main form, and no form tag in the included jsps)
    How to solve this problem?

    The af:selectOneChoice components are in the test.jsp page included in main.jsp with jsp:include tag.
    The code look like this:
                   <af:selectOneChoice label="#{msg.team}"
    id="soc1"
    value="#{myBean.selectedTeamID}"
    autoSubmit="true">
    <f:selectItems id="si1" value="#{myBean.teamList}"/>
    </af:selectOneChoice>
    <af:selectOneChoice label="#{msg.subteam}"
    id="soc2"
    value="#{myBean.selectedSubteamID}"
    partialTriggers="soc1"
    rendered="#{myBean.selectedTeamID!=null}"
    autoSubmit="true">
    <f:selectItems id="si2" value="#{myBean.subteamList}"/>
    </af:selectOneChoice>
    the code works fine in the seperate page, but when I include the page the second selectOneChoice component doesnt get rendered.
    Edited by: Migan on 2010-jul-13 08:36

  • ADF FACES EA16 Why survey demo don't use jsp:include for common part

    Is it a reason why the surveyPage1, surveyPage2 and others don't use jsp:include to load dynamically the actions, menuglobal and location facet ?
    These facet's contains the same adf components with same properties !
    Why not use a subview containing these flow management component and include this subview in the panelpage with the jsp:include ?
    I'm testing this approach but i'm not able to render these components ... may be i'm completely wrong ? I didn't find any example in the demo that demonstrate how to include subview in an adf document or panelpage.
    Help will be appreciate a lot !!!

    so what exactly is the problem here?
    what is not working?

  • Relatiive Path problem when using JSP:include in web portlet

    Hi
    I am using Oracle Portal 9.0.2, and thus OC4J as the J2EE platform.
    I have created a JSP web portlet that is supposed to inlude a specific static html file, which name is passed to it using a portlet parameter. It works, but I had to create a symbolic link from the applicable J2EE applications's htdocs directory in order to access the content:
    /j2ee/OC4J_Portal/applications/<application>/htdocs/<portlet>/content/
    where /content/ is a symbolic link to another directory altogether.
    I can then access the content from within the portlet with a JSP include tag that looks like :
    docPath = "/htdocs/<portlet>/html/"+doc_path;
    %>
    <br>Include:
    <jsp:include page="<%=docPath%>" flush="true"/>
    I would like to access the content using the JSP include without having to use the symbolic link. Is there a way to do this. I tried using an Apache alias, but that did not work.
    Regards
    Harry

    Hi
    Thanx
    In the end we build up a static URL to the document to be included using:
    String contentLocation="content/";
    docPath = contentLocation+getAdditionalDocPath();;
    out.println("docPath="+docPath);
    String docPathAndName = portletRequest.getParameter("doc_path");
    %>
    <!--
    This java script function calls the display content page with the
    page parameter doc_path (which is in return passes it to the display
    content portlet) in order to retrieve and display specific document
    with a JSP:include tag
    -->
    <script language="JavaScript">
    function generateSectionPath(docName) {
    this.location="http://<%=portletRequest.getServerName()%>:<%=portletRequest.getServerPort()%>/pls/portal/url/page/<%=getPageGroup()%>/content?doc_path="+"<%=docPath%>"+docName;
    <script language="JavaScript">
    function generateRelativePath(docName) {
    this.location="http://<%=portletRequest.getServerName()%>:<%=portletRequest.getServerPort()%>/pls/portal/url/page/<%=getPageGroup()%>/content?doc_path="+docName;
    </script>
    <br>Include:
    <%
    if (portletRequest.getParameter("doc_path") == null) {
    out.println("Error - no doc path specified");
    } else { 
    try { %>
    <jsp:include page="<%=docPathAndName%>" flush="true"/>
    <% } catch (Exception e) {
    out.println("Error retrieving document:"+e.toString());
    } // end if
    %>
    Each link from one included HTML file to another becomes a JS function that points the browser to the portal page that includes the portlet that includes thwe JSP that has the include tag to include the html document that is to be displayed.
    The current relative path the the html document (from a predefined root in the file system that is symbolically linked to the same directory as where the including JSP lives) is stored in a session variable, and appended to the document name that is passed to the page.
    If a full document path, as opposed to just the name, is stored, that no appending is done. However, the path is stripped out and stored in a session variable.
    Ths thing is, sometimes a document name, and sometimes a path is passed to the page. Therefore the requirement to know the path when it is not available. A name only will always be passed subsequent to a request for a document with the full path specified, therefore the session variable mechanism works.
    Thanx for the input
    Harry

  • Problem when using jsp:include.. / in JSP when run on OC4J903

    I have a very unusual JSP question when run in OC4J903(EM or standalone) version (previous OC4J version was ok). Here is the description
    1. run P1.jsp and a parameter(text1) will pass to P2.jsp
    2. In P2.jsp, include "includePage.jsp" before show the parameter.
    question:
    1. The P1.jsp parameter will be null if using "POST" method, but "GET" is work.
    anyone have a indea ? or is that a bug in OC4J903 version
    P1.jsp
    <html>
    <head>
    <title>Test</title>
    </head>
    <body>
    <form method=POST action='P2.jsp'>
    <input type=text name='text1' size=30>
    <input type=submit value='OK'>
    </form>
    </body>
    </html>
    P2.jsp
    <html>
    <head>
    <title>Test</title>
    </head>
    <jsp:include page="includePage.jsp" flush="true">
    <jsp:param name="importParam" value="P2 Export" />
    </jsp:include>
    <body>
    <%
    out.print("Here shows the param from P1: " + request.getParameter("text1")+"<br>");     
    %>
    </body>
    </html>
    includePage.jsp
    <%@ page import="java.io.*"%>
    <%
    out.print("Here runs the include page. The param from P2 is: " + request.getParameter("importParam")+"<br>");
    %>

    I have a very unusual JSP question when run in OC4J903(EM or standalone) version (previous OC4J version was ok). Here is the description
    1. run P1.jsp and a parameter(text1) will pass to P2.jsp
    2. In P2.jsp, include "includePage.jsp" before show the parameter.
    question:
    1. The P1.jsp parameter will be null if using "POST" method, but "GET" is work.
    anyone have a indea ? or is that a bug in OC4J903 version
    P1.jsp
    <html>
    <head>
    <title>Test</title>
    </head>
    <body>
    <form method=POST action='P2.jsp'>
    <input type=text name='text1' size=30>
    <input type=submit value='OK'>
    </form>
    </body>
    </html>
    P2.jsp
    <html>
    <head>
    <title>Test</title>
    </head>
    <jsp:include page="includePage.jsp" flush="true">
    <jsp:param name="importParam" value="P2 Export" />
    </jsp:include>
    <body>
    <%
    out.print("Here shows the param from P1: " + request.getParameter("text1")+"<br>");     
    %>
    </body>
    </html>
    includePage.jsp
    <%@ page import="java.io.*"%>
    <%
    out.print("Here runs the include page. The param from P2 is: " + request.getParameter("importParam")+"<br>");
    %>

  • Using jsp:include in jsf

    I want to include a jsp page in another jsp page. My code is as follows:
    1)
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:c="http://java.sun.com/jstl/core"
    version="2.0">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Page Title</title>
    </head>
    <body>
    <f:subview id="sub">
    <jsp:include page="/demo.jsp"/>
    </f:subview>
    </body>
    </html>
    </jsp:root>
    2) demo.jsp is given below
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:c="http://java.sun.com/jstl/core"
    version="2.0">
    <ui:composition>
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Page Title</title>
    </head>
    <body>
    <h:outputText value="Hello"/>
    </body>
    </html>
    </ui:composition>
    </jsp:root>
    but when i run this application i get error as follows:
    javax.servlet.ServletException: @15,48 <jsp:include> Tag Library supports namespace: http://java.sun.com/JSP/Page, but no tag was defined for name: include
         javax.faces.webapp.FacesServlet.service(FacesServlet.java:270)
         org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:178)
         org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:290)
         org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:390)
         org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:517)

    You're mixing two view technologies with each other: JSP and Facelets. You cannot do that. Use the one or the other. In Facelets you can just use <ui:include>. Leave all of those legacy <jsp> tags out when using Facelets.
    By the way, although the <f:subview> is superfluous in Facelets and only used in JSP, I wanted to tell you, this tag is better to be placed in the include file, not in the parent file. Otherwise you may risk "duplicate component ID" problems.

  • 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

  • A peculiar problem using jsp:include conditionally

    Hi,
    This is regarding usage of jsp:include in Myfaces 1.1.4.
    lets say the page containing the jsp:include statements as PARENT PAGE
    I have a requirement to display some components in the PARENT PAGE which are continued from the same form using different JSPs since the components are different based on a condition.
    I used the following code:
    <h:panelGrid id="CandidateRequestorView" rendered="#{RgsViewRequirementBB.displayCandidateView}" columns="1">
         <jsp:include page="/RGSPages/requestorViewReq.jsp"/>
    </h:panelGrid>
    <h:panelGrid id="CandidateMatcView" rendered="#{!RgsViewRequirementBB.displayCandidateView}" columns="1">
         <jsp:include page="/RGSPages/matcViewReq.jsp"/>
    </h:panelGrid>Now if I use only 1 panel grid (any one out of the above 2) it works. I didnt even use <f:subview> any where( neither in the PARENT PAGE nor in the included jsps), but it works.... Also for your knowledge these jsps contain only JSF elements( no plain HTML code is used)
    But if I am using the above displayed code to have both the jsps (actually only one will be displayed bcoz the same condition is used)
    then its not displaying all the contents of included jsp. (YES I AM ABLE TO GET TO THE JSP...THERE IS NO ERROR) There is a datatable inside this jsp which is not rendered......
    I have used <f:subview> when i faced this problem.......
    I have tried every combination....writing <f:subview> in the PARENT PAGE ....writing in included jsps and removed it from PARENT PAGE.....also some of the articles in the forum mentioned that <f:subview> element should not be used inside <h:panelgrid> .....i even tried that....but final result is same as I was getting the first time...
    I am able to reach the jsp page (with or without <f:subview>) but i am not able to display all the contents....but if i use only one of the included jsps(by removing any one of the panel grids) I am able to view them. Since I am able to view all the contents when i view these pages inside the PARENT PAGE one at a time, that indicates there is no problem in datatable contained in these pages.....
    ( Also I have not used <f:view> inside my included jsps.)
    Please help to solve this problem...
    Thanks
    Avner

    Hi BalusC,
    The RgsViewRequirementBB is already in the session scope.
    Also I am using the setDisplayCandidateView(true) or setDisplayCandidateView(false ) explicitly as depicted below. The page is still under construction thats why the rendered attribute is explicitly set.
    public RgsViewRequirementBackingBean() {
    super();
    // TODO Auto-generated constructor stub
    try{
                setDisplayCandidateView(true);
                 // some more code goes in here
         catch(Exception){
               ResourceBundle bundle = null;
               bundle = ResourceBundle.getBundle("resources.ErrorMessages", FacesContext.getCurrentInstance().getViewRoot().getLocale());
                 //some more code goes in here
    }

  • Syntax error when using jsp:include...

    @ all
    I get a syntax error at the jsp:include line, character "";
    Can anybody help me with that issue?
    Jürgen

    select coalesce(col1,col2) joined_col, col3, sum(col4), col5 from data group by joined_col,col5You cannot use a column alias like this directly inside the group-by clause. You will have to rewrite this to:
    select coalesce(col1,col2) joined_col, col3, sum(col4), col5 from data group by coalesce(col1,col2),col5Furthermore I assume that the 'col5' in the group by should be 'col3', not?
    Or vice-verse the 'col3' inside the select-list should be 'col5'...

  • Writing JSP dynamically & using  JSP includes

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

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

  • 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.

  • Include using jsp:include for a file from the docroot directory.

    Hello,
    I try to include one file from the doocroot but only can import files from the context (War deployed).
    when I put
    <jsp:include page="/foo.htm">
    to include this file: http://www.mydomain.com/foo.html
    it try to show this file: http://www.mydomain.com/mycontext/foo.html
    it puts ever the context before the name of my file.
    How can I include this file.
    Thanks
    PD: obviously 'foo.html' is in the doocroot.

    From within a JSP you have a reference to a PageContext called pageContext. This has a method getServletContext(). From the ServletContext you can find the real path the servlet lives in. So...
    File basePath = new File(pageContext.getServletContext().getRealPath("/"));Now basePath contains your path $Catalina/webapps/webservices. Then it's just a matter of working relative to that, e.g.:
    File usersFile = new File(basePath, "users.txt");

  • WebLogic 8.1 support for JSP includes using XML formatting

    Hi,
              I have a web application I'm trying to deploy to WebLogic 8.1 which uses JSP includes.
              My JSP page starts with :
              < ?xml version="1.0"?>
              At runtime, I get this exception:
              java.io.IOException: javax.servlet.jsp.JspException: The taglib validator rejected the page:
              "org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed., "
              Are XML formatted JSP includes supported ?
              Thank you
              John

    I got a similar exception which was:
              java.io.IOException: javax.servlet.jsp.JspException: The taglib validator rejected the page: "org.xml.sax.SAXParseException: Attribute "xmlns:html" was already specified for element "jsp:root"., "
              This is how I fixed it:
              The taglib for the html was declared twice. Once in the main.jsp and once in taglibs.jsp. The taglibs.jsp was included in main.jsp (The jsp which was throwing exception)
              Hope this works for your case.
              Thanks
              -AKJ

Maybe you are looking for

  • Harman kardon go +play

    i recently bought the harman kardon go + play, however i cannot get the s-video connection to work with my tv. the ipod is an 80gb classic and i have it set to video out, however it comes up with the error message "connect video accessory" and won't

  • Multiple Project Panels-why??

    I'm on Mac. For some reason, Premiere has this habit of randomly duplicating the Project Panel/Palette. So when I have a project open, I can sometimes have 3 or 4 of the same Project panel open. Even on a brand new Project. Is this intentional? I usu

  • Why attribute ID doesn't support EL?

    I have problem to get component source from ValueChangeEvent because I cannot set ID to each component inside table rows (i.e: SelectBooleanCheckbox). checkbox attribute ID aren't unique in table row because ID is not support EL or variable. So HOW D

  • Z10 All Apps Freezed or not working at all

    Music, email etc, all not doing anything, ive restarted the phone several times but nothing works, removed the battery but still nothing....please help

  • What is the best email that is similar to gmail for macs?

    I am tired of having to deal with the "all mail" tab and it making doubles of all of my email. When the icloud comes out i was thinking of giving it a try, but are there any suggestions?  I also have a blackberry so keep that into consideration   i w