¹ØÓÚHTML´úÂëÖÐACTIONʼþÈçºÎÖ¸¶¨servlet·¾¶
\webapps\test ·¾¶ÏÂThreeParams.html:
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>TreeParams</title>
</head>
<body>
<form method="get" onsubmit="return true" name="form1" action="/test/tp">
<table align="center" border="2" width="500">
<tr>
.......
web.xml ÕýÈ·ÅäÖãº
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<servlet>
<servlet-name>TP</servlet-name>
<servlet-class>ThreeParams</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>TP</servlet-name>
<url-pattern>/tp</url-pattern>
</servlet-mapping>
</web-app>
Õâ¸öservletµÄ·¾¶Îª£ºhttp://localhost:8080/test/tp
×ܽ᣺actionÕâÀïÌîµÄ²¢²»ÊÇweb.xmlÀïµÄÓ³Éä·¾¶£¬¶øÊÇURL+web.xmlµÄÅäÖ÷¾¶¡£
Ïà¹ØÎĵµ£º
metaÊÇhtmlÓïÑÔheadÇøµÄÒ»¸ö¸¨ÖúÐÔ±êÇ©¡£¼¸ºõËùÓеÄÍøÒ³ÀÎÒÃÇ¿ÉÒÔ¿´µ½ÀàËÆÏÂÃæÕâ¶ÎµÄhtml´úÂ룺
¡¡¡¡£¼head£¾
¡¡¡¡£¼meta http-equiv="content-Type" content="text/html; charset=gb2312"£¾
¡¡¡¡£¼/head£¾
¡¡¡¡Ò²ÐíÄãÈÏΪÕâЩ´úÂë¿ÉÓпÉÎÞ¡£ÆäʵÈç¹ûÄãÄܹ»ÓúÃmeta±êÇ©£¬»á¸øÄã´øÀ´ÒâÏë² ......
I needed a tab pane to put some content in my web pages. There are many solutions around
and I must say that they are quite good, but I had some extra requirements that I needed.
I did search around but I did not find what I wanted, so I ended up producing something and now I am sharing
it with y ......
import java.io.ByteArrayOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.Servl ......
ÀϵϰÌâÁË£¬µ«ÊÇÎÒ»¹ÊÇ´ÓÀ´Ã»ÓÐÕûÀí¹ý¡£ÕâÀïÕûÀíÒ»ÏÂ:
ÔÚXHTMLÖУ¬<html>¡¢<head>¡¢<body>¶¼ÊDZØÐèµÄ±êÇ©¡£
±ØÐëÉèÖÃ<html>±êÇ©µÄxmlnsÊôÐÔ£¬ÇÒÆäֵΪ“http://www.w3.org/1999/xhtml”¡£
ËùÓÐÔªËØ¶¼±ØÐë½áÊø¡£ÈÎºÎÆðʼ±êǩҪôÓÐÒ»¸ö¶ÔÓ¦µÄ½áÊø±êÇ©£¨Èç¹ûËüÊÇÒ»¸öÈÝÆ÷µÄ»°£©£¬ÒªÃ ......