Jsp learning --- Introduction to mvc mode and el expression, getting started with jstl label Library

Source: Internet
Author: User

The project package naming rules are generally as follows: com. amos. domain encapsulates JavaBean. Generally, I like to name this package com with model. amos. dao encapsulates the dao layer com. amos. dao. daoimpl implements the dao layer interface com. amos. service encapsulate service layer com. amos. service. serviceiml implements the service layer interface com. amos. web. controller business logic layer com. amos. web. listener com. amos. web. filter com. amos. utils storage tool class com. amos. the test class can be conveniently maintained according to the above classification. WEB-INF/jsp will be stored in the WEB-INF directory jsp, this can increase security 2. el expression EL expression is used to obtain data. You can use $ {identifier} On the JSP page to notify the JSP Engine to call pageContext.. FindAttribute () method, used as the keyword to get objects from each domain object. If the object corresponding to the identifier does not exist in the domain object, the returned result is "" (note, not null ). Example: Use the EL expression to obtain data in the request, session, and applection fields. You can also use $ {mermerbean. address} in the EL expression to access attributes of the JavaBean object. Example: use an EL expression to obtain Bean attributes. EL expressions can also use a class such as ${1 = 1} for simple logical judgment. Copy the Code <% @ page import = "java. util. * "%> <% @ page import =" java. util. arrayList "%> <% @ page import =" java. util. list "%> <% @ page import =" com. amos. model. * "%> <% @ page isELIgnored =" false "%> <% @ page language =" java "contentType =" text/html; charset = UTF-8 "pageEncoding =" UTF-8 "%> <! DOCTYPE html PUBLIC "-// W3C // dtd html 4.01 Transitional // EN "" http://www.w3.org/TR/html4/loose.dtd "> <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.