JSP etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
JSP etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

12 Aralık 2007 Çarşamba

JSP Sayfası İçinde Response Redirect

jsp:include tagi ile içeriğini aldığınız sayfa eğer Response redirect ile başka bir sayfaya yönlendirme içeriyorsa, browserınız o sayfaya yönlendirme yapmak yerine sayfaya aşağıdaki içeriği koyar:

URL moved here


Bunu engellemek için, bir sayfanın içeriğini almakta jsp:include tagini değil @include tagini kullanın.

Örnek:

<jsp:include page="icerik.jsp"/>
<%@include file="icerik.jsp"%>

11 Aralık 2007 Salı

Web Sayfasında Flashların En Üstte Görünmesini Engellemek

Geçenlerde içinde flash bulunan bir sayfa üzerine şeffaf bir layer koymaya çalışırken şöyle bir problem yaşadım. Sayfadaki flash objesi ne yaparsam yapayım layerın üzerine çıkıyordu.

Flashın bulunduğu yere "z-index:-1" vermem de bi işe yaramadı.

Bakınız:
You can't make a flash movie behave in the z-index - doesn't matter whether the movie is in a layer (div) or not it will always show up on top of any layers that overlap the movie.

Problemin çözümöü flashın "wmode" parametresini "transparent" yapmakmış.

Bakınız:
click on the flash file in dreamweaver... open up its parameters.. and make the

parameter: wmode
value: transparent




27 Mayıs 2007 Pazar

A simple JSP File

A simple JSP file which gets results from request attributes and display them through iterations
----------------------------------------------

<%@page contentType="text/html" import="java.util.*, com.myairline.type.*" %>
<%@page pageEncoding="UTF-8"%>
<%--
The taglib directive below imports the JSTL library. If you uncomment it,
you must also add the JSTL library to the project. The Add Library... action
on Libraries node in Projects view can be used to add the JSTL 1.1 library.
--%>
<%--
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
--%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="resources/style.css" rel="stylesheet" type="text/css">
<title>Flight Results</title>

</head>

<%
// Get and set attributes :::
ArrayList flightList1 = (ArrayList) request.getAttribute("flightList1");
ArrayList flightList2 = (ArrayList) request.getAttribute("flightList2");
int passengerCount = Integer.parseInt( (String) request.getAttribute( "passengerCount") );

%>

<body>

<!--------------------------------------------------------------------------------------------------------------------------
****************************************************************************************************************************
START FLIGHT SEARCH RESULTS FORM
****************************************************************************************************************************
------------------------------------------------------------------------------------------------------------------------ -->

<table border="1" cellspacing="4" cellpadding="4">

<thead>
<tr>
<th> Option </th>
<th> Flight No </th>
<th> Depart Date </th>
<th> From </th>
<th> To </th>
<th> Price </th>
</tr>
</thead>
<tbody>

<form name="flightSelectForm" method="post" action="/MyAirline/SearchServlet?cmd=selected_flight&source=customer">

<tr>
<td colspan="6">
<b> DEPART FLIGHTS RESULTS </b>
</td>
</tr>
<%
// Add Elements to Depart Flight Results List -
//************************************************************************************************************
Iterator flightIterator = flightList1.iterator();

boolean isEmpty1 = true;
while( flightIterator.hasNext() ) {
isEmpty1=false;
Flight currentFlight = (Flight) flightIterator.next();
%>

<tr>
<td>
<% out.println("<input type=\"radio\" name=\"flightSelection\" value=\""+ currentFlight.getFlightNo() +"\" />" ); %>
</td>

<td>
<%= currentFlight.getFlightNo()%>
</td>

<td>
<%= currentFlight.getFlightDate()%>
</td>

<td>
<%= currentFlight.getFlightRoute().getStartAirport().toString() %>
</td>

<td>
<%= currentFlight.getFlightRoute().getEndAirport().toString() %>
</td>

<td>
<%= currentFlight.getTicketFare()%>
</td>
</tr>

<%
} // end-while-
//************************************************************************************************************
%>

<%
if( isEmpty1 ) {
%>
<tr>
<td colspan="6" > NO MATCHING RESULTS </td>
</tr>
<%
} // -end-if-
%>

<tr>
<td colspan="6">
<b> RETURN FLIGHTS RESULTS </b>
</td>
</tr>

<%
boolean isEmpty2 = true;
if( flightList2 != null ) {
%>

<%
// Add Elements to Depart Flight Results List -
//************************************************************************************************************
Iterator flightIterator2 = flightList2.iterator();

isEmpty2 = true;
while( flightIterator2.hasNext() ) {
isEmpty2=false;
Flight currentFlight2 = (Flight) flightIterator2.next();
%>

<tr>
<td>
<% out.println("<input type=\"radio\" name=\"flightSelection2\" value=\""+ currentFlight2.getFlightNo() +"\" />" ); %>
</td>

<td>
<%= currentFlight2.getFlightNo()%>
</td>

<td>
<%= currentFlight2.getFlightDate()%>
</td>

<td>
<%= currentFlight2.getFlightRoute().getStartAirport().toString() %>
</td>

<td>
<%= currentFlight2.getFlightRoute().getEndAirport().toString() %>
</td>

<td>
<%= currentFlight2.getTicketFare()%>
</td>
</tr>

<%
} // end-while-
//************************************************************************************************************
%>

<%
} // -end-if-
%>


<%
if( isEmpty2 ) {
%>
<tr>
<td colspan="6" > NO MATCHING RESULTS </td>
</tr>
<%
} // -end-if-
%>

<% if( isEmpty1 == false ) { %>

<tr>
<td> Passenger Count: </td>
<td>
<%= passengerCount %>
</td>
</tr>

<input type="hidden" name="passengerCount" value="<%= passengerCount %>" />

<tr>
<td align=center colspan="36">
<A href="/MyAirline/SearchServlet?cmd=flight_search&source=agency" target="mainFrame"> SEARCH AGAIN </A>
</td>
</tr>
<tr>
<td colspan="6" align=center>
<input type="submit" value="CONTINUE TO PAYMENT" name="payment" />
</td>
</tr>

<%
} // -end-if-
%>


</form>

<!--------------------------------------------------------------------------------------------------------------------------
****************************************************************************************************************************
END FLIGHT SEARCH RESULTS FORM
****************************************************************************************************************************
------------------------------------------------------------------------------------------------------------------------ -->

</tbody>
</table>

</body>
</html>