jsp动作标记
JSP specification provides Standard(Action) tags for use within your JSP pages. These tags are used to remove or eliminate scriptlet code from your JSP page because scriplet code are technically not recommended nowadays. It's considered to be bad practice to put java code directly inside your JSP page.
JSP规范提供了在您的JSP页面中使用的标准 (动作)标记。 这些标记用于从JSP页面中删除或消除scriptlet代码,因为目前在技术上不建议使用scriplet代码。 将Java代码直接放在JSP页面内被认为是不好的做法。
Standard tags begin with the jsp:
prefix. There are many JSP Standard Action tag which are used to perform some specific task.
标准标记以jsp:
前缀开头。 有许多用于执行某些特定任务的JSP Standard Action标记。
The following are some JSP Standard Action Tags available:
以下是一些可用的JSP标准操作标签:
Action Tag | Description |
---|---|
jsp:forward | forward the request to a new page Usage : |
jsp:useBean | instantiates a JavaBean Usage : |
jsp:getProperty | retrieves a property from a JavaBean instance. Usage : Where, beanName is the name of pre-defined bean whose property we want to access. |
jsp:setProperty | store data in property of any JavaBeans instance. Usage : Where, beanName is the name of pre-defined bean whose property we want to access. |
jsp:include | includes the runtime response of a JSP page into the current page. |
jsp:plugin | Generates client browser-specific construct that makes an OBJECT or EMBED tag for the Java Applets |
jsp:fallback | Supplies alternate text if java plugin is unavailable on the client. You can print a message using this, if the included jsp plugin is not loaded. |
jsp:element | Defines XML elements dynamically |
jsp:attribute | defines dynamically defined XML element's attribute |
jsp:body | Used within standard or custom tags to supply the tag body. |
jsp:param | Adds parameters to the request object. |
jsp:text | Used to write template text in JSP pages and documents. Usage : |
动作标签 | 描述 |
---|---|
jsp:forward | 将请求转发到新页面 用法: |
jsp:useBean | 实例化一个JavaBean 用法: |
jsp:getProperty | 从JavaBean实例检索属性。 用法: 其中, beanName是我们要访问其属性的预定义bean的名称。 |
jsp:setProperty | 将数据存储在任何JavaBeans实例的属性中。 用法: 其中, beanName是我们要访问其属性的预定义bean的名称。 |
jsp:include | 在当前页面中包含JSP页面的运行时响应。 |
jsp:plugin | 生成特定于客户端浏览器的构造,该构造为Java Applets创建OBJECT或EMBED标签 |
jsp:fallback | 如果Java插件在客户端上不可用,则提供备用文本。 如果未加载随附的jsp插件,则可以使用此方法打印消息。 |
jsp:element | 动态定义XML元素 |
jsp:attribute | 定义动态定义的XML元素的属性 |
jsp:body | 在标准或自定义标签中使用以提供标签主体。 |
jsp:param | 将参数添加到请求对象。 |
jsp:text | 用于在JSP页面和文档中编写模板文本。 用法: |
翻译自: https://www.studytonight.com/jsp/jsp-action-element.php
jsp动作标记