Include jsp file

There are 2 jsp files: main.jsp, process.jsp.
In the main.jsp,
String name="java";
<jsp:include page="process.jsp" flush="true" />
.....In the process.jsp,
String name="abc";
....My problem is the parameter - name have not changed to "abc" .
How can I solve this problem ?
thanks.

Hi,
Dont think that it should happen like that, the diffrence between <jsp:include> and <%@ include> is that jsp:include is a dymanic include i.e. the processed contents of the jsp flie are added to your page, while @ include is a static include meaning that the contents are first put together as one big jsp and then the contents are processed.
That is why the original jsp is recompiled, and your server should automatically determine that when a parent jsp is to be recompiled when a included jsp is changed. What server are you using?
And as in jsp:include the processed result (html) is added the variable declairations or manipulations in a child will not be accesable in the parent, while they will be in case of @include.
Hope this helps
Regards
Omer

Similar Messages

  • Listing files on the webcontent directory that including .jsp files

    Hi ,
    I want to list all files on the directory that including .jsp files . How can I do this ?
    �f I use the following code in the jsp:
    java.io.File file = new java.io.File(".");
    String[] files= file.list();
    it returns me application server 's directory files. But I want to see webcontent directory files.

    You can use the method of ServletContext - getRealPath() to turn a website relative location into a real place on disk.
    In a generic way:
      <%
        String dir = application.getRealPath(request.getServletPath());
        File jspFile = new File(dir);
        File jspDir = jspFile.getParentFile();
        File[] files = jspDir.listFiles(); 
      %>Cheers,
    evnafets

  • Included JSP files not seeing JavaScript in main JSP file

    Hi All,
    I have a JSP page that defines a JavaScript block in it's HEAD block and then includes multiple JSP pages in it's BODY block. Calling a JavaScript function from any of the included JSP pages is met with the following JavaScript error:
    JavaScript Error: [unknown origin]:
    showBatchDetail is not defined.
    I'm not sure what is wrong here since the JSP is generating on the server side and everything is fine by the time it gets to the client side. The entire client side file should be seeing the JavaScript block that was included in the main file.
    Any help here would be much appreciated.
    Steph.
    Some barebones code appears below:
    Main.jsp
    <HTML>
    <HEAD>
    <TITLE>UNIT INFO</TITLE>
    <SCRIPT LANGUAGE="JavaScript">
    function showBatchDetail(batchKey)
    var url = "/pditools/html/SfmReports/ShowBatchDetail.jsp"
    + "?batchKey=" + batchKey;
    document.location = url;
    </SCRIPT>
    </HEAD>
    <BODY>
    <%@include file="ShowBatchSummary.jsp"%>
    <%@include file="ShowUnitDefects.jsp"%>
    <%@include file="ShowUnitHistory.jsp"%>
    </BODY>
    </HTML>
    ShowBatchSummary.jsp
    <TABLE>
    <TR>
    <TD>
    BATCH SUMMARY
    <A TARGET="_blank" HREF="JavaScript:showBatchDetail(1000);">(Batch Detail)</A>
    </TD>
    </TR>
    <TR>
    Show some data ...
    </TR>
    </TABLE>

    The problem is not about include but about link use
    ----ShowBatchSummary.jsp----
    <TABLE>
    <TR>
    <TD>
    BATCH SUMMARY
    <A TARGET="_blank" HREF="#" onclick="JavaScript:showBatchDetail(1000);">(Batch Detail)</A>
    </TD>
    </TR>
    <TR>
    Show some data ...
    </TR>
    </TABLE>
    -------end of ShowBatchSummary.jsp--------

  • Refreshing included JSP file

    Hi,
    I've created a simple word-verification login system to stop robots from trying out various password combo's on a user's account.
    I've created a separate JSP page that randomly chooses an image from a database, sets a session variable to the word that is spelt in the image. Then when the user types in the word it simply checks that the word the user typed matches the session variable.
    Here's a snipet from this file: -
    login_image.jsp
    String [] sImageText = {
    "flusessn",
    "mises",
    "appalli",
    "encirs",
    "peromm"
    // create random number between 0-5
    Random rand = new Random();
    int nImageNumber = rand.nextInt(6);
    session.setAttribute( "imageword", sImageText[nImageNumber] );
    response.sendRedirect( "images/login/Captcha" + nImageNumber + ".jpg" );The image is displayed in the login page as follows:
    login.jsp
    <img src="login_image.jsp" />Whe the user enters their username, password and word verification it is processed in a separate JSP file: -
    process_login.jsp
         String sWordVerification = request.getParameter("securitycode");
         String sTheWordVerification = (String)session.getAttribute( "imageword" );
         if ( !sTheWordVerification.equalsIgnoreCase( sWordVerification ) ) {                response.sendRedirect( "login.jsp?worderror=true" );
         } else {     
    .The system works ok. My problem arises if the user enters the wrong word, they are shown an error message on the login.jsp page. However, the login image doesn't change. Any idea how I can make the image refresh each time the login.jsp page is loaded?
    Many thanks

    Thanks.
    I've managed to sort it using javascript. It's a bit messy, but it works. All the changes are made to login.jsp: -
    <script language="JavaScript">
    <!--
    var sURL = unescape(window.location.pathname);
    function doLoad()
        setTimeout( "refresh()", 1 );
    function refresh()
        window.location.href = sURL + "?worderror2=true";
    //-->
    </script>
    <%                                   
    String sError = request.getParameter("worderror");
    if ( sError != null ) {                    
    %>
    <meta http-equiv="refresh" content="1" >
    <script>
         doLoad();
    </script>
    <%
    String sError2 = request.getParameter("worderror2");
    if ( sError2 != null ) {               
         out.println( "<div class=\"redtext\" align=\"center\"><p>The word verification failed.  Please try again.</p></div>" );                              
    %>Here's how it works: -
    - User enters word verification in login.jsp
    - Posted to process_login.jsp
    - If the words don't match then redirect to login.jsp?worderror=true
    - login.jsp detects the worderror=true and runs the following script
    <meta http-equiv="refresh" content="1" >
    <script>
         doLoad();
    </script>
    - The doLoad() method refreshes the login page, including the login image using the refresh method
    - It redirects to window.location.href = sURL + "?worderror2=true";
    posting worderror2=true prevents login.jsp from entering an infinate loop.
    aaaaaaaand relax.....

  • How include jsp file in adf jsf

    hi!
    I would like to include my jsp file in adf jsf but when i run my jsf page i have this error
    "javax.faces.event.AbortProcessingException: javax.faces.view.facelets.FaceletException: Error Parsing /Scanning.jsp: Error Traced[line: 1] <Line 1, Column 2>: XML-20201: (Erreur grave) Attendu : name et non %."
    My jsp page is Scanning.jsp and in my jsf page i include my jsp page like this
    <?xml version='1.0' encoding='UTF-8'?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <f:view xmlns:f="http://java.sun.com/jsf/core" xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <af:document title="untitled1.jsf" id="d1">
    <af:form id="f1">
    <af:panelTabbed id="pt1">
    <af:showDetailItem text="showDetailItem 1" id="sdi1"/>
    <af:showDetailItem text="showDetailItem 2" id="sdi2">
    <af:declarativeComponent viewId="Scanning.jsp" id="dc1" >
    </af:declarativeComponent>
    </af:showDetailItem>
    </af:panelTabbed>
    </af:form>
    </af:document>
    </f:view>
    What's wrong ???
    Help me please

    I'm looking for this characters but nothing
    could try to help me again
    this my
    jsp code
    <%@ page pageEncoding="UTF-8"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Scanner vos ch&egrave;ques</title>
    <link media="screen" href="css/sbullet.css" type="text/css" rel="stylesheet"/>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <!--script type="text/javascript">
    // Declaration globale
    var Nbrimg = 0;
    var ImgRecto = 0;
    var ImgVerso = 0;
    var ImgTotal = 0;
    <script type="text/javascript" event="TransportNewState(newState,previousState)" for="Ranger">
    // Transport new state, fired every time the State changes on the control
    // input params , are the new state and the previous state
    //alert(newState);
    var RangerTransportStates = {
    TransportUnknownState : - 1, TransportShutDown : 0, TransportStartingUp : 1, TransportChangeOptions : 2, TransportEnablingOptions : 3, TransportReadyToFeed : 4, TransportFeeding : 5, TransportExceptionInProgress : 6, TransportShuttingDown : 7
    ok = false;
    if (newState == RangerTransportStates.TransportShutDown) {
    document.getElementById('StartRanger').disabled = false;
    document.getElementById('EnableRanger').disabled = true;
    document.getElementById('StopFeeding').disabled = true;
    document.getElementById('StartFeeding').disabled = true;
    document.getElementById('ChangeOptions').disabled = true;
    document.getElementById('Shutdown').disabled = true;
    document.getElementById('UserInstructions').innerHTML = "Appuyer sur Demarrer pour initiliser le scanner"
    Nbrimg = 0;
    ImgVerso = 0;
    ImgRecto = 0;
    ImgTotal = 0;
    if (newState == RangerTransportStates.TransportChangeOptions) {
    document.getElementById('StartRanger').disabled = true;
    document.getElementById('StartFeeding').disabled = true;
    document.getElementById('EnableRanger').disabled = false;
    document.getElementById('Shutdown').disabled = false;
    document.getElementById('UserInstructions').innerHTML = "<b/>Demarrage <br/> Appuyer sur Activer pour preparer le scanning "
    ok = false;
    if (newState == RangerTransportStates.TransportReadyToFeed) {
    document.getElementById('EnableRanger').disabled = true;
    document.getElementById('StopFeeding').disabled = true;
    document.getElementById('StartFeeding').disabled = false;
    document.getElementById('ChangeOptions').disabled = false;
    document.getElementById('Shutdown').disabled = false;
    document.getElementById('UserInstructions').innerHTML = "<b/>Pret a scanner<br/> Appuyer sur Scanner pour lancer le scanning"
    ok = true;
    if (newState == RangerTransportStates.TransportFeeding) {
    document.getElementById('StartFeeding').disabled = true;
    document.getElementById('ChangeOptions').disabled = true;
    document.getElementById('Shutdown').disabled = true;
    document.getElementById('StopFeeding').disabled = false;
    document.getElementById('UserInstructions').innerHTML = "<b/>Scanning... <br/> Appuyer sur Arret scanning pour stopper le scanning";
    //getstatus();
    document.getElementById('Status').innerHTML = 'Etat: ' + Ranger.GetTransportStateString();
    </script>
    <script type="text/javascript" event="TransportChangeOptionsState(previousState)" for="Ranger">
    //Fired when Ranger reaches the change option state, input params are previous state
    //getstatus();
    document.getElementById('Status').innerHTML = 'Etat: ' + Ranger.GetTransportStateString();
    </script>
    <script type="text/javascript" event="TransportReadyToFeedState(previousState)" for="Ranger">
    i = 0;
    struchtml = "";
    htmlStrucArray = new Array();
    //Fired when ranger is ready to feed the next item
    document.getElementById('Status').innerHTML = 'Etat: ' + Ranger.GetTransportStateString();
    //getstatus();
    </script>
    <script type="text/javascript" event="TransportFeedingStopped(reason,itemsFed,itemsrequested)" for="Ranger">
    //Fired when feeding has stopped
    document.getElementById('Status').innerHTML = 'Etat: ' + Ranger.GetTransportStateString();
    //getstatus();
    </script>
    <script type="text/javascript" event="TransportItemInPocket(itemID)" for="Ranger">
    //Fired when the item has been fed into the pocket
    var RangerSides = {
    TransportFront : 0, TransportRear : 1
    var RangerImageColorTypes = {
    ImageColorTypeBitonal : 0, ImageColorTypeGrayscale : 1, ImageColorTypeColor : 2
    //alert(Ranger.GetGenericOptionFileName());
    Ranger.SetGenericOption("OptionalDevice", "NeedFrontImage1", true);
    Ranger.SetGenericOption("OptionalDevice", "NeedRearImage1", true);
    // Date du jour
    var datedujour = new Date();
         var day = datedujour.getDate();
         var month = datedujour.getMonth()+1;
    if(month < 10){month = "0"+month};
         var fullYear = datedujour.getYear();
    var Repertoire = day+"-"+month+"-"+ fullYear;
    var cmc7 = Ranger.GetMicrText(1);
    var codeChq = cmc7.substring(1, 8);
    var codeBq = cmc7.substring(10, 22);
    var codeRib = cmc7.substring(24, 36);
    var cmc7_affiche = codeChq + ' ' + codeBq + ' ' + codeRib;
    cmc7 = codeChq + '_' + codeBq + '_' + codeRib;
    document.getElementById('CMC7').innerHTML = 'CMC7= ' + cmc7_affiche;
    // alert(cmc7);
    cmc7R = cmc7 + "_R.jpg";
    // alert(Ranger.GetImageAddress(RangerSides.TransportFront, RangerImageColorTypes.ImageColorTypeGrayscale))
    temp = Ranger.SaveImageToFile(RangerSides.TransportFront, RangerImageColorTypes.ImageColorTypeGrayscale, "C:\\IT\\images\\" + cmc7R);
    temp = Ranger.SaveImageToFile(RangerSides.TransportFront, RangerImageColorTypes.ImageColorTypeGrayscale, "C:\\IT\\"+Repertoire+"\\" + cmc7R);
    cmc7V = cmc7 + "_V.jpg";
    temp = Ranger.SaveImageToFile(RangerSides.TransportRear, RangerImageColorTypes.ImageColorTypeGrayscale, "C:\\IT\\images\\" + cmc7V);
    temp = Ranger.SaveImageToFile(RangerSides.TransportRear, RangerImageColorTypes.ImageColorTypeGrayscale, "C:\\IT\\"+Repertoire+"\\" + cmc7V);
    document.getElementById("LIST").innerHTML += "<input type=\"hidden\" name=\"Img_chq\" value='" + cmc7R + "'/>" + cmc7_affiche + " (Recto)<br/>";
    document.getElementById("LIST").innerHTML += "<input type=\"hidden\" name=\"Img_chq\" value='" + cmc7V + "'/>" + cmc7_affiche + " (Verso)<br/>";
    document.getElementById('Status').innerHTML = 'Etat: ' + Ranger.GetTransportStateString();
    //getstatus();
    </script>
    <script type="text/javascript" event="TransportNewItem()" for="Ranger">
    // Fired when a new item has entered the track
    document.getElementById('Status').innerHTML = 'Etat: ' + Ranger.GetTransportStateString();
    //getstatus();
    </script>
    <script type="text/javascript" event="TransportShutDownState(currentState,previousState)" for="Ranger">
    //Fired when the Ranger control has been shutdown
    document.getElementById('Status').innerHTML = 'Etat: ' + Ranger.GetTransportStateString();
    //getstatus();
    </script>
    <script type="text/javascript" event="TransportSetItemOutput(itemID)" for="Ranger">
    //fired when the item is ready to have params set(pocketing decisions)
    document.getElementById('Status').innerHTML = 'Etat: ' + Ranger.GetTransportStateString();
    //getstatus();
    </script>
    <!-- End of Events ------------- -->
    </head>
    ........ html code
    Edited by: nesta on 12 août 2011 12:28

  • Passing parameters to included JSP files using JSF

    I have included JSP, which I use in many other JSP files. I want to display message in this included JSP which depends on the information in JSP files which include this JSP. How can I do this without using scriptlets?
    Message was edited by:
    cheltsov

    I have one included page in one jsp page(mother page). I have included it by jsp:include tag. The included page consists of two inputText. I need to pass the parameters of the mother page together with the parameters in the included page in the backingBean of the mother page. Hope this one is clearer.
    The code snippet in the mother page looks like this
    <jsp:include page="/pages/ps/sample_rep2.jsp"/>.
    In the sample_rep2.jsp, I have two inputText. How can I pass this in the backingBean of the motherpage.
    The sample_rep2.jsp is the included page here. The sample_rep2.jsp looks like this:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af"%>
    <af:panelBox>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af"%>
    <af:panelBox>
    <af:inputText label="User ID" id="userid" value="CDOUGLAS"/>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
    <%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af"%>
    <af:panelBox>
    <af:inputText label="User ID" id="userid" />
    <af:inputText label="Age" id="age"/>
    </af:panelBox>

  • How to dynamically include jsp files using jsf el in include tag ?

    Hi,
    I'm trying to get the jsp file name from my backing bean to use it in an include tag but I can't make it work
    When using this piece of code I can get the generated path
             <h:outputText value="/_partial/#{myBean.jspName}.jsp"/>whereas in this code the jsf el is not replaced by this value.
            <%@ include file="/_partial/#{myBean.jspName}.jsp" %> Have you any idea of how to solve this ? I'm currently developing for J2EE 1.4 platform.     
    Thanks for your help,
    Regards.

    If you're using JSF 1.2 and JSTL 1.2 at a JSP 2.1 environment, then you can just use <jsp:include> with unified EL.
    If you're using JSF 1.1, then you may find this article useful [http://balusc.blogspot.com/2007/01/dynamic-jsf-subviews.html]

  • Removing scrollbars on the JSP page of frames created by included JSP files

    Hi All,
             In the iternet sales B2B application which we are developing, has a blank JSP file. Wherein we are adding other JSP files on it, loading trough JS.
    When we are adding it is making the various jsp files in the form of the frames, and each frame has different JSP page. So it is adding scrollbars on each frame if the size of the page exceeds the size of frame.
    we don't want the scrollbars. Kindly suggest to remove these scrollbars, and all the pages should look as a single JSP page.
    Thanks & Regards
    EKta

    Hi
    set scrolling="no" while creating frames
    Murali.K.N

  • Servletcontext,RequestDispatcher , including jsp files

    I have 2 deployed application (app1 and app2 ) . These are 2 separated applications.
    Here is the applications structure
    app1.ear
    app1/
    ----META-INF/
    ----app1.war
    ----app1/
    --------WEB-INF/
    --------startApp1.jsp
    URL mapping to app1Root
    app2.ear
    app2/
    ----META-INF/
    ----app2.war
    ----app2/
    --------WEB-INF/
    ---------------classes/
    ---------------lib/
    ---------------tlds/
    --------startApp2.jsp
    URL mapping to app2Root
    What I would like to do is to include app2's startApp2.jsp, in my app1's startApp1.jsp.
    I tried the follwing approach:
    In startApp1.jsp I had these code:
    RequestDispatcher rd = getServletContext().getContext("/app2Root").getRequestDispatcher("startApp2.jsp");
    rd.include(request, response);
    when I run http://myhost/app1Root/startApp1.jsp
    startApp2.jsp is displayed inside startApp1.jsp.
    But all the links in startApp2, now are using the app1 root context that is (app1Root). (startApp2.jsp contains submitt, links,... to other pages inside app2)
    appreciate any help
    regards

    Russel,
    I am assuming that all of your links in your startApp2.jsp are relative. If this is the case then they will be relative to the current location. For example if your current URL is 'http://host/app1' the link is 'mypage.jsp' it will be for the URL 'http://host/app1/mypage.jsp'.
    However, if the URL is '/app2/mypage.jsp' then the URL should be 'http://host/app2/mypage.jsp'.
    The '/' at the start denotes that the URL is relative to the root of the server.
    Rob Cole

  • Include jsf file in a jsp page

    Hi Everyone,
    I have a plain jsp page with no JSF Components, but it has a jsp:include tag which is another jsp file which contains jsf components.
    When i try to run the plain jsp file ... i get the following error...
    java.lang.IllegalStateException: Cannot forward after response has been committed
         at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:324)
         at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312)
         at com.sun.faces.context.ExternalContextImpl.dispatch(ExternalContextImpl.java:322)
         at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:147)
         at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:87)
         at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
         at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:117)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:198)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
         at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:589)
         at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
         at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
         at org.apache.jsp.DynamicWebpart_jsp._jspService(DynamicWebpart_jsp.java:278)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
         at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:589)
         at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
         at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
         at org.apache.jsp.Webpart_jsp._jspService(Webpart_jsp.java:302)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
         at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:703)
         at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:589)
         at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:499)
         at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:966)
         .......... so.....on........
    I saw the source code for the plain jsp file and the error is because of including the jsp file with jsf components.
    The contents of both the jsp file is given below
    Plain jsp file
    DWStaticJSP.jsp
    <%@ page import="java.util.*" %>
    <%@ page import="com.mirus.bi.jsp.*" %>
    <%@ page import="com.mirus.bi.util.Log" %>
    <% Log.logDbg("*******before calling the faces file from DWStatic :"+rSetting.getStaticJSPFileName()); %>
    // name of the file name : /faces/report_palm.jsp
    <jsp:include page="<%=rSetting.getStaticJSPFileName()%>" flush="false" >     
                   <jsp:param name="DMode" value="DBoard" />
    </jsp:include>
    Jsp file with JSF component
    it is stored in faces folder
    /faces/report_palm.jsp
    <%@ page contentType="text/html" %>
    <%@ page import="com.mirus.bi.util.Log" %>
    <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
    <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
    <%@ taglib uri="http://mirus.com/jsftaglib" prefix="my" %>
    <f:view>
              <h:outputText value="Store Name:" />
              <h:outputText value="#{palmReportUIHandler.currentStoreDisplay}" />
              <h:outputText value="Year:" />
              <h:outputText value="#{palmReportUIHandler.currentYear}" />
              <h:outputText value="Month:" />
              <h:outputText value="#{palmReportUIHandler.currentMonth}" />
    </f:view>
    The Configuration in the web.xml for faces Servlet is given below
    <servlet>
    <servlet-name>FacesServlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <!-- Faces Servlet Mapping -->
    <servlet-mapping>
    <servlet-name>FacesServlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    Does anybody know the solution to this problem
    Any kind of help will be highly appreciated.
    Pinkesh

    Hi Adam Winer,
    I want to try your solution.
    just wanted some more clarification .....
    So, let's say you have:
    DWStaticJSP.jsp: plain JSP
    report_palm.jsp: JSF JSP included by DWStaticJSP.jsp
    What you should do is use an URL of:
    /faces/DWStatic.jsp
    to access the outer plain JSP (yes, even though it's not really a faces page), and then have
    /faces/DWStatic.jsp include just plain /report_palm.jsp.
    In essence, the critical thing is that the FacesServlet wraps the entire request - FacesServlet cannot run
    for just a piece of the request.My question is where should i store the DWStatic.jsp file ... As u said i should acces it using /faces/DWStatic.jsp do i need to save it in the faces folder or just in the web app root.
    I cant save the DWStatic.jsp in the faces folder as this file is used for lot of different purpose in my company application.
    So can u give me a solution where in i can keep the DWStatic.jsp in the web-root folder and still try your solution
    Also is this the right setting for facesServlet in the web.xml.
    <servlet>
    <servlet-name>FacesServlet</servlet-name>
    <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>
    <!-- Faces Servlet Mapping -->
    <servlet-mapping>
    <servlet-name>FacesServlet</servlet-name>
    <url-pattern>/faces/*</url-pattern>
    </servlet-mapping>
    Whatever follows below this line is the describtion of the web appp structure which i have in my company.
    We have an application where in all the jsp files are stored in the web-app root folder.....
    I will be using alphabets like a.jsp ... b.jsp .... to keep the explanation small...
    I have an a.jsp file which includes a b.jsp file which in turn includes a c.jsp......
    Now we have started using JSF.....
    Now as a developer .... i want the c.jsp to include a d.jsp file which contains JSF components...
    The thing is i cant change the location of a.jsp, b.jsp and c.jsp......
    Can u tell me how i should call " a.jsp" ... imean the url so that the "d.jsp" file gets processed properly.
    Also where should i save all the jsp files and what config is requiered in the web.xml for your solution
    I thank you for your help
    Pinkesh

  • Custom tag in included JSP page cause exception (WLS 5.1 SP 9)

              An application use custom tags (JSP Tag extensions) in JSP page
              included into another JSP page by means <jsp:include> instruction.
              After we had installed Service Pack 9 for Weblogic 5.1
              browser's call of including JSP began show an error.
              When I remove Weblogic510sp9.jar and Weblogic510sp9boot.jar
              references from startWebLogic.cmd, the error diagnostic disappear.
              Is Service Pack Number 9 wrong?
              ==========================
              Web browser diagnostic:
              Error 500--Internal Server Error
              From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
              10.5.1 500 Internal Server Error
              The server encountered an unexpected condition which prevented it from fulfilling
              the request.
              ==========================
              Console diagnostic:
              Tue Jun 05 17:40:14 MSD 2001:<I> <WebAppServletContext-dscat> looking for taglib
              uri /exttags.tld as resource /WEB-INF/e
              xttags.tld in Web Application root:
              Tue Jun 05 17:40:15 MSD 2001:<I> <WebAppServletContext-dscat> Generated java file:
              C:\weblogic\dscat\WEB-INF\_tmp_war_ds
              cat\jsp_servlet\_jsp\_opos\_catalog.java
              Tue Jun 05 17:40:25 MSD 2001:<E> <WebAppServletContext-dscat> Servlet failed with
              Exception
              java.lang.VerifyError: (class: jsp_servlet/_jsp/_opos/_catalog, method: _jspService
              signature: (Ljavax/servlet/http/Http
              ServletRequest;Ljavax/servlet/http/HttpServletResponse;)V) Register 12 contains
              wrong type
              at java.lang.Class.newInstance0(Native Method)
              at java.lang.Class.newInstance(Unknown Source)
              at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:469)
              at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java,
              Compiled Code)
              at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:442)
              at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:228)
              at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:200)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:115)
              at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:138)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:915)
              at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:879)
              at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
              at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:365)
              at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253)
              at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
              ==========================
              Including JSP file:
              <%@ include file="catalog_real.jsp" %>
              ==========================
              Included JSP file:
              <%@ taglib uri="/exttags.tld" prefix="dscat" %>
              <dscat:pageheader>Catalog header</dscat:pageheader>
              ==========================
              Tag extansions library (WEB-INF/exttags.tld file):
              <?xml version="1.0" encoding="ISO-8859-1" ?>
              <!DOCTYPE taglib
              PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
                   "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
              <taglib>
              <tlibversion>1.0</tlibversion>
              <jspversion>1.1</jspversion>
              <shortname>dscat</shortname>
              <tag>
              <name>pageheader</name>
              <tagclass>ru.ibs.xbcat.view.tag.PageHeader</tagclass>
              </tag>
              </taglib>
              ==========================
              Class PageHeader:
              package ru.ibs.xbcat.view.tag;
              import java.io.*;
              import javax.servlet.jsp.*;
              import javax.servlet.jsp.tagext.*;
              public class PageHeader extends BodyTagSupport {
              public int doStartTag() throws javax.servlet.jsp.JspException {
              return BodyTag.EVAL_BODY_TAG;
              public int doAfterBody() throws javax.servlet.jsp.JspException {
              return(SKIP_BODY);
              

              Are you using Jikes? See if this helps ...
              http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.jsp&item=6287&utag=
              Mike
              "Radik Usmanov" <[email protected]> wrote:
              >
              >An application use custom tags (JSP Tag extensions) in JSP page
              >included into another JSP page by means <jsp:include> instruction.
              >
              >After we had installed Service Pack 9 for Weblogic 5.1
              >browser's call of including JSP began show an error.
              >When I remove Weblogic510sp9.jar and Weblogic510sp9boot.jar
              >references from startWebLogic.cmd, the error diagnostic disappear.
              >
              >Is Service Pack Number 9 wrong?
              >==========================
              >Web browser diagnostic:
              >
              >Error 500--Internal Server Error
              >From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
              >10.5.1 500 Internal Server Error
              >The server encountered an unexpected condition which prevented it from
              >fulfilling
              >the request.
              >
              >==========================
              >Console diagnostic:
              >
              >Tue Jun 05 17:40:14 MSD 2001:<I> <WebAppServletContext-dscat> looking
              >for taglib
              >uri /exttags.tld as resource /WEB-INF/e
              >xttags.tld in Web Application root:
              >Tue Jun 05 17:40:15 MSD 2001:<I> <WebAppServletContext-dscat> Generated
              >java file:
              >C:\weblogic\dscat\WEB-INF\_tmp_war_ds
              >cat\jsp_servlet\_jsp\_opos\_catalog.java
              >Tue Jun 05 17:40:25 MSD 2001:<E> <WebAppServletContext-dscat> Servlet
              >failed with
              >Exception
              >java.lang.VerifyError: (class: jsp_servlet/_jsp/_opos/_catalog, method:
              >_jspService
              >signature: (Ljavax/servlet/http/Http
              >ServletRequest;Ljavax/servlet/http/HttpServletResponse;)V) Register 12
              >contains
              >wrong type
              > at java.lang.Class.newInstance0(Native Method)
              > at java.lang.Class.newInstance(Unknown Source)
              > at weblogic.servlet.internal.ServletStubImpl.createServlet(ServletStubImpl.java:469)
              > at weblogic.servlet.internal.ServletStubImpl.createInstances(ServletStubImpl.java,
              >Compiled Code)
              > at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubImpl.java:442)
              > at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:228)
              > at weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:200)
              > at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:115)
              > at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:138)
              > at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:915)
              > at weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:879)
              > at weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:269)
              > at weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:365)
              > at weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:253)
              > at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled
              >Code)
              >
              >==========================
              >Including JSP file:
              >...
              > <%@ include file="catalog_real.jsp" %>
              >...
              >
              >==========================
              >Included JSP file:
              >...
              > <%@ taglib uri="/exttags.tld" prefix="dscat" %>
              >...
              ><dscat:pageheader>Catalog header</dscat:pageheader>
              >...
              >==========================
              >Tag extansions library (WEB-INF/exttags.tld file):
              >
              ><?xml version="1.0" encoding="ISO-8859-1" ?>
              ><!DOCTYPE taglib
              > PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
              >     "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
              >
              ><taglib>
              > <tlibversion>1.0</tlibversion>
              > <jspversion>1.1</jspversion>
              > <shortname>dscat</shortname>
              >
              > <tag>
              > <name>pageheader</name>
              > <tagclass>ru.ibs.xbcat.view.tag.PageHeader</tagclass>
              > </tag>
              >
              ></taglib>
              >==========================
              >Class PageHeader:
              >
              >package ru.ibs.xbcat.view.tag;
              >
              >import java.io.*;
              >import javax.servlet.jsp.*;
              >import javax.servlet.jsp.tagext.*;
              >
              >public class PageHeader extends BodyTagSupport {
              >
              > public int doStartTag() throws javax.servlet.jsp.JspException {
              > return BodyTag.EVAL_BODY_TAG;
              > }
              >
              > public int doAfterBody() throws javax.servlet.jsp.JspException {
              > ...
              > return(SKIP_BODY);
              > }
              >}
              >
              

  • How to include .js file in jsp file?

    hi,
    i have a jsp file with struts tag. right now i have all the javascript code as a separate function inside the jsp file itself. i want the javascript code to be present in a .js file and i want to refer that .js file from the jsp file with struts tags.
    <html:text property="Phone" value="" size="3" maxlength="3"
         onkeyup="return autoTab(this, 3, event);"></html:text>
    the above is the html tag which will call the function "autoTab" of the .js file. please help.
    thanks,
    Jayanth.

    You include javascript into a jsp in exactly the same way you do with html
    <script src="myJavascriptFile.js"/>
    It has nothing to do with the jsp per se, but rather the generated HTML page.

  • How to include a .js file into .jsp file.[.js file resides in a package]

    Hi,
    How do i include an external .js(JavaScript) file into a JSP file?My .js file is located in some package(lets say abc.jar). Below is my application structure:-
      jsp
       |
       ->MyJsp.jsp
      lib
       |
       |
    abc.jar
        |
        |
        ->com.abc.test
                     |
                     |
                     ->Test.java
                     ->abc.jsHow do i include "abc.js" file in "MyJsp.jsp" file?
    Please help.
    Thanks,
    Kiran
    Edited by: Adimulam on Jun 2, 2008 1:22 PM

    Even this is also not possible because, the code in that package is developed by DWR and i am just adding it to my lib folder and importing the respective classes. In the same manner i need to include the *.js* file in the JSP.It took me about 3 minutes reading through the [DWR Getting Started|http://getahead.org/dwr/getstarted] page to learn that you don't have to do any of that. Perhaps you should read that page?

  • How can i include a jsp file in servlet?

    hi
    i generate a dynamic page from servlet.
    i need to include a jsp file in same servlet.
    i try like this --
    out.println("<HTML>");
    out.println("<HEAD><TITLE>First</TITLE></HEAD>");
    out.println("<BODY>");
    out.println("<%@ include file=\"abc.jsp\">");
    out.println("<FORM>");
    out.println("</FORM>");
    out.println("</BODY>");
    out.println("</HTML>");

    Replace your line with
    RequestDispatcher rd = request.getRequestDispatcher("abc.jsp");
    rd.include(request, response);

  • How can i include a file in my JSP

    hello i have one jst who need to use an instance of a class called Part I need to include that file in my JSP but How do i do that
    How do i import my Part.java class in my JSP ???

    At the top of your JSP:
    <%@ import="package.*, package.Class" %>or you could do this:
    <%jsp:useBean class="package.Class" id="CLASS" scope="page" />or you can use a servlet as an include and have it write HTML back to the JSP:
    <jsp:include page="MyServlet">
         <jsp:param name="PARAM1" value="data1"/>
         <jsp:param name="PARAM2" value="data2"/>
    </jsp:include>

Maybe you are looking for