Author: bluesky35 (blue) development environment: Windows2000 JBuilderX Tomcat4.0.6 Introduction: Hello everybody, I'm bluesky35 (blue), although very busy recently, but still did not forget to write a few original articles up and share with everyone, I hope you Can support me. This article is about custom TAG parsing. I believe everyone has used Struts's custom label library. Write
Import javax.servlet. *; import javax.servlet.http. *; import java.io. *; import java.util. *;
Public class myservlet extends httpservlet {private static final string content_type = "text / html; charSet = shift_jis";
// Initialize Global Variables Public Void Init () THROWS ServleTexception {}
// Process the HTTP Get request public void doGet (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {response.setContentType (CONTENT_TYPE); String scope = request.getParameter ( "txtscope"); request.getRequestDispatcher ( "/ jsp / bluesky .jsp "). Forward (Request, Response);
// Clean Up Resources Public Void Destroy () {}} is OK, the servlet is configured, let's take a look at the current environment, as shown below: Take a break, let's go to formally enter the custom TAG writing. 4. Right-click Module Directory to select New-> Directory, build a directory named JSP, then right-click the JSP directory Select New-> JSP new JSP file, the content is as follows: <% @ Page ContentType = "text / html CHARSET = GB2312 "%>
<% @ Taglib prefix =" bluesky "URI =" Bluesky-taglib "%>