浏览 5872 次
该帖已经被评为新手帖
|
|
---|---|
作者 | 正文 |
发表时间:2008-05-02
最后修改:2009-04-16
当提交之后交给一个jsp处理,这个JSP也很简单 就是查询数据库有没有记录,就这么简单,成功之后加入session中,但是就是这么简单的事情,当我输入完用户名\密码\验证码后一切都成功,但是过程非常的慢,没办法,我只能在提交后的页面输出页面开始到页面结束所需要的时间,输出是31MS,也非常的快呀,但是为什么在提交后成功页面后久都出来了呢,看了一下后台,其实已经用31MS就执行完了验证,但是不知道tomcat为什么会自己加入下面那一段才会变得很慢 2008-5-2 14:36:51 org.apache.catalina.core.ApplicationContext log 信息: org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: Rule 0 run called with /user/chk.jsp 第一段=1209710211203 userName=test 第二段=0 第三段=0 第四段=31 第五段=31 第六段=31 //到这里只用了31 毫秒,到这里检测页面已经完成 ==================这部份是tomcat自已加的,非常的慢=============== 2008-5-2 14:37:11 org.apache.catalina.core.ApplicationContext log 信息: org.tuckey.web.filters.urlrewrite.ServerNameMatcher DEBUG: looking for hostname match on current server name localhost 2008-5-2 14:37:11 org.apache.catalina.core.ApplicationContext log 信息: org.tuckey.web.filters.urlrewrite.UrlRewriteFilter DEBUG: checking for status path on /user/css/comm.css 2008-5-2 14:37:11 org.apache.catalina.core.ApplicationContext log 信息: org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: processing request for /user/css/comm.css 2008-5-2 14:37:11 org.apache.catalina.core.ApplicationContext log 信息: org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: after utf-8 decoding /user/css/comm.css 2008-5-2 14:37:11 org.apache.catalina.core.ApplicationContext log 信息: org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: context stripped 2008-5-2 14:37:11 org.apache.catalina.core.ApplicationContext log 信息: org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: url /user/css/comm.css 2008-5-2 14:37:11 org.apache.catalina.core.ApplicationContext log 信息: org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: Rule 0 run called with /user/css/comm.css 2008-5-2 14:37:11 org.apache.catalina.core.ApplicationContext log 信息: org.tuckey.web.filters.urlrewrite.ServerNameMatcher DEBUG: looking for hostname match on current server name localhost 2008-5-2 14:37:11 org.apache.catalina.core.ApplicationContext log 信息: org.tuckey.web.filters.urlrewrite.UrlRewriteFilter DEBUG: checking for status path on /user/css/skin.css 2008-5-2 14:37:11 org.apache.catalina.core.ApplicationContext log 信息: org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: processing request for /user/css/skin.css 2008-5-2 14:37:11 org.apache.catalina.core.ApplicationContext log 信息: org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: after utf-8 decoding /user/css/skin.css 2008-5-2 14:37:11 org.apache.catalina.core.ApplicationContext log 信息: org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: context stripped 2008-5-2 14:37:11 org.apache.catalina.core.ApplicationContext log 信息: org.tuckey.web.filters.urlrewrite.UrlRewriter DEBUG: url /user/css/skin.css 2008-5-2 14:37:11 org.apache.catalina.core.ApplicationContext log 信息: org.tuckey.web.filters.urlrewrite.RuleBase DEBUG: Rule 0 run called with /user/css/skin.css ===========为什么会调用上面这段呢===> 请高行指点,非常感谢! 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2008-05-02
建议关闭 tomact 的 lookup
|
|
返回顶楼 | |
发表时间:2008-05-02
agapple 写道 建议关闭 tomact 的 lookup
谢谢,请问怎么关 |
|
返回顶楼 | |
发表时间:2008-05-02
也许你应该检查一下你的应用中的Filter的配置,可能是在URL重写的时候消耗了一定的资源。
|
|
返回顶楼 | |
发表时间:2008-05-02
Allen 写道 也许你应该检查一下你的应用中的Filter的配置,可能是在URL重写的时候消耗了一定的资源。
这是tomcat6.0.14 conf/server.xml的配置 <!-- Note: A "Server" is not itself a "Container", so you may not define subcomponents such as "Valves" at this level. Documentation at /docs/config/server.html --> <Server port="8005" shutdown="SHUTDOWN"> <!--APR library loader. Documentation at /docs/apr.html --> <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" /> <!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html --> <Listener className="org.apache.catalina.core.JasperListener" /> <!-- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html --> <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" /> <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> <!-- Global JNDI resources Documentation at /docs/jndi-resources-howto.html --> <GlobalNamingResources> <!-- Editable user database that can also be used by UserDatabaseRealm to authenticate users --> <Resource name="UserDatabase" auth="Container" type="org.apache.catalina.UserDatabase" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" pathname="conf/tomcat-users.xml" /> </GlobalNamingResources> <!-- A "Service" is a collection of one or more "Connectors" that share a single "Container" Note: A "Service" is not itself a "Container", so you may not define subcomponents such as "Valves" at this level. Documentation at /docs/config/service.html --> <Service name="Catalina"> <!--The connectors can use a shared executor, you can define one or more named thread pools--> <!-- <Executor name="tomcatThreadPool" namePrefix="catalina-exec-" maxThreads="150" minSpareThreads="4"/> --> <!-- A "Connector" represents an endpoint by which requests are received and responses are returned. Documentation at : Java HTTP Connector: /docs/config/http.html (blocking & non-blocking) Java AJP Connector: /docs/config/ajp.html APR (HTTP/AJP) Connector: /docs/apr.html Define a non-SSL HTTP/1.1 Connector on port 8080 --> <Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> <!-- A "Connector" using the shared thread pool--> <!-- <Connector executor="tomcatThreadPool" port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" /> --> <!-- Define a SSL HTTP/1.1 Connector on port 8443 This connector uses the JSSE configuration, when using APR, the connector should be using the OpenSSL style configuration described in the APR documentation --> <!-- <Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true" maxThreads="150" scheme="https" secure="true" clientAuth="false" sslProtocol="TLS" /> --> <!-- Define an AJP 1.3 Connector on port 8009 --> <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" /> <!-- An Engine represents the entry point (within Catalina) that processes every request. The Engine implementation for Tomcat stand alone analyzes the HTTP headers included with the request, and passes them on to the appropriate Host (virtual host). Documentation at /docs/config/engine.html --> <!-- You should set jvmRoute to support load-balancing via AJP ie : <Engine name="Standalone" defaultHost="localhost" jvmRoute="jvm1"> --> <Engine name="Catalina" defaultHost="localhost"> <!--For clustering, please take a look at documentation at: /docs/cluster-howto.html (simple how to) /docs/config/cluster.html (reference documentation) --> <!-- <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/> --> <!-- The request dumper valve dumps useful debugging information about the request and response data received and sent by Tomcat. Documentation at: /docs/config/valve.html --> <!-- <Valve className="org.apache.catalina.valves.RequestDumperValve"/> --> <!-- This Realm uses the UserDatabase configured in the global JNDI resources under the key "UserDatabase". Any edits that are performed against this UserDatabase are immediately available for use by the Realm. --> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> <!-- Define the default virtual host Note: XML Schema validation will not work with Xerces 2.2. --> <Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> <!-- SingleSignOn valve, share authentication between web applications Documentation at: /docs/config/valve.html --> <!-- <Valve className="org.apache.catalina.authenticator.SingleSignOn" /> --> <!-- Access log processes all example. Documentation at: /docs/config/valve.html --> <!-- <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/> --> <Context path="" docBase="D:/test/WebRoot" debug="0" privileged="true" reloadable="true"> <Resource name="jdbc/MysqlDB" type="javax.sql.DataSource" password="aaa" driverClassName="org.gjt.mm.mysql.Driver" maxIdle="5" maxWait="1" username="root" url="jdbc:mysql://localhost:3306/aaa?useUnicode=true&characterEncoding=utf-8" maxActive="10"/> </Context> </Host> </Engine> </Service> </Server> |
|
返回顶楼 | |
发表时间:2008-05-02
Tomcat本身应该是没有使用这个的:
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter 有可能是你的应用在web.xml里面指定使用这个Filter,所以对所有符合条件的URL都进行了“过滤”。 |
|
返回顶楼 | |
发表时间:2008-05-02
Allen 写道 Tomcat本身应该是没有使用这个的:
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter 有可能是你的应用在web.xml里面指定使用这个Filter,所以对所有符合条件的URL都进行了“过滤”。 非常感谢 Allen ,确实是这样的,在web.xml下找到这个: <filter-mapping> <filter-name>UrlRewriteFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> 但是还有一个问题,如何 Filter 除了/user/目录之外的所有文件及目录呢,如何在XML中配置 |
|
返回顶楼 | |
发表时间:2008-05-02
哈,真是怪事了,我已经把上面的url重写关闭了,重新启动tomcat,然后再提交,但是当提交后,看到后台已经输出执行完毕了,但是看看IE进度条还在那里慢慢地走着,大概等个3秒左右,页面才呈现出来(页面没有查询,是一句话),也就是和没关闭url重写所用的时间都差不多的
|
|
返回顶楼 | |
发表时间:2008-05-02
可能是我用的浏览器有问题,我在同事的机子上是相当地快,呵呵,谢谢大家的指定
|
|
返回顶楼 | |