奇怪,怎么csdn上没有高手吗?
解决方案 »
- JAVA基础,关于循环比较
- extjs 运行时报错---this.fp.form为空或不是对象
- 为什么csdn每次都需要输入密码??
- 如何在JSP中查询sqlserver中的数据以excel表格输出
- ApacheJServ-1.1.2-1.i386.rpm 是什么东东?
- 如何让表单中的select选择内容改变的时候提交表单
- 对于“动态 Form” 大家有什么高见? 望不吝赐教
- ※※※※初学问题:JSP部署中Web.xml的作用?
- 关于分页打印的问题
- 求助!大家快来帮忙啊!
- oci8和Thin的区别
- 各位大虾!!如果我用jdbc-odbc桥的数据库驱动,那岂不是当在本地机上做好网站之后,还需要在服务器上重新定义数据苦于数据源!但这是不
不过就不知道怎么编译的啦!
所以我们要做的就是把最终的jsp文件一次性的编译成class文件,然后打包发布?我以前做的几个公司,都没有做到这一点,我认为比较欠缺。那么,现在就是,如何使用jspc的问题了.希望大家与我一块儿探索,一块儿成长!谢谢支持!
因为jsp容器是按照jsp的规范来解释源代码的,你可以研究jsp规范。如果你的目的是要得到jsp编译后的文件,在你的web application下肯定是有的,除非这个jsp一次都没执行。
tomcat底下是jspc.bat的文件
jspc -uriroot . index.jsp
JSPC
-j jrun_root_dir
-s server
-a web_application_name
[-webroot path_to_web_root] [-vghn]
[-d output_directory]
[-compiler "compiler_spec"]
JSP_pathclasspath - (Optional) Specifies the classpath to the java command. You can specify it either on the command line or by using the CLASSPATH environment variable. The following paths must be specified in the classpath:All JAR files in the JRun_rootdir/lib directory
All JAR files in the directory JRun_rootdir/lib/ext directory
Depending on your compiler, you may have to specify additional files shipped with your JDK
Additional parameters are as follows:j - Specifies the JRun root directory.s - Specifies the server name.a - Specifies the Web application name.webroot - (Optional) Specifies the full path to the Web application’s root directory. This argument is required for Web applications for which the use-webserver-root property is set to true. You can optionally abbreviate this to -w.
v - (Optional) Specifies to display the name of each JSP file as the JSPC compiles it.g - (Optional) Specifies to display debug messages.h - (Optional) Specifies to display the JSPC compiler help message.n - (Optional) Specifies to compile only JSPs that are newer than the corresponding .class file.d - (Optional) Specifies where you want the JSPC compiler to write the output .class and .java files. By default, this directory is set to the current working directory. Typically, you specify the WEB-INF\jsp directory under the directory structure of a Web application. compiler - (Optional) Specifies a quoted string containing the compiler and compiler settings to use for the compile. If you omit this parameter, JRun compiles JSPs in-process using the Sun javac compiler. For example:java JSPC -compiler "javac -nowarn -classpath %c -d %d %f" ...
or
java JSPC -compiler "jvc /cp:c %c /dest: %d %f" ...JSP_path - Specifies the physical path of the JSP on your file system relative to the Web application by the -a parameter. You can specify multiple files, separated by spaces. You can use wildcard symbols to specify multiple files. The directory specified by -a and the JSP_path are combined to specify the JSP compiled. For example, if -a is a Web application located in c:\myapps\store and the JSP that you want to compile is named is c:\myapps\store\my.jsp, the JSP_path for the page is my.jsp. You can include wildcard symbols in the JSP_path if you are compiling multiple JSPs.