-
Path: news-archive.icm.edu.pl!newsfeed.gazeta.pl!news.onet.pl!lublin.pl!uw.edu.pl!new
sgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.84.MISMATCH!newsfeed.xs4al
l.nl!newsfeed5.news.xs4all.nl!xs4all!feeder.news-service.com!postnews.google.co
m!f16g2000vbf.googlegroups.com!not-for-mail
From: p...@g...com
Newsgroups: pl.comp.programming
Subject: JAK W NETBEANS... ŻEBY WYŚWIETLAŁ ILOŚĆ WOLNEGO MIEJSCA D HD
Date: Sat, 16 May 2009 08:13:48 -0700 (PDT)
Organization: http://groups.google.com
Lines: 166
Message-ID: <c...@f...googlegroups.com>
NNTP-Posting-Host: 153.19.54.211
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-2
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1242486828 10945 127.0.0.1 (16 May 2009 15:13:48 GMT)
X-Complaints-To: g...@g...com
NNTP-Posting-Date: Sat, 16 May 2009 15:13:48 +0000 (UTC)
Complaints-To: g...@g...com
Injection-Info: f16g2000vbf.googlegroups.com; posting-host=153.19.54.211;
posting-account=DLnD2goAAAC0DtX6Xqb5gg-J86EmfV_e
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; pl; rv:1.9.0.4)
Gecko/2008102920 Firefox/3.0.4 (.NET CLR
3.5.30729),gzip(gfe),gzip(gfe)
Xref: news-archive.icm.edu.pl pl.comp.programming:181913
[ ukryj nagłówki ]INDEX.JSP:
Document : index
Created on : 2009-05-16, 16:25:56
Author : Student
--%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript">
var req;
function validate() {
var idField = document.getElementById("userid");
var url = "validate?id=" + escape(idField.value);
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
} else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
}
req.open("GET", url, true);
req.onreadystatechange = callback;
req.send(null);
}
function callback() {
if (req.readyState == 4) {
if (req.status == 200) {
var message = req.responseXML.getElementsByTagName("message")[0];
setMessage(message.childNodes[0].nodeValue);
}
}
}
function setMessage(message) {
var userMessageElement = document.getElementById("userIdMessage");
var messageText;
if (message == "invalid") {
userMessageElement.style.color = "red";
messageText = "Invalid User Id";
} else {
userMessageElement.style.color = "green";
messageText = "Valid User Id";
}
var messageBody = document.createTextNode(messageText);
if (userMessageElement.childNodes[0]) {
userMessageElement.replaceChild(messageBody,
userMessageElement.childNodes[0]);
} else {
userMessageElement.appendChild(messageBody);
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h2>Hello World!</h2>
<INPUT type="text" size="20" id="userid" name="id"
onkeyup="validate();" >
<div id="userIdMessage"></div>
</body>
</html>
VALIDATE.JAVA:
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package serwlety;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
*
* @author Student
*/
public class validate extends HttpServlet {
/**
* Processes requests for both HTTP <code>GET</code> and <code>POST</
code> methods.
* @param request servlet request
* @param response servlet response
*/
protected void processRequest(HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
String targetId = request.getParameter("id");
try{
if ((targetId != null) && !(targetId.trim().equals("Tom"))) {
response.setContentType("text/xml");
response.setHeader("Cache-Control", "no-cache");
response.getWriter().write("<message>");
response.getWriter().write("valid");
response.getWriter().write("</message>");
} else {
response.setContentType("text/xml");
response.setHeader("Cache-Control", "no-cache");
response.getWriter().write("<message>");
response.getWriter().write("invalid");
response.getWriter().write("</message>");
}
} finally {
}
}
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods.
Click on the + sign on the left to edit the code.">
/**
* Handles the HTTP <code>GET</code> method.
* @param request servlet request
* @param response servlet response
*/
protected void doGet(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Handles the HTTP <code>POST</code> method.
* @param request servlet request
* @param response servlet response
*/
protected void doPost(HttpServletRequest request, HttpServletResponse
response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
*/
public String getServletInfo() {
return "Short description";
}// </editor-fold>
}
---------- 16:11 ----------
Proszę o szybką pomoc. Problem jest banalny a od tego dużo zależy
Smile
Następne wpisy z tego wątku
- 16.05.09 15:51 Jacek Czerwinski
- 16.05.09 16:10 p...@g...com
- 16.05.09 18:31 Artur M. Piwko
- 17.05.09 00:09 Mateusz Ludwin
- 28.06.09 14:40 razor1000100
Najnowsze wątki z tej grupy
- Popr. 14. Nauka i Praca Programisty C++ w III Rzeczy (pospolitej)
- Arch. Prog. Nieuprzywilejowanych w pełnej wer. na nowej s. WWW energokod.pl
- 7. Raport Totaliztyczny: Sprawa Qt Group wer. 424
- TCL - problem z escape ostatniego \ w nawiasach {}
- Nauka i Praca Programisty C++ w III Rzeczy (pospolitej)
- testy-wyd-sort - Podsumowanie
- Tworzenie Programów Nieuprzywilejowanych Opartych Na Wtyczkach
- Do czego nadaje się QDockWidget z bibl. Qt?
- Bibl. Qt jest sztucznie ograniczona - jest nieprzydatna do celów komercyjnych
- Co sciaga kretynow
- AEiC 2024 - Ada-Europe conference - Deadlines Approaching
- Jakie są dobre zasady programowania programów opartych na wtyczkach?
- sprawdzanie słów kluczowych dot. zła
- Re: W czym sie teraz pisze programy??
- Re: (PDF) Surgical Pathology of Non-neoplastic Gastrointestinal Diseases by Lizhi Zhang
Najnowsze wątki
- 2025-02-07 Jaki silikon lub może klej?
- 2025-02-07 Gdańsk => iOS Developer (Swift experience) <=
- 2025-02-07 Warszawa => Starszy Programista C <=
- 2025-02-07 Niby to nie sąd ale kooorwa tak to w sądach dziś wygląda?
- 2025-02-06 PROGRAM DOPŁAT DO AUT ELEKTRYCZNYCH TO ABSURD. ZA ŚRODKI Z KPO KUPIMY NIEMIECKIE I CHIŃSKIE AUTA
- 2025-02-05 ceny OC
- 2025-02-05 Re: ceny OC
- 2025-02-05 Re: ceny OC
- 2025-02-07 Smar do video
- 2025-02-06 Litowe baterie AA Li/FeS2 a alkaliczne
- 2025-02-07 Gliwice => Business Development Manager - Network and Network Security
- 2025-02-07 Warszawa => System Architect (Java background) <=
- 2025-02-07 Warszawa => System Architect (background deweloperski w Java) <=
- 2025-02-07 Warszawa => Solution Architect (Java background) <=
- 2025-02-07 Gliwice => Ekspert IT (obszar systemów sieciowych) <=