📅  最后修改于: 2021-01-05 01:06:20             🧑  作者: Mango
有许多JSP操作标记或元素。每个JSP操作标签都用于执行一些特定任务。
操作标签用于控制页面之间的流程并使用Java Bean。 Jsp操作标签在下面给出。
JSP Action Tags | Description |
---|---|
jsp:forward | forwards the request and response to another resource. |
jsp:include | includes another resource. |
jsp:useBean | creates or locates bean object. |
jsp:setProperty | sets the value of property in bean object. |
jsp:getProperty | prints the value of property of the bean. |
jsp:plugin | embeds another components such as applet. |
jsp:param | sets the parameter value. It is used in forward and include mostly. |
jsp:fallback | can be used to print the message if plugin is working. It is used in jsp:plugin. |
jsp:useBean,jsp:setProperty和jsp:getProperty标记用于bean开发。因此,我们将在bean开发中看到这些标签。
jsp:forward操作标记用于将请求转发到另一个资源,该资源可能是jsp,html或另一个资源。
在此示例中,我们只是将请求转发到printdate.jsp文件。
this is index page
<% out.print("Today is:"+java.util.Calendar.getInstance().getTime()); %>
在此示例中,我们将请求转发到带有参数的printdate.jsp文件,而printdate.jsp文件将带有日期和时间的参数值打印出来。
this is index page
<% out.print("Today is:"+java.util.Calendar.getInstance().getTime()); %>
<%= request.getParameter("name") %>