Tag:JSP

  • Configuration of jsp servlet data source connection pool

    Time:2021-6-14

    1. Configure the context.xml file Copy codeThe code is as follows: <Resource Name = “JDBC / books” / / the reference name can be customizedAuth = “container” / / specify the manager that manages the datasourceType = “javax. SQL. Datasource” / / specify the package nameMaxactive = 100 / / maximum activityMaxidle = 30 / […]

  • Function and basic configuration of JSP web.xml file

    Time:2021-6-13

    There can be no web.xml file in a web, that is to say, web.xml file is not necessary for Web engineering. When do we need it and when can we not?To answer the above question, you need to understand what the web. XML file is used for. The web.xml file is used to configure: Welcome […]

  • Examples of JSP passing Chinese parameters

    Time:2021-6-11

    Copy codeThe code is as follows: <?xml version=”1.0″ encoding=”UTF-8″ ?> <!DOCTYPE html PUBLIC “-//WAPFORUM//DTD XHTML Mobile 1.0//EN” “http://www.wapforum.org/DTD/xhtml-mobile10.dtd”> <%@ page language=”java” contentType=”text/html; charset=UTF-8″ pageEncoding=”UTF-8″%> <%@ page import=”java.net.*”%> <% String location = “”; String locationFromRequest = request.getParameter(“location”); if (null != locationFromRequest && (!locationFromRequest.equals(“”))) { location = java.net.URLDecoder.decode(locationFromRequest, “UTF-8”); } %> <html> <head> <meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″ […]

  • JSP El expression in detail

    Time:2021-6-8

    1、 JSP El language definition         E L(Expression Language)   Purpose: to makeJSP is easier to write.        The inspiration of expression language comes from ECMAScript and XPath expression language, which provides a way to simplify expressions in JSP. It is a simple language based on the available namespace (pagecontext attribute), nested attributes and accessors […]

  • A simple solution of JSP report printing

    Time:2021-6-7

    1. Make report style in word or excel.Excel row height and column width cannot be expressed in mm or cm.It needs to be calculated. At 1024 * 768, 1cm is about 38 pixels.Based on this, the row and column positions of the report can be calculated and controlled.2. Set “table – Title row repeat” in […]

  • JSP custom tag instance

    Time:2021-6-6

    There are three steps1、 Create a folder named TLDs under WEB-INF, and then create a TLD file, such as formattime.tld, with the following contents: Copy codeThe code is as follows: <?xml version=”1.0″ encoding=”ISO-8859-1″ ?> <!DOCTYPE taglib PUBLIC “-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN” “http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd”> <taglib> <tlibversion>1.0</tlibversion> <jspversion>1.1</jspversion> <shortname>ntuc</shortname> <tag> <name>formatTimeAsString</name> <tagclass>com.ufinity.taglibTest.FormatTimeTag</tagclass> <bodycontent>empty</bodycontent> <attribute> <name>timestamp</name> […]

  • JSP file upload browsing, support IE6, IE7, IE8

    Time:2021-6-2

    Looking for a long time, finally found a JSP can use… Share!! Copy codeThe code is as follows: <%@ page language=”java” contentType=”text/html; charset=UTF-8″     pageEncoding=”UTF-8″%> <%@ taglib prefix=”c” uri=”http://java.sun.com/jsp/jstl/core”%> <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”> <html xmlns=”http://www.w3.org/1999/xhtml”>     <head>         <meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″ />         <link rel=”stylesheet” href=”../css/common.css” href=”css/common.css” type=”text/css” />         < Title > management area        <style […]

  • JSP Application (return string) usage example

    Time:2021-6-1

    1. JSP code: Copy codeThe code is as follows: <%– Document : Application Created on : 2009-10-4, 13:18:53 Author : lucifer –%> <%@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> <meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″> <title>JSP Page</title> </head> <body> get Server Info: <%=application.getServerInfo()%> <br> get Context Path: <%=application.getContextPath()%> <br> get Real […]

  • JSP form form method example

    Time:2021-5-31

    1. Code: Copy codeThe code is as follows: <%– Document : index Created on : 2009-10-4, 13:56:46 Author : lucifer –%> <!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”> <html> <head> <title></title> <meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″> <script type=”text/javascript”> function giveFocus(){ document.login.user.focus() } function submitForm(){ document.login.submit() } function resetForm(){ document.login.reset() document.login.user.focus() } </script> </head> <body bgcolor=”#c0c0c0″ link=”#999999″ […]

  • JSP request (return string) usage example

    Time:2021-5-30

    1. JSP code: Copy codeThe code is as follows: <%– Document : index Created on : 2009-10-4, 12:45:43 Author : lucifer –%> <%@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> <meta http-equiv=”Content-Type” content=”text/html; charset=UTF-8″> <title>JSP Page</title> </head> <body> get Scheme: <%=request.getScheme()%> <br> get Protocol: <%=request.getProtocol()%> <br> get Remote Address: <%=request.getRemoteAddr()%> […]

  • JSP forward usage analysis example code analysis

    Time:2021-5-29

    1. Home page (fill in the name) (optional, post the form to time. JSP)slightly2. Judge the time forward to different pages:time.jsp: Copy codeThe code is as follows: <%– Document : index Created on : 2009-10-3, 15:48:00 Author : lucifer –%> <%@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”> <%@page import=”java.util.Date” %> <html> […]

  • The solution of JSP can’t parse El expression

    Time:2021-5-13

    The reason is: by default, servlet 2.4 / JSP 2.0 supports El expressions. There are two solutions 1. Modify the beginning definition of web.xml. Copy codeThe code is as follows: <web-app version=”2.4″ 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/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd”> This configuration represents servlet 2.4 / JSP 2.0. 2. Add a code at the beginning of the page where […]