4
Q
JSP为了
A
回答
1
我不认为除了它们在页面上出现的顺序之外,还有任何其他的执行顺序,即您写入它们的顺序。
样品:
<%-- page directive: This would go as the import of the generated class so executes first --%>
<%@ page import="my.foo" %>
<%@ page import="your.foo" %>
<% // this would be second & goes in _jspService method
out.println("This is a sample scriptlet");
%>
<%-- // JSTL Tag: this third (goes in _jspService method) --%>
<c:if test="<%= true %>">
<%-- // this fourth --%>
<%= "Sample expression. This will print only after the if is executed ... what! Ofcourse it is obvious :-)" %>
</c:if>
<!-- EL: this fourth (goes in _jspService method) -->
${requestScope}
<% // Scriptlet: this fifth (goes in _jspService method)
if (true) {
%>
This should be printed after the zero of expression language :-)
<!-- (goes in _jspService method) -->
<%
}
%>
// this sixth (goes in _jspService method)
<div>
Just some HTML element to make is more interesting.
I wonder I am even answering this question !!
Is it for points ... ssshhhhhh ...
</div>
<%! // Declaration: executes before everything (goes as an instance variable) may be placed before or after the _jspService method depends on the container
boolean declareME = true;
%>
但如果你问在订购JSP的元素将在Java类编译那就要看这个servlet容器上,我不这么认为它增加任何价值来理解这一点。
让我知道这是你想知道的全部。
相关问题
- 1. 角色了request.setAttribute JSP
- 2. 改写为JSP
- 3. 为了防止在JSP页面中输入空值
- 4. 哪个元素被按下了 - JSP
- 5. TypeError:getElementById为空使用JSP
- 6. 将JSP转换为JSTL
- 7. 为什么使用JSP/Servlets?
- 8. JSP会话不为空
- 9. Jquery为JSP变量赋值
- 10. JSP Servlet的另存为上
- 11. struts.action.extension为“jsp的”不工作
- 12. 为Servlet设置JSP位置
- 13. 为什么将JSP转换为Servlet?
- 14. 为了
- 15. 为了
- 16. 如何在JSP中为Spring提供JSP的数据模型mvc
- 17. JSP是servlet,但JSP中没有称为doGet()或doPost()的函数?
- 18. 我可以包含jsp作为innerHml从JavaScript函数的jsp中?
- 19. 如何终止线程当Jsp页面关闭,称它为JSP?
- 20. 为什么新的JSP抛出JasperException:无法编译JSP的类
- 21. Jsp调用另一个jsp
- 22. 试图从JSP调用类得到解决不了的错误
- 23. 是否取代了JSP?如果有,如何?
- 24. 变量里面写了一个JSP功能无法识别
- 25. 在使用Web框架之前,我需要了解JSP吗?
- 26. Struts2 validate()在jsp初始入口时调用了两次
- 27. 的sendRedirect不工作了JSP,但对HTML页面的工作
- 28. JSP 2和Servlet 2.4破坏了我的自定义标签
- 29. 显示spring @controller在jsp文件中提供了其他服务
- 30. 的Java /春/ JSP - 增加了如何产值使用ModelAndView.addObject
这可能有帮助。 http://www.onjava.com/pub/a/onjava/2004/06/09/jsf.html – rickz 2013-03-21 15:13:08
也查看生成的servlet java代码。 – 2013-03-21 15:22:25