着伟兄台,我找着你的配置修改了文件,凡县两个问题 1。resin服务器打开的情况下,我删掉了一个浏览器正在运行jsp文件,可浏览器无论如何刷新都没有报错(文件已经删掉,应该报错吧)。 2、我编的javabean程序存在了web-inf/class目录下,虚拟目录下的文件调用javabean很正常,可在一个子目录夏还是同一个文件(我将原先那个文件拷贝悼此处的)就报错。报错信息是 caipiao/index.jsp:2: cannot resolve symbol symbol : class Db location: class _caipiao._index__jsp Db test; 请指教 ^
我完整的resin.conf内容如下: <!-- - The Resin configuration file. - - This example file is more complicated than is needs to be because - it makes several configurations explicit that can be simplified and - because it needs to configure the examples. - - Look in conf/samples for more realistic sample configurations. - conf/samples/simple.conf - a simple, basic configuration - conf/samples/deploy.conf - a simple configuration for deployment - - The configuration is based on a purely element-based XML. To make - it easier to read, attributes can be used as syntactic sugar. - - The following are equivalent: - <foo><bar>13</bar></foo> - canonical representation, but verbose - <foo bar=13/> - typical configuration - <foo><bar id=13/></foo> - sometimes useful --> <caucho.com><!-- Resin logging. You can uncomment the following useful log. - - <log id='/caucho.com/tcp-server' - href='stderr:' - timestamp='[%H:%M:%S.%s]'/> --><!-- Security providers. Adding JSSE looks like: - <security-provider id='com.sun.net.ssl.internal.ssl.Provider'/> --><!-- - You can change the compiler to "internal" or jikes - and change the work-dir --> <java compiler="c:/jdk/bin/javac.exe" compiler-args="" work-dir='work'/><!-- - Sample database pool configuration - The JDBC name is java:comp/jdbc/test --> <resource-ref> <res-ref-name>jdbc/test</res-ref-name> <res-type>javax.sql.DataSource</res-type> <init-param driver-name="com.caucho.jdbc.mysql.Driver"/> <init-param url="jdbc:mysql_caucho://localhost:3306/test"/> <init-param user="sa"/> <init-param password=""/> <init-param max-connections="20"/> <init-param max-idle-time="30"/> </resource-ref><!-- - Use precompiled JSP classes if available. - 'static-encoding' - optimization if you stick to one character set --> <jsp precompile='true' static-encoding='true'/><!-- - For production sites, change class-update-interval to something - like 60, so it only checks for updates every minute. --> <http-server > <app-dir>e:/oa</app-dir> <http port='80'/> <srun host='127.0.0.1' port='6802'/> <caucho-status>true</caucho-status> <thread-max>150</thread-max> <thread-keepalive id='100'/> <request-timeout id='30s'/> <cache dir='cache' size='1024' entries='1024'/> <host id=''> <error-log id='log/error.log'/> <war-dir id='webapps'/> <web-app id='/'> <directory-servlet id='true'/>
…
<java compiler="/jdk1.4/bin/javac.exe" compiler-args="" work-dir='work'/> //指定JSP所采用的java编译路径
…
<resource-ref>
<res-ref-name>jdbc/test</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<init-param driver-name="com.caucho.jdbc.mysql.Driver"/> //MySQL JDBC 驱动名
<init-param url="jdbc:mysql_caucho://localhost:3306/test"/>
//Mysql数据库路径
<init-param user=""/> //用户名
<init-param password=""/> //口令
<init-param max-connections="20"/>
<init-param max-idle-time="30"/>
</resource-ref>
…
<app-dir>doc</app-dir> //指定Web根目录
…
<http port='80'/> //指定httpd端口号
…
<directory-servlet id='false'/>
//在<web-app id=’/’>后加入该行,目的是严禁客户端浏览目录
…
<classpath id='WEB-INF/classes'
source='WEB-INF/classes' //指定编译类路径
compile='true'/> //要编译此目录
…
<welcome-file-list>index.jsp</welcome-file-list>
//指定Httpd文件名
…
1. 运行c:\resin-2.0.1\bin\setup.exe设置与其它Web服务器的关联。
2. 重启Windows
1。resin服务器打开的情况下,我删掉了一个浏览器正在运行jsp文件,可浏览器无论如何刷新都没有报错(文件已经删掉,应该报错吧)。
2、我编的javabean程序存在了web-inf/class目录下,虚拟目录下的文件调用javabean很正常,可在一个子目录夏还是同一个文件(我将原先那个文件拷贝悼此处的)就报错。报错信息是
caipiao/index.jsp:2: cannot resolve symbol
symbol : class Db
location: class _caipiao._index__jsp
Db test;
请指教 ^
<!--
- The Resin configuration file.
-
- This example file is more complicated than is needs to be because
- it makes several configurations explicit that can be simplified and
- because it needs to configure the examples.
-
- Look in conf/samples for more realistic sample configurations.
- conf/samples/simple.conf - a simple, basic configuration
- conf/samples/deploy.conf - a simple configuration for deployment
-
- The configuration is based on a purely element-based XML. To make
- it easier to read, attributes can be used as syntactic sugar.
-
- The following are equivalent:
- <foo><bar>13</bar></foo> - canonical representation, but verbose
- <foo bar=13/> - typical configuration
- <foo><bar id=13/></foo> - sometimes useful
-->
<caucho.com><!-- Resin logging. You can uncomment the following useful log.
-
- <log id='/caucho.com/tcp-server'
- href='stderr:'
- timestamp='[%H:%M:%S.%s]'/>
--><!-- Security providers. Adding JSSE looks like:
- <security-provider id='com.sun.net.ssl.internal.ssl.Provider'/>
--><!--
- You can change the compiler to "internal" or jikes
- and change the work-dir
-->
<java compiler="c:/jdk/bin/javac.exe" compiler-args="" work-dir='work'/><!--
- Sample database pool configuration
- The JDBC name is java:comp/jdbc/test
-->
<resource-ref>
<res-ref-name>jdbc/test</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<init-param driver-name="com.caucho.jdbc.mysql.Driver"/>
<init-param url="jdbc:mysql_caucho://localhost:3306/test"/> <init-param user="sa"/>
<init-param password=""/>
<init-param max-connections="20"/>
<init-param max-idle-time="30"/>
</resource-ref><!--
- Use precompiled JSP classes if available.
- 'static-encoding' - optimization if you stick to one character set
-->
<jsp precompile='true' static-encoding='true'/><!--
- For production sites, change class-update-interval to something
- like 60, so it only checks for updates every minute.
-->
<http-server >
<app-dir>e:/oa</app-dir>
<http port='80'/>
<srun host='127.0.0.1' port='6802'/>
<caucho-status>true</caucho-status>
<thread-max>150</thread-max>
<thread-keepalive id='100'/>
<request-timeout id='30s'/>
<cache dir='cache' size='1024' entries='1024'/>
<host id=''>
<error-log id='log/error.log'/> <war-dir id='webapps'/>
<web-app id='/'>
<directory-servlet id='true'/>
<class-update-interval id='2'/>
<path-mapping url-pattern='/down' real-path='C:\Downloads'/> <classpath id="e:\oa/WEB-INF\classes"
source="e:\oa\WEB-INF\classes"
compile='true'/> <cache-mapping url-pattern='/' expires='2s'/>
<welcome-file-list>index.xtp, index.jsp, index.html</welcome-file-list> <session-config>
<session-max>4096</session-max>
<session-timeout>30</session-timeout>
<enable-cookies>true</enable-cookies>
<enable-url-rewriting>true</enable-url-rewriting> <file-store>sessions</file-store>
</session-config> <multipart-form/> <servlet-mapping url-pattern='/servlet/*' servlet-name='invoker'/>
<servlet-mapping url-pattern='*.xtp'
servlet-name='com.caucho.jsp.XtpServlet'/>
<servlet-mapping url-pattern='*.jsp'
servlet-name='com.caucho.jsp.JspServlet'/> <context-param info='An application information string'/> <servlet-mapping url-pattern='/snoop/*' servlet-name='snoop-servlet'/> <servlet servlet-name='snoop-servlet' servlet-class='Env'>
<init-param info='A servlet information string'/>
</servlet> <path-mapping url-regexp='^/~([^/]*)' real-path='/home/$1/public_html/'/>
<servlet-mapping url-pattern='/GuestJsp' servlet-name='GuestJsp'/>
<servlet-mapping url-pattern='/GuestXtp' servlet-name='GuestXtp'/>
<servlet-mapping url-pattern='/RSS' servlet-name='jsp.RSS'/>
<servlet servlet-name='GuestJsp' servlet-class='jsp.GuestJsp'/>
<servlet servlet-name='GuestXtp' servlet-class='jsp.GuestXtp'/>
</web-app>
</host>
</http-server>
</caucho.com>
请各位大虾挑挑毛病
这种方式下classes要放在classpath指定的地方你的classpath配置的也不对,乱七八糟的<classpath id="e:\oa/WEB-INF\classes" source="e:\oa\WEB-INF\classes" compile='true'/>
应该是<classpath id="e:\oa\WEB-INF\classes"
source="e:\oa\WEB-INF\classes"
compile='true'/>
虚拟目录最好用<web-app></web-app>指定,好像以前回答过你的问题?