sreekanthvasire 0 Newbie Poster

Hi all,

I am having trouble with including a jsp page with <jsp:include> tag. This is what is happening.

I making changes to a portlet application running on Websphere 7 server. This is the hierarchy of the jsp pages.

blankPage.jsp -->bookingViewTabs.jsp --> availableRooms.jsp

meaning blankPage is included in bookingViewTabs which is inturn included in availableRooms.jsp

I have 2 problems with this.

(1). The blankPage.jsp does not render correctly on the screen. It gets cutoff

(2). The other is in blankPage.jsp there is a form called "guestProfileSearchResultsFormId". this form has several hidden fields for data. example, "guestId" which is a child of that form and can be accessed formname.fieldname, but when i include that page into another jsp as the first include(there are several includes on the page) under the another form tag, the form field is not being rendered as a child of the form, but as a sibling of the form. If i change the order and include some other page and include this, it is working as it is supposed to have. meaning with children intact. I don't understand this behavior.

I HAVE ATTACHED A GIF IMAGE OF WHAT I SEE ON THE BROWSER

Any help is greatly appreciated. Thanks in advance

I have pasted the code in the same order. THIS IS BLANKPAGE.JSP

<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html"%>
<%@ taglib prefix="bean" uri="http://struts.apache.org/tags-bean"%>
<%@ taglib prefix="logic" uri="http://struts.apache.org/tags-logic"%>
<%@ taglib uri="/WEB-INF/tld/portlet.tld" prefix="portletAPI"%>
<%@ page import="com.starwood.saratoga.struts.util.NavigationUtil"%>
<%@ page
	import="com.starwood.saratoga.struts.util.MenuMgr, com.starwood.saratoga.struts.util.MenuConstants,
                 java.util.List, org.apache.struts.util.LabelValueBean,
                 org.apache.jetspeed.portlet.User"%>

<portletAPI:init />
<%  String context = request.getContextPath();%>
<%-- // test --%>
<% String aGlobalForward = null;
//MenuMgr.getActivityGlobalForward(portletRequest.getUser(), MenuConstants.GLOBAL_FWD_BLANK);
   if(aGlobalForward != null) {
%>
<logic:forward name="<%=aGlobalForward %>" />
<% } 
   else{
%>

<%
	String divHt = "275";
	if(NavigationUtil.isPanelOff(portletRequest)){
		divHt = "585";
}
%>
<%--  end of test --%>
<style type="text/css">

#guestTable tr.rowStyle td{
	padding: 4px 0px 3px 4px;
	border-left:1px solid #999999;
	border-top:1px solid #999999;
	text-align:left;
}
td.GridColumnSortable{
	height:20px;
	vertical-align:top;
	padding-top:5px;
}

td.GridHeader{
	height:20px;
	vertical-align:top;
	padding-top:5px;
}

#NoResults{
	margin-top:30px;
}
#guestTable tr.rowStyle td.firstCell{
	text-align:left;
	wrap:no-wrap;
}



</style>
<link href="<%=context%>/theme/standard.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
	var context = "<%=context%>";
	var isGuestSide = "<%=MenuMgr.getActivityBlankText(portletRequest)%>";
</script>

<SCRIPT SRC="<%=context%>/js/common.js"></SCRIPT>
<SCRIPT SRC="<%=context%>/js/sortable.js"></SCRIPT>
<script SRC="<%=context%>/js/ajaxSearch.js"></script>
<script SRC="<%=context%>/js/prompt.js"></script>
<html:form action="/guestProfileSearchResults.do" styleId="guestProfileSearchResultsFormId" onsubmit="displayWaitWindow();">

<html:hidden property="dispatch" value="Select"/>
<html:hidden property="guestId"/>
<html:hidden property="mbrshpNum"/>
<html:hidden property="marketingProgram"/>
<html:hidden property="level"/>
<html:hidden property="sortBy"/>
<html:hidden property="previousSort"/>
<html:hidden property="sortOrder"/>
<html:hidden property="len" />
<html:hidden property="startInd" />

<html:hidden property="jspStartTime"/>
<html:hidden property="actionStartTime" />
<html:hidden property="actionEndTime" />
<html:hidden property="dbTableKey" />
<html:hidden property="functionName"/>
<html:hidden property="jspDuration" />
	<div id="guestSearchView" style="width:764px;height:<%=NavigationUtil.getActivityPanelTblHt(portletRequest)%>; background-image:url(<%=context%>/_img/<%=NavigationUtil.getActivityPanelBgImg(portletRequest)%>);">
		<div style="width:764px;">
			<div class="PanelHeader" style="padding-left:3px; padding-top:5px;">
				<%-- the select box for selection of the results  --%>
				<div id="accountStatusSelector" style="float:left; display:none;">   					
					Guest Search Results: <select name="select3" id="filterType" class="Field" style="width:100px" >
						<option value='All' selected>All</option>
						<option value='A'>A-Active</option>
						<option value='E'>E-Expired</option>
						<option value='F'>F-Frozen</option>
						<option value='M'>M-Merged</option>
						<option value='P'>P-Pending</option>
						<option value='Y'>Y-Cancelled</option>
					</select>
					&nbsp;&nbsp;&nbsp;&nbsp;
					<a href="javascript:guestFilter()" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image21','','<%=context%>/_img/btn_update_over.gif',1)"><html:img page="/_img/btn_update_on.gif" imageName="Image21" width="57" height="17" border="0"/></a>
				</div>
				
				<%--  the 'Menu' select box on the right of the page  --%> 
				<div class="SwapMenu" style="float:right;">
					<select name="select9" id="select9" class="Field" style="width:175px;" onchange="javascript:onSelectChange(this)">
						<option selected>&gt;&gt; Menu</option>
							<% List aList = MenuMgr.getActivityMenuList(portletRequest, null);
								   if((aList != null) && (!aList.isEmpty())){
										for(int i=0; i<aList.size(); i++) { 
											LabelValueBean aLabelValueBean = (LabelValueBean) aList.get(i);
							%>
						<option value="<html:rewrite page='<%= aLabelValueBean.getValue()%>'/>"><%= aLabelValueBean.getLabel() %></option>
							<%   		}// end of for
	   							}
							%>
					</select>
				</div>
				
				<div id="guestSearchResultsFromBlankPage" style="width:100%; margin-top:7px; margin-left:3px; display:none;">
					<table id="guestTableHead" border="0" cellspacing=0 cellpadding="0">
						<tr>
                            <td><html:img page="/_img/spacer.gif" width="88" height="5"/></td>
                            <td><html:img page="/_img/spacer.gif" width="36" height="5"/></td>
                            <td><html:img page="/_img/spacer.gif" width="84" height="5"/></td>
                            <td><html:img page="/_img/spacer.gif" width="91" height="5"/></td>
                            <td><html:img page="/_img/spacer.gif" width="75" height="5"/></td>
                            <td><html:img page="/_img/spacer.gif" width="42" height="5"/></td>
                            <td><html:img page="/_img/spacer.gif" width="33" height="5"/></td>
                            <td><html:img page="/_img/spacer.gif" width="40" height="5"/></td>
                            <td><html:img page="/_img/spacer.gif" width="73" height="5"/></td>
                            <td><html:img page="/_img/spacer.gif" width="45" height="5"/></td>
                            <td><html:img page="/_img/spacer.gif" width="50" height="5"/></td>
                            <td colspan="2"><html:img page="/_img/spacer.gif" width="54" height="5"/></td>
                          </tr>
						
							<tr>
								<td colspan="13">
									<div style="width:100%; height:<%=divHt%>px; overflow-y: auto;" class="gridborder">
										<table id="guestTable" width=100% cellspacing="0" cellpadding="0">
											<tbody>
											
											</tbody>
										</table>
									</div>
								</td>
							</tr>
							<tr>
								<td colspan="13" height="17" align="left" valign="top">
									<div style="float:left;">								
										<a href="javascript:guestSearchResults_onGuest('Previous')" id="pagination_next" onMouseOver="MM_swapImage('btn_back','','<%=context%>/_img/btn_back_over.gif',1)" onMouseOut="MM_swapImgRestore()">
											<html:img page="/_img/btn_back_on.gif" alt="Back" imageName="btn_back" width="55" height="17" border="0" />
										</a> 
									</div>
									<div  style="float:right;">
										<a href="javascript:guestSearchResults_onGuest('Next')" id="pagination_prev"  onMouseOver="MM_swapImage('Image17','','<%=context%>/_img/btn_next_over.gif',1)" onMouseOut="MM_swapImgRestore()">
											<html:img page="/_img/btn_next_on.gif" imageName="Image17" width="56" height="17" border="0"/>
										</a>
									</div>
										<html:img page="/_img/spacer.gif" width="9" height="10"/>
								</td>
							</tr>
					</table>
				</div>
				<div id='NoResults' style="display:none;">The provided details did not match with any guest. Please try again.</div>
				<div style="clear:both;"></div>
			</div>
		</div>
		
	</div>
</html:form>
<% } %>

<%-- // end of else --%>

THIS IS FOR BOOKINGVIEWTABS.JSP

<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html" %>
<%@ taglib prefix="bean" uri="http://struts.apache.org/tags-bean" %>
<%@ taglib prefix="logic" uri="http://struts.apache.org/tags-logic" %>
<%@ taglib uri="/WEB-INF/tld/portlet.tld" prefix="portletAPI" %>
<%@ page import="com.starwood.saratoga.struts.util.MenuConstants" %>
<%@ page import="com.starwood.saratoga.commons.constants.Constants" %>
<%@ page import="com.starwood.saratoga.struts.util.NavigationUtil" %>
<%@ page import="com.starwood.saratoga.commons.reservation.ResInfo" %>
<%@ page import="com.starwood.saratoga.framework.SaratogaController" %>
<%@ page import="com.starwood.saratoga.portal.session.ClientCallSession" %>
<script language="JavaScript" type="text/JavaScript">
var isFormStateChanged = false;

function onBookingScnsTabClick(){
	//alert("value of form state "+isFormStateChanged);
	if (isFormStateChanged){
		addErrorMessage("Booking criteria has changed. Booking menu tabs have been disabled!!!");
		window.event.returnValue = false; 
		return;
	}
	
}

</script>

<portletAPI:init/>

	<%
	    String context = request.getContextPath();
	    String curTab = (String) request.getParameter("bookingTab");
			
		//These are identifiers that are needed to show the tab or not
		boolean dispAvailableRooms = NavigationUtil.isAppPageVisited(portletRequest, Constants.TAB_AVAIL_ROOMS);
		boolean dispSelectedRooms = NavigationUtil.isAppPageVisited(portletRequest, Constants.TAB_SELECTED_ROOMS);
		boolean dispReservationPolicies = NavigationUtil.isAppPageVisited(portletRequest, Constants.TAB_RES_POLICY);
		boolean dispGuestGuaranteeInfo = NavigationUtil.isAppPageVisited(portletRequest, Constants.TAB_GUEST_GUARANTEE);

		ClientCallSession callSession = null;
		try{
			callSession = (ClientCallSession)SaratogaController.getInstance(request).getClientSession();
		}catch(Exception e){
			e.printStackTrace();
		}

	%>

	<%
	if (dispAvailableRooms) {
	%>
		<td>
		<table border="0" cellspacing="0" cellpadding="0" style="border:1px solid blue">
			<tr id="book_tab1_row_on" style="display:<%=Constants.TAB_AVAIL_ROOMS.equals(curTab)?"":"none"%>">
				<td width="5">
				<div align="left"><html:img page="/_img/tab_down_left.gif" width="5"
					height="20" /></div>
				</td>
				<td background="<%=context%>/_img/tab_down_bg.gif"
					" class="BodyCopyHeaderGreen">Available Rooms</td>
				<td width="4">
				<div align="right"><html:img page="/_img/tab_down_right.gif"
					width="4" height="20" /></div>
				</td>
			</tr>
			<tr id="book_tab1_row_off" style="display:<%=!Constants.TAB_AVAIL_ROOMS.equals(curTab)?"":"none"%>">
				<td width="5">
				<div align="left"><html:img page="/_img/tab_left.gif" width="5"
					height="20" /></div>
				</td>
				<td background="<%=context%>/_img/tab_bg.gif" class="TabHeader"><a
					href="<html:rewrite page='<%=MenuConstants.RES_AVAILABLE_ROOM_VALUE%>'/>" onclick="JavaScript:onBookingScnsTabClick();">Available Rooms</a><html:img
					page="/_img/spacer.gif" width="15" height="3" /></td>
				<td width="4">
				<div align="right"><html:img page="/_img/tab_right.gif" width="4"
					height="20" /></div>
				</td>
			</tr>
		</table>
		<div id="resSideDisplay" style='display:"none"; position: absolute; valign: top'>
			<jsp:include page="/jsp/common/blankPage.jsp"/>
		</div>
		</td>

	<%
	}
	%>

	<%
	if (dispSelectedRooms) {
	%>

		<td>
		<table border="0" cellspacing="0" cellpadding="0" style="border:1px solid red">
			<tr id="book_tab2_row_on" style="display:<%=Constants.TAB_SELECTED_ROOMS.equals(curTab)?"":"none"%>">
				<td width="5">
				<div align="left"><html:img page="/_img/tab_down_left.gif" width="5"
					height="20" /></div>
				</td>
				<td background="<%=context%>/_img/tab_down_bg.gif" class="TabHeader"><span
					class="BodyCopyHeaderGreen">Selected Rooms</span><html:img
					page="/_img/spacer.gif" width="15" height="5" /></td>
				<td width="4">
				<div align="right"><html:img page="/_img/tab_down_right.gif"
					width="4" height="20" /></div>
				</td>
			</tr>
			<tr id="book_tab2_row_off" style="display:<%=!Constants.TAB_SELECTED_ROOMS.equals(curTab)?"":"none"%>">
				<td width="5">
				<div align="left"><html:img page="/_img/tab_left.gif" width="10"
					height="20" /></div>
				</td>
				<td background="<%=context%>/_img/tab_bg.gif" class="TabHeader"><a
					href="<html:rewrite page='<%=MenuConstants.RES_SELECTED_ROOMS_VALUE%>'/>" onclick="JavaScript:onBookingScnsTabClick();">Selected Rooms</a></td>
				<td width="4">
				<div align="right"><html:img page="/_img/tab_right.gif" width="10"
					height="20" /></div>
				</td>
			</tr>
		</table>
		<div id="resSideDisplay" style='display:"none"; position: absolute; valign: top'>
			<jsp:include page="/jsp/common/blankPage.jsp"/>
		</div>
		</td>
	<%
	} 
	%>

	<%
	if (dispReservationPolicies) {
	%>
		<td>
		<table border="0" cellspacing="0" cellpadding="0"  style="border:1px solid yellow">
			<tr id="book_tab3_row_on" style="display:<%=Constants.TAB_RES_POLICY.equals(curTab)?"":"none"%>">
				<td width="5">
				<div align="left"><html:img page="/_img/tab_down_left.gif" width="5"
					height="20" /></div>
				</td>
				<td background="<%=context%>/_img/tab_down_bg.gif" class="TabHeader"><span
					class="BodyCopyHeaderGreen">Reservation Policies</span><html:img
					page="/_img/spacer.gif" width="15" height="5" /></td>
				<td width="4">
				<div align="right"><html:img page="/_img/tab_down_right.gif"
					width="4" height="20" /></div>
				</td>
			</tr>
			<tr id="book_tab3_row_off" style="display:<%=!Constants.TAB_RES_POLICY.equals(curTab)?"":"none"%>">
				<td width="5">
				<div align="left"><html:img page="/_img/tab_left.gif" width="10"
					height="20" /></div>
				</td>
				<td background="<%=context%>/_img/tab_bg.gif" class="TabHeader"><a
					href="<html:rewrite page='<%=MenuConstants.RES_GUARANTEE_TYPE_VALUE%>'/>" onclick="JavaScript:onBookingScnsTabClick();">Reservation Policies</a></td>
				<td width="4">
				<div align="right"><html:img page="/_img/tab_right.gif" width="10"
					height="20" /></div>
				</td>
			</tr>
		</table>
		<div id="resSideDisplay" style='display:"none"; position: absolute; valign: top'>
			<jsp:include page="/jsp/common/blankPage.jsp"/>
		</div>
		</td>
	<%
	}
	%>

	<%
	if (dispGuestGuaranteeInfo) {
	%>
		<td>
		<table border="0" cellspacing="0" cellpadding="0"  style="border:1px solid green">
			<tr id="book_tab4_row_on" style="display:<%=Constants.TAB_GUEST_GUARANTEE.equals(curTab)?"":"none"%>">
				<td width="5">
				<div align="left"><html:img page="/_img/tab_down_left.gif" width="5"
					height="20" /></div>
				</td>
				<td background="<%=context%>/_img/tab_down_bg.gif"
					class="BodyCopyHeaderGreen">Guest/Guarantee Information</td>
				<td width="4">
				<div align="right"><html:img page="/_img/tab_down_right.gif"
					width="4" height="20" /></div>
				</td>
			</tr>
			<tr id="book_tab4_row_off" style="display:<%=!Constants.TAB_GUEST_GUARANTEE.equals(curTab)?"":"none"%>">
				<td width="5">
				<div align="left"><html:img page="/_img/tab_left.gif" width="10"
					height="20" /></div>
				</td>
				<td background="<%=context%>/_img/tab_bg.gif" class="TabHeader"><a
					href="<html:rewrite page='<%=MenuConstants.RES_GUARANTEE_DETAIL_VALUE%>'/>" onclick="JavaScript:onBookingScnsTabClick();">Guarantee Information</a></td>
				<td width="4">
				<div align="right"><html:img page="/_img/tab_right.gif" width="10"
					height="20" /></div>
				</td>
			</tr>
		</table>
		<div id="resSideDisplay" style="position: absolute; valign: top">
			<jsp:include page="/jsp/common/blankPage.jsp"/>
		</div>
		</td>
	<%
	}
	%>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.