Jsp:include issues

I have been scouring the internet trying to find the answer to this. I am trying to impliment jsp:include in one of my assignments for school, and the only problems I have with it is that when looking at references, nobody tells you how to access the passed parameter. It's probably just so simple that I'm not seeing it right in front of me, but if anybody could shed some light on this, I would really appreciate it.

I apologize. It was so simple that I wasn't seeing it. Please never mind. ^_^

Similar Messages

  • OC4J 10.1.3.1 and Spring - jsp:include issues

    Hi,
    I've got a strange problem when using OC4J 10.1.3.1 together with Spring framework.
    I have several controllers in spring that generate things like page headers, footers, and other common elements. Historically I've merged these into a page with jsp:include or a c:import directive in the page.
    However, with the newer versions of OC4J, it will retrieve the content for the first request, and then repeat that same content for each subsequent request.
    If I replace that controller request with a direct .jsp page request, those elements are inserted and merged without any problem into the main page.
    I haven't had this problem on other servers... nor have I had the problem with OC4J until the latest release... Does anybody have an idea how to allow me to merge this Spring-Controller generated content with a jsp page successfully?
    thanks!

    Sure, I've examined it a few times when I've adjusted various JSP options.. mostly around the tag handling. By the way, right now I have Tag Resuse Default set to "compiletime with release", though I've tried the other options as well.
    __ojsp_s_out.write(__oracle_jsp_text[0]);
    /*@lineinfo:translated-code*//*@lineinfo:6^5*/ {
    String __url=OracleJspRuntime.toStr("/global/globalHeader.do");
    // Include
    pageContext.include( __url,false);
    if (pageContext.getAttribute(OracleJspRuntime.JSP_REQUEST_REDIRECTED, PageContext.REQUEST_SCOPE) != null) return;
    /*@lineinfo:generated-code*/
    __ojsp_s_out.write(__oracle_jsp_text[1]);
    /*@lineinfo:translated-code*//*@lineinfo:11^1*/ {
    String __url=OracleJspRuntime.toStr("/global/globalNav.do");
    // Include
    pageContext.include( __url,false);
    if (pageContext.getAttribute(OracleJspRuntime.JSP_REQUEST_REDIRECTED, PageContext.REQUEST_SCOPE) != null) return;
    /*@lineinfo:generated-code*/
    __ojsp_s_out.write(__oracle_jsp_text[5]);
    /*@lineinfo:translated-code*//*@lineinfo:35^1*/ {
    String __url=OracleJspRuntime.toStr("/global/globalFooter.do");
    // Include
    pageContext.include( __url,false);
    if (pageContext.getAttribute(OracleJspRuntime.JSP_REQUEST_REDIRECTED, PageContext.REQUEST_SCOPE) != null) return;
    There are three obviously.. and with this page execution I see the first one (globalHeader.do) duplicated three times in the final page.
    thanks!

  • Jsp include issue

    hi
    i've tested a new version of my jsp include file (a header which is referenced by about 40 pages) on one jsp page, and its wokred ok. i've changed the coding of the include page though none of the other jsp pages have picked up the new include and are still looking to the old one ? i've stopped and started tomcat but its till not changed.
    does anyone have any ideas ? i've included a couple of new tag libraries but they are working ok and i cant see why it would be anything other than tomcat ? should i try stopping the app itself ?
    cheers
    chris

    not restart, you need to clear the work directory, or at least modify all the files that use the included file to get them to recompile. The server doesn't check for changes in included files for some reason.

  • NetWeaver EE 5 jsp include action issue

    Under NetWeaver EE 5 trial version I encounter the following problem:
    page buffer is always flushed before jsp:include.
    By default flush must default to "false", but either I specify flush="false" or miss the attribute - the buffer is always flushed.
    Also the reason is not in buffer size - I make it large enough but the issue remains.

    A.jsp says <jsp:include page="dir/B.jsp"/> and dir/B.jsp says <%@include file="C.jsp" %>. In this case the relative specification C.jsp resolves to dir/C.jsp.
    In this case the jsp:include is the equivilent of a RequestDispatcher.include. This can be view as the request being passed on to dir/B.jsp which will act on th erequest as if it came from a browser. the dir/B.jso then resloves all relative urls based on it's location in the dir directory. This is runtime binding.
    A.jsp says <%@include file="dir/B.jsp" %> and dir/B.jsp says <jsp:include page="C.jsp" />. In this case the relative specification C.jsp resolves to C.jsp."
    This is an example of compile time binding. When the servlet container translates A.jsp into sevlet code it includes the code from dir/B.jsp into A.jsp's servlet code. When you reach the include of C.jsp it is inside the servlet code of A.jsp and is resolved based on the location of A.jsp.

  • Reusing the same jsp include multiple times on the same page

    If someone knows a way out of this
    I'd like to print out 2 records of the same data type I have a JSP include which does that.
    Now my issue is how to use the same include twice on the same page
    Ideally I would like to do the following:
    <%
    request.setAttribute("person", person1);
    %>
    <jsp:include page="./person.jsp"/>
    <%
    request.setAttribute("person", person2);
    %>
    <jsp:include page="./person.jsp"/>
    And in person.jsp
    I could have
    <h:inputText name=#{person.name}/>
    This fails in the updateModel phase - And I realize why it's failing. There really is no person managed bean.
    It's just that I am at a kind of loss as to what I need to do now -
    Am missing something or is it just impossible to use jsp:includes the way Ive tried to?

    I do not understand, have you created a backing bean named person? Have you defined it in your config file?
    Please copy/paster your backing bean code and config file.
    Normally, you can set directly the value of the bean by using some java code in your jsp instead of setting the request attribute.

  • JSP include problem

    I am facing problems with the JSP include functionality in my project.
    What I want to do is to include jsp files on the fly i.e depending on the business need I should be able to swap in and out jsps from the main jsp.
    I plan to do this by feeding the file names in a request attribute and then including the files in the order given.
    But on using the jsp:include there is no output generated by the included jsp.
    There is no error either in the log or in the page directly.
    Please help me in finding out what exactly is the issue here.
    the files are index.jsp --> rightRailIncludeFiles.jsp --> dynamically loaded jsps (These may themselves contain other included files)
    index.jsp
    <div id="right" class="testRight">
        <%@ include file="rightRailIncludeFiles.jsp" %>
    </div>
    rightRailIncludeFiles.jsp
    <%
        out.println("<h1>Dyna Include</h1>");
        String fileNames = (String)request.getAttribute("jspFiles");
        String[] fileList = fileNames.split(",");
        out.println("<!-- Files : " + fileNames + " -->");
    %>
    <%
    for(int i=0;i<fileList.length;i++) {
        try {
             out.print("<!-- "+fileList[i]+" -->");
    %>
        <jsp:include page="<%=fileList%>" flush="true"/>
    <%
    } catch(javax.servlet.ServletException e) {
    out.println("<h3 style=\"color:red\"> Error :"+e.getMessage()+"</h3>");
    %>
    *inlude_1.jsp (This file includes another file which has some common code)*<jsp:include page="include/inlude_1.jsp" flush="true">
    <jsp:param name="magicNumberText" value="${request.adMagicNumberText}" />
    <jsp:param name="setType" value="${request.adSetType}" />
    <jsp:param name="width" value="${request.adWidth}" />
    <jsp:param name="height" value="${request.adHeight}" />
    <jsp:param name="adOuterDivClass" value="${request.adOuterDivClass}" />
    </jsp:include>
    Edited by: danbrown on Feb 9, 2009 2:49 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    Good morning,
    I am not sure that could be the real problem , but I guess your app server does not like the fact that you broke the try catch in two parts. In any case, you should not do that :) Mixing code and display is very painful for maintenance :)
    Have you tried to remove the jsp:include and see if the output is correctly produced?
    Best Regards
    Edmondo

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

  • JSP Precompilation Issue:

    I'm trying to precompile my JSPs so that the .class files can be included along with the WAR.
    For this pre-compilation , i'm using the jspc ANT task.
    I have the following issues:
    1) A number of JSPs have HTML pages included in them.
         Say my JSPs are in a folder : jsp
         and HTMLs in a folder :html
         The JSPs include the HTML with this TAG :
              <%@ include file="//html/myHtml.html" %>
         When i try to run the jspc task for the first time, I get an exception indicating that //html/myHtml.html has not been found.
         I do not make any changes, but run the ant task again, The JSPs are convered to Java files.
         I'm not able to figure out what happens the first time i run the ant task
    2) Once i run the jspc task, i run the javac task to compile the JSP converted JAVA files.
    Since a lot my JSPs have other JSPs included in them, i get several compilation errors caused by the included JSPs
    Should the JSPs be compiled in the order that they are included in the JSPs?
    3) I'm using Tomcat 4.1. to host the web appln. What are the modifications i need to make to use pre-compiled JSPs in the WAR file?

    Simply change the file extent on the JSPs that are only included. The extent ".jspf" (JSP fragment) is a reasonable convention.

  • Static JSP Include throws Errors

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

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

  • JSP Include benefits

    HEllo all,
    I have a small web based application using JSPs and was wondering what the benefits are to using JSP:Includes?
    I have used them currently in the case where I have the same content on numerous pages and the content can be quite large.
    I also have repeated data on numerous pages where the content is quite short. Is there any benefit to using Includes when the content is so small? (ie a form with 2 fields, a submit and a reset)
    Is there the potential for overuse of Include statements that will slow things down over statically including the content in the HTML?
    W

    Okay I can, and have, seen these advantages. But for simple html form items with no real hope of ever being changed, does it make sense to have them in an include file?
    Also here is my other issue. I have a totally localizable application that stores each and every viewable string in a ResourceBundle and the pages are displayed based on the current locale of the client. In order to do this, some strings are in the included fiels and some are in the including file. Both require the Bean to find the localized string......and when I include a page like so, I get a duplicate Bean name error because it thinks I have instatiated the bean multiple times...so then each included page must have it's own name for the bean.....and things seem to be more trouble than they are worth....
    Any input on this?

  • JSP complilation issue (JAVAC message file is broken)

    i am facing a jsp compilation issue with error message JAVAC message file is broken .
    i have one main jsp in which i have one module of about 4000 line of coding.i splitted this file in 4 segments and included them in main jsp. Each segment is included using
    <jsp:include page="Module_ProductsTab_PAOChangeValid_Apply.jsp" flush="true">
    <jsp:param name="adspot" value="dotcom3" />
    <jsp:param name="page" value="ProdTab" />
                             </jsp:include>
    tag , but now it takes as much long time to load that would result in page timeout.
    can anyone give me input how i handle this issue?

    This sounds like a corrupt installation.
    Try uninstalling java and re-installing it. (With 1.4.2_04 if you can)

  • Another Include Issue

    Hi, I'm running tomcat behind a router (no problems there) and I'm running a cheapo file server behind a blocked port (control limited by jsp sessions). The problem is that I can't seem to get a page included possible because the fileserver doesn't spit out a webpage with a name in the URL.
    This is my include line:
    <%String url="http://192.168.1.71:11511"; %>
    <jsp:include page="<%= url%>" flush="true" />
    So, if i were to copy that url and past it into the address bar, i'll get a page spit out by the file server, but I can't see any page name.. Is this a problem?
    BTW, I'm using WWW File Share as the file server.

    Hi,
    If I'm correct you can't include files through a http request. The file may be either local or in a mapped directory on the server/cluster. I could be wrong here but I think that's the issue.
    One way around that may to map the server as a drive on the server running the web application, if possible and then include the files from the mapped drive.
    Just my 2 cents :)
    dapanther..

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

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

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

  • Jsp:include static svg does not work

    I am running tomcat4- and I have a jsp file that outputs svg content like so:
    <?xml version="1.0" encoding="US-ASCII"?>
    <%@ page contentType="image/svg+xml"%>
    This works fine- the problem is that up until now I have included other svg widgets like this:
    <g id="radio_off" >
                   <%@ include file="../graphics/radioButton.svg" %>
              </g>
    which also works just fine. Now, I have to change this to pass in a dynamic directory containing the image (there will be various directories with same file name- I determine at runtime which directory to use)- so I have to use a jsp:include instead.
    When I do this:
    <g id="radio_off" >
    <jsp:include page="graphics/radioButton.svg" flush="true"/>
              </g>
    When it is run I just get:
    g id="radio_off" >
              </g>
    Just blank inside the <g> . If I change radioButton.svg to radioButton.jsp and say:
    g id="radio_off" >
    <jsp:include page="graphics/radioButton.jsp" flush="true"/>
              </g>
    Then I get what I expect with
    g id="radio_off" >
    <svg width="15" height="15">
    ....and so on
              </g>
    I thought jsp:include would include the static content of a file (like html or svg), but apparently only the OUTPUT of that file.....
    Is this correct- I cannot get my svg content to be included in the svg by using jsp:include or am I missing something?
    I think it will be strange that I have to rename all my svg files jsp to get them included...Anu ideas???
    Thanks,
    Jim

    Michael,
    You are right- I reread your post more closely and saw that you are suggesting to basically just map all my static files (like the .svg) into .jsp extensions- which is basically what I was asking was true- that for svg, xml, htm, any static content to be included as in the <%@include directive but using the action <jsp:include it needs to either be changed to the extension .jsp or, as you suggested, mapped in the web.xml to .jsp. I have remapped my svg to .jsp so as to preserve their .svg extensions- (of course now the first user is hit by about 20 jsp:init's on that page!!- but is then cached as in all jsp's).
    I guess kinda makes since since the include action gets the actual response from the page (which is blank image)- but as jsp it is the actual code....Well needed confirmation- and that's what I got along with the reminder to use the mapping in web.xml.
    So thanks alot- even put extra duke in for you !!
    Jim

  • Jsp:include does not work in 8.1 SP3?

    Hi all,
              I need to include a local file (external to the app) in jsp code. The external file includes an image map which changes very so often. So in order to avoid doing a build everytime, I thought about keeping the image map in a file which can be "included" in the jsp file, making it very dynamic to a change.
              So I have a servlet which will read this file and output the contents to response.getWriter(), which will be included in calling jsp code.
              But the jsp file does not seem to call the servlet at all.
              Here is the code in the jsp file:
              <%
              String sFileUrl = "/Prj/RenderReport?file=OrgChart.html";
              %>
              <jsp:include page="<%=sFileUrl%>" />
              What am I doing wrong? Is this not possible at all?
              Thank you all in advance.

    hi pjoshi,
              <jsp:include page="hello.jsp" /> tag is working fine in weblogic 8.1 sp3.
              I think it might be syntax error in your jsp page.
              This is the syntax to including dynamic files in jsp using <jsp:include page="" />tag as given below.
              <jsp:include page="{relativeURL | <%= expression %>}" flush="true" />
              go through the below link and you will find exact information how to include dynamic files in jsp using <jsp:include page=""/>
              http://java.sun.com/products/jsp/syntax/1.1/syntaxref1112.html
              --Anilkumar kari                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

Maybe you are looking for

  • How can I transfer my music library playlists from ipod to computer itunes library?

    I have a new computer and would like to know how to transfer my entire music collection/playlists from my ipod back to my itunes library.

  • Mobile Data Switching on

    Hi I have just received a replacement 701 phone and  set it up  I do not use Mobile data  due to cost   I only switch on if desperate  so mainly use wi-fi  so Mobile data is switched off  The last two days when behave come to the phone mobile data ha

  • HttpURLConnection : unable to use cookie to go to next page

    Hi, I'm trying to login a form by using java application. I'm successfully login in and http return 200 response code for me. i had set the cookie for the page. Now, i try to access the another page of the web and it seems like unable to use the cook

  • Deleted Time Machine Backups from Finder

    I back up my MacBook with Time Machine. My girlfriend has an older MacBook Pro, with Tiger. I was surprised to see that Tiger did not come with any sort of backup utility, and I eventually found Super Duper. I made a backup with Super Duper to my ext

  • ITunes 11.0.1 stops working wile playing movies or music...

    In the last few days iTunes has stopped working as it once did ( I'm not referring to v10 ). Playing music, watching a podcast or a movie... After a few seconds / minutes / hours... iTunes seems to be paused, sometimes it starts playing again other t