Jsp server configuration

Source: Internet
Author: User
Tags tld

.Download jakarta-taglibs-standard-1.1.2.zip (version 1.0 http://jakarta.apache.org/site/downloads/downloads_taglibs-standard-1.0.cgi must be downloaded from Weblogic)
2. Decompress the package and copy the standard. jar and jstl. jar files to \ WEB-INF \ lib \
3. Copy tld files under jakarta-taglibs-standard-1.1.1 \ tld \ to "\ WEB-INF \ tlds" (1.1 is 15 files, 1.0 is 8)
4. Create a web. xml file under \ WEB-INF \ :( The Following <taglib> definition is for 1.0)
<? 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/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
Version = "2.4">
 
<Taglib>
<Taglib-uri> http://java.sun.com/jstl/fmt </taglib-uri>
<Taglib-location>/WEB-INF/tlds/fmt. tld </taglib-location>
</Taglib>

<Taglib>
<Taglib-uri> http://java.sun.com/jstl/fmt-rt </taglib-uri>
<Taglib-location>/WEB-INF/tlds/fmt-rt.tld </taglib-location>
</Taglib>

<Taglib>
<Taglib-uri> http://java.sun.com/jstl/core </taglib-uri>
<Taglib-location>/WEB-INF/tlds/c. tld </taglib-location>
</Taglib>

<Taglib>
<Taglib-uri> http://java.sun.com/jstl/core-rt </taglib-uri>
<Taglib-location>/WEB-INF/tlds/c-rt.tld </taglib-location>
</Taglib>

<Taglib>
<Taglib-uri> http://java.sun.com/jstl/ SQL </taglib-uri>
<Taglib-location>/WEB-INF/tlds/SQL. tld </taglib-location>
</Taglib>

<Taglib>
<Taglib-uri> http://java.sun.com/jstl/sql-rt </taglib-uri>
<Taglib-location>/WEB-INF/tlds/sql-rt.tld </taglib-location>
</Taglib>

<Taglib>
<Taglib-uri> http://java.sun.com/jstl/x </taglib-uri>
<Taglib-location>/WEB-INF/tlds/x. tld </taglib-location>
</Taglib>

<Taglib>
<Taglib-uri> http://java.sun.com/jstl/x-rt </taglib-uri>
<Taglib-location>/WEB-INF/tlds/x-rt.tld </taglib-location>
</Taglib>
</Web-app>

Create a file named test. jsp
<% @ Page isELIgnored = "false" %> this line must be added to Tomcat, because jsp does not support EL by default. Weblogic cannot be added. An error will occur if this line is added!
<! Doctype html public "-// W3C // dtd html 4.0 Transitional // EN">
<% @ Page contentType = "text/html; charset = GB2312" %>
<% @ Taglib prefix = "c" uri = "http://java.sun.com/jsp/jstl/core" %>
<Html>
<Head>
<Title> test your first JSTL webpage </title>
</Head>
<Body>
<C: out value = "welcome to test your first webpage using JSTL"/>
</Br> your browser is: </br>
<C: out value = "$ {header ['user-agent']}"/>
<C: set var = "a" value = "David O 'Davies"/>
<C: out value = "David O 'Davies" escapeXml = "true"/>
</Body>
</Html>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.