Include a JSP inside another JSP

Hi SDN,
I am stuck with a problem. There is a JSP file available. In this JSP I have to add some more fields. But when I try to ad new fields I am getting a Portal Runtime Error stating that "Code Too Large". So now I thought of putting the new code in another JSP and include that JSP inside my main JSP. Here I cannot use <@include file="..."> because this finally compiles both the JSPs as one.
So I tried to use <JSP:include>. Some one please help me with how to include a JSP inside another using <JSP:include>. Here both the JSPs are having HBJ content inside.
I know that <jsp:include page="relPathOfChild.jsp"/> will include the child.jsp into my main jsp. Problem is both the JSPs are having HBJ content, so If I dont declare <hbj:content> tag inside the child jsp, it is throwing an error. But If I declare a <hbj:content> tag inside my child jsp, only child content is coming and main jsp content is not coming.
Please help me..
Regards,
SrinivaS

Hi,
This Problem is solved. Now I am able to include a child JSP inside the parent JSP. But now the problem is,
This Parent JSP will have 8 tabs. Now my chils JSP should come inside 7th tab.  but it is coming above the parent JSP.
Below is how I am including my child JSP.
<% try{ if(isCAR){
     %>
               <tr>
<jsp:include page="/pagelet/CAREligibility.txt" />
               </tr>
            <%} } catch(Exception e) {}%>
Please help.
Regards,
SrinivaS

Similar Messages

  • Can I have a JSP  inside another JSP??

    if so,
    say, I have a JSP inside another JSP then,
    how many servlets r generated by the JSP engine??

    Yes U can have JSP inside another JSP, ofcourse using jsp:include and in that case two servlets will be generated. Thats what i feel that happens.

  • Passing html object in a JSP to another JSP

    Below, I have a jsp page I want to pass the object name "BP" and all its values to a jsp in another jsp page. I can't use the session object can I? The html the jsp creates is within a form.
    I know the request.getParameter("BP") doesn't work because it must be a string.
    out.println("<form name=myform action='RevUpdate.jsp' method=post>");
    out.println("<PRE><Center><TABLE border = '5'>");
    for (int i=0; i < vBP.size(); i++)
    out.println("<TR><TD><font size='4'>" + ((Fetch_BP_RevLetter)vBP.elementAt(i)).getBP() + "</font></TD><TD><font size='4'><input type='text' size='3' maxlength='2' name='BP' value='" + ((Fetch_BP_RevLetter)vBP.elementAt(i)).getItemRev() + "'/></font></TD></TR>");
    out.println("</Center></Table>");
    out.println("<input type='submit' value='Save'><INPUT TYPE='Button' VALUE='Back' onClick='history.go(-1)'>");
    out.println("</Center>");
    out.println("</form>"); //END OF myform
    HttpSession sessionid = request.getSession(false);
    sessionid.invalidate();

    request.setAttribute()

  • How can I get the value for static content of 1 jsp into another jsp

    Hi, I have a jsp which have a header ,now i want this header value in another jsp dynamically.Can u tell me how I can do it?

    What I want to know is that , is it possible to get the value of a static content of one jsp into another jsp,something like getParameter() method that we use to get the value of a field in the jsp to a servlet,or to another jsp,the only difference here is I do not have a field here but a static jsp content .

  • How to carry an object from one JSP to another JSP?

    How can I carry an object from one JSP to another JSP?
    I have a servlet where I am setting an object in request as an attribute and then forwarding to PageA.jsp.
    MyDTO myDTO = new MyDTO();
    request.setAttribute("MyDTO", myDTO);
    RequestDispatcher rd = getServletContext().getRequestDispatcher("/PageA.jsp");
    rd.forward(request, response);
    I can get MyDTO object in PageA.jsp:
    MyDTO myDTO = (MyDTO) request.getAttribute("MyDTO");
    Now PageA.jsp has a form named form_pageA which submits to PageB.jsp. How can I make sure that myDTO object is available in PageB.jsp? I would like to not store it in session.
    Edited by: srhcan on May 4, 2012 7:52 PM

    srhcan wrote:
    but its not a text I want to store; instead its a JavaBean object. Thats why I cannot use a hidden text type input field.No, but perhaps you could stick something in there which you can use to reconstruct your DTO object on the next request?

  • Can't include a jsp in another jsp?

    I am useing Jbuilder7.0+wls7.0
              I got the Exception:
              "index.jsp": weblogic.utils.ParsingException: nested
              TokenStreamException: antlr.TokenStreamException: Could not include
              conn/conn.jsp
              

              Include Jsp with the <jsp:include/> tag.
              <jsp:include page="relativeURL" />
              Simon Evans <[email protected]> wrote:
              >are you using
              >
              ><%@ include file="myinclude.inc" %>
              >
              >the include file will be referenced from the same directory as the jsp
              >page.
              >
              >
              >itsenser wrote:
              >> I am useing Jbuilder7.0+wls7.0
              >> I got the Exception:
              >> "index.jsp": weblogic.utils.ParsingException: nested
              >> TokenStreamException: antlr.TokenStreamException: Could not include
              >> conn/conn.jsp
              >>
              >
              

  • I am facing problem while accessing property value when i include a component inside another

    Hi Everyone,
    I am unable to access property value of richtext of a compoent that is included in another compoent.
    I have created a compoentA at following location myProject/components/componentA.
    I then created componentB at this location myProject/components/componentB
    ComponentB contains a design_dialog that has a richtext widget with following properties:-
    xtype=richtext
    name=./description
    titile=productdescription
    I have then included componentB in componentA.jsp using <cq:include path="productdescription" resourceType="myProject/components/componentB" />.
    I have then dropped componentA on a page. In design mode i could see the edit dialog for componentB and on edit I could see the rich text, but when i am trying to access the values entered in richtext inside componentB.jsp i am getting null/default value.
    <%=properties.get("description","Description not present")%>
    Can any one tell me why the property is not accessible on the included component.
    Thanks

    What is the tree structure created for the property of the componentB?
    Can you try the below code in your componentB jsp and check whether you are getting the property value
    Resource resource = slingRequest.getResource();
    String description = ((String) ResourceUtil.getValueMap(resource).get(
                        "./description", String.class));

  • How can i get the values from one JSP to another JSP

    Hi All,
    I am very new to JSP technology, I have one jsp having radio button, i want to accecc the state of this radio button to another JSP page, How can i do this.
    Could anybody help me.
    with Regards
    Suresh

    Try page import <%@ page import ="index.jsp" %> or include <%@include file="index.jsp" %> methods perhaps they might work.

  • How to call jsp from another jsp

    Hi, All,
    I have several jsp files in my pagelet. I need to put a link in one jsp file. When client click the link, it will show another jsp file. Could anybody tell me how to do that?  i have tried to use following code in page1.jsp,
    IPortalComponentURI componentURI= componentRequest.createPortalComponentURI();
    componentURI.setContextName("pagelet/page2.jsp");
    String docuri = componentURI.toString();
    <body>
    click  '<a href="<%=docuri %> ">here</a>' to link to pages.
    But it does not work. Any help will be great appreciated.
    Marea
    Message was edited by:
            Marea Yang
    Message was edited by:
            Marea Yang

    HI Yang,
    You can achieve it through eventhandliling in jspdynpage.
    Go through this link ,
    i.<a href="http://help.sap.com/saphelp_nw70/helpdata/en/2e/d2a441cd47a209e10000000a155106/content.htm">eventhandling</a>.
    ii.<a href="https://forums.sdn.sap.com/thread.jspa?threadID=103335">method to call jsp</a>.
    iii.<a href="https://forums.sdn.sap.com/thread.jspa?threadID=393522">calling  resource JSP in Portal Compoent</a>
    Hope It'll help you.
    Regards ,
    Malini.V

  • How to use session to passing data from one JSP to another JSP

    Dear All, I had create 2 jsp web page and want to do this:
    1. input some data into the text box and click the submit button, the jsp page
    will open another jsp page and send the text box data to the new open jsp page.
    can any one tell me how to open a new jsp web page and reciev data from another jsp page?
    thanks yu very much!
    the question.jsp got some code like:
    <html>
    <input type= 'text' name = 'txtName' size = 10 >
    <input type= 'submit' name = 'submit'>
    <% some jsp code %>
    </html>
    answer.jsp
    <html>
    <%
    some jsp code here
    %>
    </html>

    Contents of HTML forms are transmitted as name-value pairs, so you can call request.getParameter(String name) with your form field's name in order to access its value:
    String textValue=request.getParameter("txtName");Regards

  • Is it possible to pass selected value from one jsp to another jsp page?

    In my welcome page(in jsp), if the user is selecting some values, is it possible to pass those values to another jsp page and display?
    If yes, how can it be done?
    please help..

    Yes, you would have to make the motion from one page to the next submit a form. Then on the second JSP you can use request.getParameter("nameOfInputField") to get the value the user selected.

  • How to pass information from one JSP to another JSP? help please

    hi there
    my question is how to pass some information such from one JSP to another one. for exmple, on one page there is a form, and i need to pass some values from the form to another jsp, or some values that were calculated on one JSP and need to be passed to another one. thanks

    You can do this in several ways...here is a simple one...
    When you call the second page url, use this
    http://www.mysite.com?myVariableFromPageOne="hello"
    on the second page use this:
    String firstPageVariable = request.getParameter("myVariableFromPageOne");
    Thanks

  • How to forward from a jsp  to another jsp on another server

    I am facing issue in forwarding to a jsp residing in another server. While using response.redirect(url), the response is send back to the browser and then redirected(which is not expected as it would create problem in production). i am facing issue while using the <jsp: forward> tag and forward() as they seem to be taking relative URL. Please help me with this issue.

    probably, you could use <c:redirect url=""/> tag to request to jsp on another server and pass ur parameters as 'GET' so that u can get all your respective params values. Other way (or crude) way is to do a scoket or HttpConnection to post your all datas via 'POST' and expect respective values on the server side.

  • Invoking a JSP from another JSP

    I have two JSP and both are calling different servlets. How can I call JSP B from JSP A (perhaps using a button). and how can I pass one field value from JSP B to JSP A when JSP B closes or terminate.

    Here is what I'm doing that invokes the second JSP - B
    <SCRIPT>
    function JumpToURL(url) {
              if (url != '') {
              window.location = url;
    </SCRIPT>
    <TD><INPUT type="button" name="configBtn" value="Configuration" onclick="JumpToURL('options.jsp');"><a href="/WebAppName/jsp/options.jsp"></a></TD>
    The one problem that I'm facing right now is this:
    When I start the app or JSP A (JSP that contains the code above), if the FIRST thing that I do is to click on the button above, the app call the second JSP - B, with no problem. But if start the app and click on something else that goes out to the servlet (of JSP A) and then, click on the button above I get the message: "THe pahe cannot be found" or HTTP 404 - File not found Internet Explorer.
    Can you help on this please.........Thanks..

  • Including a WAR inside another WAR

    Hi all bit of a newb question me thinks but here goes
    I have two applications as wars.. i want to distribute them together can i put these inside another war and have tomcat deploy them both in the same way it would deploy a single war..
    Thanks in advance for any replies

    No. Why do people always want to make things so complicated? Just deploy one and then deploy the other.
    Anyway, because you designed the thing as two separate applications, you now have the flexibility of fixing bugs in one without having to reinstall the other.

Maybe you are looking for

  • Help Adobe Flash Player is not working

    I have a Windows 7 64 bit computer with IE 9- I am using the 32 bit IE so that is not the problem. When I go to Hulu or Youtube it tells me to update my flash player to 10.32 or higher. I tried downloading 10.1 but that did not work and it did not wo

  • My ipod nano isn't recognised by my mac or itunes, no set up assistant

    when i plug my ipod into my mac no set up assistant appears and when i go onto itunes my ipod doesn't appear either. Please help!

  • Winfile.cpp-759 error when exporting .flv files

    Hi, Just got over the P2 file problem (stopped using them in CS5, gone back to CS4) and a new problem has occured. I have been exporting .flv files since I first installed CS5, suddenly today Premiere crashes when trying to export individual .flv fil

  • Checking Trim size Quickly

    Hi there, small thing, I've out up with it for years but it strikes me as weird that this may never have been requested or that there is no option for it. In the preferences there is an option to always display the pdf size. Well that's great but as

  • Billing output to IDoc & reprocess the IDoc in same sys. to post FI entry

    I have a requirement to send the billing output to IDoc, read the same IDoc to post a FI entry but to another company code. Please suggest how can this be acheived, and is there any other alternative to acheive the above requirement. Thanks in advanc