5304101373
2. 5404101301
3. 5404101313
4. 5404101348
5. 5404101409
1
( 313)
313)
Text
flied server
1
Application server 1
Web application 2
5
o Text field 8
o Check Box) 8
o Text Area 9
o Radio Button 9
o Select /Menu 10
o 11
o Button) 11
12
12
12
13
Run 15
16
Web Application
web application
JSP
In put
web browser
- Application server
- Web application
-
1. Application server
eclipse compile Deploy
Application server Tomcat tab server
window new server
Apache Tomcat v6.0 server Tomcat v7.0 server
Browse folder Tomcat
2. WebApplication Project
Web-Base Application Project
File new Project
Folder Web Dynamic Web Project
2.2 Project Name = “………..”
File Eclipse Directory
Default
Directory
Next
Folder source code Output Folder
Class File
directory Run
3.
Form.jsp
source code
<formaction="ProFile.jsp"name="form01"method="post"onsubmi
t="return check()">
<table>
<tr>
<td> </td>
<td><inputtype="text"maxlength="13"id="idcard"name="idcard
"placeholder= ><br></td>
</tr>
<tr>
<tdalign="right"> </td>
<td><inputtype="text"maxlength="30"placeholder= id="nam
e"name="name"><br></td>
</tr>
<tr>
<tdalign="right"> </td>
<td><inputtype="text"maxlength="30"placeholder= id=
"lastname"name="lastname"><br></td>
</tr>
<tr>
<tdalign="right"> </td>
<td><inputtype="radio"checked="checked"name="sex"> <inpu
ttype="radio"name="sex"> <br></td>
</tr>
<tr>
<tdalign="right"> </td>
<td><inputtype="checkbox"name="sport"value=" ">
<inputtype="checkbox"name="sport"value=" ">
<inputtype="checkbox"name="sport"value=" ">
<inputtype="checkbox"name="sport"value=" "> <br></
td>
</tr>
<tr>
<tdalign="right"> </td>
<td><textareaplaceholder= id="address"
name="address"></textarea><br></td>
</tr>
<tr>
<tdalign="right"> </td>
<td><selectname="county">
<optionvalue=" "> </option>
<optionvalue=" "> </option>
<optionvalue=" "> </option>
<optionvalue=" "> </option>
<optionvalue=" "> </option>
<optionvalue=" "> </option>
<optionvalue="> "> </option>
</select><br></td>
</tr>
<tr>
<tdalign="right"> </td>
<td><inputtype="text"maxlength="10"placeholder= id=
"tell"name="tell"><br></td>
</tr>
<tr>
<tdalign="right"> </td>
<td><inputtype="text"placeholder= id="email"name="ema
il"><br></td>
</tr>
<tr>
<tdalign="right"> </td>
<td><inputtype="file"id="pic"name="pic"><br></td>
</tr>
<tr>
<tdalign="center"colspan="2"><inputtype="submit"name="ok"v
alue=" "">
<inputtype="reset"name="delete"value=" "><br></td>
</tr>
</table>
</form>
Text field
<inputtype="text"maxlength="13"id="idcard"name="idcar
d"placeholder= >
(type) text maxlength
idcard ID
Check Box)
<inputtype="checkbox"name="sport"value=" ">
<inputtype="checkbox"name="sport"value=" ">
<inputtype="checkbox"name="sport"value=" ">
<inputtype="checkbox"name="sport"value=" ">
(type) checkbox
sport value
Text Area
Text Area
E-mail
Text Field
<textareaplaceholder= id="address"
name="address"></textarea>
textarea
address ID placeholder
3 Radio Button
Radio Button
<inputtype="radio"checked="checked"name="sex"> <inp
uttype="radio"name="sex">
(type) radio
sex checked
Select /Menu
Select /Menu
<selectname="county">
<optionvalue=" "> </option>
<optionvalue=" "> </option>
<optionvalue=" "> </option>
<optionvalue=" "> </option>
<optionvalue=" "> </option>
<optionvalue=" "> </option>
<optionvalue=" "> </option>
select
county value
Upload Server
Browse
<inputtype="file"id="pic"name="pic">
(type) file pic
Button)
Submit Reset
CGI Script)
<inputtype="submit"name="ok"value=" "">
<inputtype="reset"name="delete"value=" ">
(type)
submit reset ok
delete
Web Browser
Web Browser
Form.jsp Add
-
-
Form
- Idcard
- Name
- Last name
- Sex
- Sport
- Address
- County
- Tell
- Email
- Pic
Http
request
getParameter
String idcard = request.getParameter("idcard");
String name = request.getParameter("name");
String lastname = request.getParameter("lastname");
String sex = request.getParameter("sex");
String address = request.getParameter("address");
String county = request.getParameter("county");
String tell = request.getParameter("tell");
String email = request.getParameter("email");
String pic = request.getParameter("pic");
String sport[] = request.getParameterValues("sport");
2.
server Web
Browser
Code
<table>
<tr>
<tdalign="center"colspan="2"><imgalt=""src="images/<%=pic%
>"width="60"height="60"></td>
</tr>
<tr>
<td> </td>
<td><%=idcard%><br></td>
</tr>
<tr>
<tdalign="right"> </td>
<td><%=name%><br></td>
</tr>
<tr>
<tdalign="right"> </td>
<td><%=lastname%><br></td>
</tr>
<tr>
<tdalign="right"> </td>
<td><%if(sex.equals("sex")){%> <%
}else{%> <%}%><br></td>
</tr>
<tr>
<tdalign="right"> </td>
<td><%for(int i=0;i<sport.length;i++){ %>
<%=sport[i] %><%if(i<sport.length-1){ %>, <%}} %>
<br></td>
</tr>
<tr>
<tdalign="right"> </td>
<td><%=address%><br></td>
</tr>
<tr>
<tdalign="right"> </td>
<td><%=county%><br></td>
</tr>
<tr>
<tdalign="right"> </td>
<td><%=tell%><br></td>
</tr>
<tr>
<tdalign="right"> </td>
<td><%=email%><br></td>
</tr>
</table>
1. Run
Run As Run on Server Finish
http://freepowerpoint-
template.blogspot.com/search/label/Templates?updated-
max= T A A B A &max-
results=
http://office.microsoft.com/en-us/templates/template-categories-
FX aspx
http://office.microsoft.com/en-
us/templates/results.aspx?qu=technology&av=zpp#ai:TC
|
https://sites.google.com/site/class technique
http://www.library.cddkorat.com/index.php?option=com_content
&view=article&id= &catid=
---------
&Itemid=
http://www.slideshare.net/dakcom/webprogramming-eclipsejsp
http://www.nectect.or.th
http://www.webthaidd.com/dreamweaver/news.php?id=445
---
http://cannot.info/page?p=1310520034773
http://www.pyayam.com/article/show.php?Category=webpage&
No=67

บทที่1