You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by A Yang <ay...@yahoo.ca> on 2001/05/29 16:20:34 UTC
response.sendRedirect vs. requestDispatcher.forward
Hi All,
Does anyone know offhand whether the Java Servlet
specification requires a new HttpSession to be created
when using HttpServletResponse.sendRedirect()?
In a servlet, I was using:
getServletConfig().getServletContext().getRequestDispatcher("/Result.jsp").forward(req,
resp);
at the end of a sequence of pages/servlets, but I
wanted to replace it with
response.sendRedirect("/Result.jsp");
instead. The result page prints out the contents of
several javabeans which are stored in the session.
This worked fine when all I used were
requestDispatcher.forward but with
response.sendRedirect(), all of my session attributes
are gone! In fact, the session id is different after
the sendRedirect.
I'm pretty sure the session is supposed to survive
across any series of GET's and POST's until it is
invalidated explicitly (or timed out).
Any thoughts? I'm using Tomcat 3.2.1
Thanks.
_______________________________________________________
Do You Yahoo!?
Get your free @yahoo.ca address at http://mail.yahoo.ca
Re: response.sendRedirect vs. requestDispatcher.forward
Posted by Alex Fernández <af...@tid.es>.
Hi Andy!
Just a fine point here.
A Yang wrote:
> RequestDispatch.forward takes a URL that is a RELATIVE
> path but also requires a leading slash.
>From the javadoc of ServletRequest.getRequestDispatcher(String):
'The pathname specified may be relative, although it cannot extend
outside the current servlet context. If the path begins with a "/" it is
interpreted as relative to the current context root. This method returns
null if the servlet container cannot return a RequestDispatcher.
The difference between this method and
ServletContext.getRequestDispatcher(String) is that this method can take
a relative path.'
So, if you get your RequestDispatcher from the request, you don't need
the leading "/".
Un saludo,
Alex.
Re: startup exceptions
Posted by Hemant Singh <Si...@Yahoo.com>.
HI Boris:
>From the exeption trace you sended only meaningfull thing i can see is that
probably in any one of the web.xml files present under you webapps is
missing <web-app> element,
check your all webapps for the presence of proper <web-app> element in there
web.xml file
I tried removing <web-app> element from one (admin) of the web.xml, but i
does n't gived up any startup exception but one i tried accessing that
servlet, though it successfully opend up the servlet,
i m using tomcat3.2.1 on Win ME.
Cheers
----- Original Message -----
From: "Boris Garbuzov" <bo...@borealissoft.com>
To: <to...@jakarta.apache.org>
Sent: Thursday, May 31, 2001 10:48 PM
Subject: startup exceptions
> Hello to you, Tomcat experts. I am using tomcat 4. Upon the very start it
> throws the following. Then it works fine in most of examples. Any
suggestions
> what I should do? Boris.
>
> ------------------------console-----------------------------
> Starting service Tomcat-Standalone
> Apache Tomcat/4.0-b5
> PARSE error at line 1 column -1
> org.xml.sax.SAXParseException: Element type "web-app" is not declared.
> PARSE error at line 1 column -1
> org.xml.sax.SAXParseException: Element type "web-app" is not declared.
> Starting service Tomcat-Apache
> Apache Tomcat/4.0-b5
>
> ----------------------localhost_log.2001-05-31.txt------------------------
>
> 2001-05-31 10:08:03 StandardManager[/JRunForum]: Seeding random number
> generator class java.security.SecureRandom
> 2001-05-31 10:08:03 StandardManager[/JRunForum]: Seeding of random number
> generator has been completed
> 2001-05-31 10:08:03 ContextConfig[/JRunForum] Parse error in application
> web.xml
> org.xml.sax.SAXParseException: Element type "web-app" is not declared.
> at org.apache.crimson.parser.Parser2.error(Parser2.java:3013)
> at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1308)
> at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:499)
> at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
> at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
> at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
> at javax.xml.parsers.SAXParser.parse(SAXParser.java:317)
> at javax.xml.parsers.SAXParser.parse(SAXParser.java:108)
> at org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:275)
> at
>
org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConfig.ja
va:247)
>
> at
org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:820)
> at
>
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:
217)
>
> at
>
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor
t.java:155)
>
> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131)
> at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3189)
> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
> at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:278)
> at
org.apache.catalina.core.StandardService.start(StandardService.java:353)
> at org.apache.catalina.core.StandardServer.start(StandardServer.java:458)
> at org.apache.catalina.startup.Catalina.start(Catalina.java:725)
> at org.apache.catalina.startup.Catalina.execute(Catalina.java:647)
> at org.apache.catalina.startup.Catalina.process(Catalina.java:177)
> at java.lang.reflect.Method.invoke(Native Method)
> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:196)
>
> 2001-05-31 10:08:03 ContextConfig[/JRunForum]: Occurred at line 1
column -1
> 2001-05-31 10:08:03 ContextConfig[/JRunForum]: Marking this application
> unavailable due to previous error(s)
> 2001-05-31 10:08:03 StandardWrapper[/JRunForum:default]: Loading container
> servlet default
> 2001-05-31 10:08:03 default: init
> 2001-05-31 10:08:03 StandardWrapper[/JRunForum:invoker]: Loading container
> servlet invoker
> 2001-05-31 10:08:03 invoker: init
> 2001-05-31 10:08:03 StandardWrapper[/JRunForum:jsp]: Using Jasper
classloader
> for servlet jsp
> 2001-05-31 10:08:04 StandardWrapper[/JRunForum:jsp]: Marking servlet jsp
as
> unavailable
> 2001-05-31 10:08:04 StandardContext[/JRunForum]: Servlet /JRunForum threw
> load() exception
> javax.servlet.ServletException: Error instantiating servlet class
> org.apache.jasper.servlet.JspServlet
> at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:817)
> at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3277)
> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
> at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:278)
> at
org.apache.catalina.core.StandardService.start(StandardService.java:353)
> at org.apache.catalina.core.StandardServer.start(StandardServer.java:458)
> at org.apache.catalina.startup.Catalina.start(Catalina.java:725)
> at org.apache.catalina.startup.Catalina.execute(Catalina.java:647)
> at org.apache.catalina.startup.Catalina.process(Catalina.java:177)
> at java.lang.reflect.Method.invoke(Native Method)
> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:196)
> ----- Root Cause -----
> java.lang.VerifyError: (class: org/apache/jasper/servlet/JspServlet,
method:
> init signature: (Ljavax/servlet/ServletConfig;)V) Incompatible argument to
> function
> at java.lang.Class.newInstance0(Native Method)
> at java.lang.Class.newInstance(Class.java:237)
> at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:810)
> at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3277)
> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
> at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:278)
> at
org.apache.catalina.core.StandardService.start(StandardService.java:353)
> at org.apache.catalina.core.StandardServer.start(StandardServer.java:458)
> at org.apache.catalina.startup.Catalina.start(Catalina.java:725)
> at org.apache.catalina.startup.Catalina.execute(Catalina.java:647)
> at org.apache.catalina.startup.Catalina.process(Catalina.java:177)
> at java.lang.reflect.Method.invoke(Native Method)
> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:196)
>
> 2001-05-31 10:08:04 StandardWrapper[/JRunForum:ssi]: Loading container
servlet
> ssi
> 2001-05-31 10:08:04 ssi: init
> 2001-05-31 10:08:05 StandardHost[localhost]: Installing web application at
> context path from URL file:D:\tomcat\webapps\ROOT
> 2001-05-31 10:08:05 StandardManager[]: Seeding random number generator
class
> java.security.SecureRandom
> 2001-05-31 10:08:05 StandardManager[]: Seeding of random number generator
has
> been completed
> 2001-05-31 10:08:06 StandardWrapper[:default]: Loading container servlet
> default
> 2001-05-31 10:08:06 default: init
> 2001-05-31 10:08:06 StandardWrapper[:invoker]: Loading container servlet
> invoker
> 2001-05-31 10:08:06 invoker: init
> 2001-05-31 10:08:06 StandardWrapper[:jsp]: Using Jasper classloader for
servlet
> jsp
> 2001-05-31 10:08:06 jsp: init
> 2001-05-31 10:08:08 StandardWrapper[:ssi]: Loading container servlet ssi
> 2001-05-31 10:08:08 ssi: init
> 2001-05-31 10:08:08 StandardHost[localhost]: Installing web application at
> context path /manager from URL file:D:\tomcat\webapps\manager
> 2001-05-31 10:08:08 StandardManager[/manager]: Seeding random number
generator
> class java.security.SecureRandom
> 2001-05-31 10:08:08 StandardManager[/manager]: Seeding of random number
> generator has been completed
> 2001-05-31 10:08:08 ContextConfig[/manager]: Configured an authenticator
for
> method BASIC
> 2001-05-31 10:08:08 StandardWrapper[/manager:default]: Loading container
> servlet default
> 2001-05-31 10:08:08 default: init
> 2001-05-31 10:08:08 StandardWrapper[/manager:invoker]: Loading container
> servlet invoker
> 2001-05-31 10:08:08 invoker: init
> 2001-05-31 10:08:08 StandardWrapper[/manager:jsp]: Using Jasper
classloader for
> servlet jsp
> 2001-05-31 10:08:08 jsp: init
> 2001-05-31 10:08:08 StandardWrapper[/manager:ssi]: Loading container
servlet
> ssi
> 2001-05-31 10:08:08 ssi: init
> 2001-05-31 10:08:08 StandardHost[localhost]: Installing web application at
> context path /webdav from URL file:D:\tomcat\webapps\webdav
> 2001-05-31 10:08:08 StandardManager[/webdav]: Seeding random number
generator
> class java.security.SecureRandom
> 2001-05-31 10:08:08 StandardManager[/webdav]: Seeding of random number
> generator has been completed
> 2001-05-31 10:08:08 StandardWrapper[/webdav:default]: Loading container
servlet
> default
> 2001-05-31 10:08:08 default: init
> 2001-05-31 10:08:08 StandardWrapper[/webdav:invoker]: Loading container
servlet
> invoker
> 2001-05-31 10:08:08 invoker: init
> 2001-05-31 10:08:08 StandardWrapper[/webdav:jsp]: Using Jasper classloader
for
> servlet jsp
> 2001-05-31 10:08:09 jsp: init
> 2001-05-31 10:08:09 StandardWrapper[/webdav:ssi]: Loading container
servlet ssi
>
> 2001-05-31 10:08:09 ssi: init
> 2001-05-31 10:08:09 StandardHost[localhost]: Installing web application at
> context path /forums from URL jar:file:D:\tomcat\webapps\forums.war!/
> 2001-05-31 10:08:09 StandardManager[/forums]: Seeding random number
generator
> class java.security.SecureRandom
> 2001-05-31 10:08:09 StandardManager[/forums]: Seeding of random number
> generator has been completed
> 2001-05-31 10:08:09 StandardContext[/forums]: WARNING: URL pattern demo
must
> start with a / in Servlet 2.3
> 2001-05-31 10:08:09 StandardWrapper[/forums:default]: Loading container
servlet
> default
> 2001-05-31 10:08:09 default: init
> 2001-05-31 10:08:09 StandardWrapper[/forums:invoker]: Loading container
servlet
> invoker
> 2001-05-31 10:08:09 invoker: init
> 2001-05-31 10:08:09 StandardWrapper[/forums:jsp]: Using Jasper classloader
for
> servlet jsp
> 2001-05-31 10:08:10 jsp: init
> 2001-05-31 10:08:10 StandardWrapper[/forums:ssi]: Loading container
servlet ssi
>
> 2001-05-31 10:08:10 ssi: init
> 2001-05-31 10:08:10 StandardHost[localhost]: Installing web application at
> context path /forum from URL file:D:\tomcat\webapps\forum
> 2001-05-31 10:08:10 StandardManager[/forum]: Seeding random number
generator
> class java.security.SecureRandom
> 2001-05-31 10:08:10 StandardManager[/forum]: Seeding of random number
generator
> has been completed
> 2001-05-31 10:08:10 ContextConfig[/forum] Parse error in application
web.xml
> org.xml.sax.SAXParseException: Element type "web-app" is not declared.
> at org.apache.crimson.parser.Parser2.error(Parser2.java:3013)
> at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1308)
> at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:499)
> at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
> at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
> at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
> at javax.xml.parsers.SAXParser.parse(SAXParser.java:317)
> at javax.xml.parsers.SAXParser.parse(SAXParser.java:108)
> at org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:275)
> at
>
org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConfig.ja
va:247)
>
> at
org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:820)
> at
>
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:
217)
>
> at
>
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor
t.java:155)
>
> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131)
> at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3189)
> at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785)
> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:413)
> at org.apache.catalina.core.StandardHost.install(StandardHost.java:641)
> at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:300)
> at org.apache.catalina.startup.HostConfig.start(HostConfig.java:389)
> at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:232)
> at
>
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor
t.java:155)
>
> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131)
> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
> at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:278)
> at
org.apache.catalina.core.StandardService.start(StandardService.java:353)
> at org.apache.catalina.core.StandardServer.start(StandardServer.java:458)
> at org.apache.catalina.startup.Catalina.start(Catalina.java:725)
> at org.apache.catalina.startup.Catalina.execute(Catalina.java:647)
> at org.apache.catalina.startup.Catalina.process(Catalina.java:177)
> at java.lang.reflect.Method.invoke(Native Method)
> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:196)
>
> 2001-05-31 10:08:10 ContextConfig[/forum]: Occurred at line 1 column -1
> 2001-05-31 10:08:10 ContextConfig[/forum]: Marking this application
unavailable
> due to previous error(s)
> 2001-05-31 10:08:10 StandardWrapper[/forum:default]: Loading container
servlet
> default
> 2001-05-31 10:08:10 default: init
> 2001-05-31 10:08:10 StandardWrapper[/forum:invoker]: Loading container
servlet
> invoker
> 2001-05-31 10:08:10 invoker: init
> 2001-05-31 10:08:10 StandardWrapper[/forum:jsp]: Using Jasper classloader
for
> servlet jsp
> 2001-05-31 10:08:10 StandardWrapper[/forum:jsp]: Marking servlet jsp as
> unavailable
> 2001-05-31 10:08:10 StandardContext[/forum]: Servlet /forum threw load()
> exception
> javax.servlet.ServletException: Error instantiating servlet class
> org.apache.jasper.servlet.JspServlet
> at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:817)
> at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3277)
> at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785)
> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:413)
> at org.apache.catalina.core.StandardHost.install(StandardHost.java:641)
> at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:300)
> at org.apache.catalina.startup.HostConfig.start(HostConfig.java:389)
> at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:232)
> at
>
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor
t.java:155)
>
> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131)
> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
> at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:278)
> at
org.apache.catalina.core.StandardService.start(StandardService.java:353)
> at org.apache.catalina.core.StandardServer.start(StandardServer.java:458)
> at org.apache.catalina.startup.Catalina.start(Catalina.java:725)
> at org.apache.catalina.startup.Catalina.execute(Catalina.java:647)
> at org.apache.catalina.startup.Catalina.process(Catalina.java:177)
> at java.lang.reflect.Method.invoke(Native Method)
> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:196)
> ----- Root Cause -----
> java.lang.VerifyError: (class: org/apache/jasper/servlet/JspServlet,
method:
> init signature: (Ljavax/servlet/ServletConfig;)V) Incompatible argument to
> function
> at java.lang.Class.newInstance0(Native Method)
> at java.lang.Class.newInstance(Class.java:237)
> at
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:810)
> at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3277)
> at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785)
> at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:413)
> at org.apache.catalina.core.StandardHost.install(StandardHost.java:641)
> at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:300)
> at org.apache.catalina.startup.HostConfig.start(HostConfig.java:389)
> at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:232)
> at
>
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSuppor
t.java:155)
>
> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131)
> at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
> at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:278)
> at
org.apache.catalina.core.StandardService.start(StandardService.java:353)
> at org.apache.catalina.core.StandardServer.start(StandardServer.java:458)
> at org.apache.catalina.startup.Catalina.start(Catalina.java:725)
> at org.apache.catalina.startup.Catalina.execute(Catalina.java:647)
> at org.apache.catalina.startup.Catalina.process(Catalina.java:177)
> at java.lang.reflect.Method.invoke(Native Method)
> at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:196)
>
> 2001-05-31 10:08:10 StandardWrapper[/forum:ssi]: Loading container servlet
ssi
> 2001-05-31 10:08:10 ssi: init
>
startup exceptions
Posted by Boris Garbuzov <bo...@borealissoft.com>.
Hello to you, Tomcat experts. I am using tomcat 4. Upon the very start it
throws the following. Then it works fine in most of examples. Any suggestions
what I should do? Boris.
------------------------console-----------------------------
Starting service Tomcat-Standalone
Apache Tomcat/4.0-b5
PARSE error at line 1 column -1
org.xml.sax.SAXParseException: Element type "web-app" is not declared.
PARSE error at line 1 column -1
org.xml.sax.SAXParseException: Element type "web-app" is not declared.
Starting service Tomcat-Apache
Apache Tomcat/4.0-b5
----------------------localhost_log.2001-05-31.txt------------------------
2001-05-31 10:08:03 StandardManager[/JRunForum]: Seeding random number
generator class java.security.SecureRandom
2001-05-31 10:08:03 StandardManager[/JRunForum]: Seeding of random number
generator has been completed
2001-05-31 10:08:03 ContextConfig[/JRunForum] Parse error in application
web.xml
org.xml.sax.SAXParseException: Element type "web-app" is not declared.
at org.apache.crimson.parser.Parser2.error(Parser2.java:3013)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1308)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:499)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:317)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:108)
at org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:275)
at
org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConfig.java:247)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:820)
at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:217)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:155)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3189)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:278)
at org.apache.catalina.core.StandardService.start(StandardService.java:353)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:458)
at org.apache.catalina.startup.Catalina.start(Catalina.java:725)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:647)
at org.apache.catalina.startup.Catalina.process(Catalina.java:177)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:196)
2001-05-31 10:08:03 ContextConfig[/JRunForum]: Occurred at line 1 column -1
2001-05-31 10:08:03 ContextConfig[/JRunForum]: Marking this application
unavailable due to previous error(s)
2001-05-31 10:08:03 StandardWrapper[/JRunForum:default]: Loading container
servlet default
2001-05-31 10:08:03 default: init
2001-05-31 10:08:03 StandardWrapper[/JRunForum:invoker]: Loading container
servlet invoker
2001-05-31 10:08:03 invoker: init
2001-05-31 10:08:03 StandardWrapper[/JRunForum:jsp]: Using Jasper classloader
for servlet jsp
2001-05-31 10:08:04 StandardWrapper[/JRunForum:jsp]: Marking servlet jsp as
unavailable
2001-05-31 10:08:04 StandardContext[/JRunForum]: Servlet /JRunForum threw
load() exception
javax.servlet.ServletException: Error instantiating servlet class
org.apache.jasper.servlet.JspServlet
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:817)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3277)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:278)
at org.apache.catalina.core.StandardService.start(StandardService.java:353)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:458)
at org.apache.catalina.startup.Catalina.start(Catalina.java:725)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:647)
at org.apache.catalina.startup.Catalina.process(Catalina.java:177)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:196)
----- Root Cause -----
java.lang.VerifyError: (class: org/apache/jasper/servlet/JspServlet, method:
init signature: (Ljavax/servlet/ServletConfig;)V) Incompatible argument to
function
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:237)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:810)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3277)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:278)
at org.apache.catalina.core.StandardService.start(StandardService.java:353)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:458)
at org.apache.catalina.startup.Catalina.start(Catalina.java:725)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:647)
at org.apache.catalina.startup.Catalina.process(Catalina.java:177)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:196)
2001-05-31 10:08:04 StandardWrapper[/JRunForum:ssi]: Loading container servlet
ssi
2001-05-31 10:08:04 ssi: init
2001-05-31 10:08:05 StandardHost[localhost]: Installing web application at
context path from URL file:D:\tomcat\webapps\ROOT
2001-05-31 10:08:05 StandardManager[]: Seeding random number generator class
java.security.SecureRandom
2001-05-31 10:08:05 StandardManager[]: Seeding of random number generator has
been completed
2001-05-31 10:08:06 StandardWrapper[:default]: Loading container servlet
default
2001-05-31 10:08:06 default: init
2001-05-31 10:08:06 StandardWrapper[:invoker]: Loading container servlet
invoker
2001-05-31 10:08:06 invoker: init
2001-05-31 10:08:06 StandardWrapper[:jsp]: Using Jasper classloader for servlet
jsp
2001-05-31 10:08:06 jsp: init
2001-05-31 10:08:08 StandardWrapper[:ssi]: Loading container servlet ssi
2001-05-31 10:08:08 ssi: init
2001-05-31 10:08:08 StandardHost[localhost]: Installing web application at
context path /manager from URL file:D:\tomcat\webapps\manager
2001-05-31 10:08:08 StandardManager[/manager]: Seeding random number generator
class java.security.SecureRandom
2001-05-31 10:08:08 StandardManager[/manager]: Seeding of random number
generator has been completed
2001-05-31 10:08:08 ContextConfig[/manager]: Configured an authenticator for
method BASIC
2001-05-31 10:08:08 StandardWrapper[/manager:default]: Loading container
servlet default
2001-05-31 10:08:08 default: init
2001-05-31 10:08:08 StandardWrapper[/manager:invoker]: Loading container
servlet invoker
2001-05-31 10:08:08 invoker: init
2001-05-31 10:08:08 StandardWrapper[/manager:jsp]: Using Jasper classloader for
servlet jsp
2001-05-31 10:08:08 jsp: init
2001-05-31 10:08:08 StandardWrapper[/manager:ssi]: Loading container servlet
ssi
2001-05-31 10:08:08 ssi: init
2001-05-31 10:08:08 StandardHost[localhost]: Installing web application at
context path /webdav from URL file:D:\tomcat\webapps\webdav
2001-05-31 10:08:08 StandardManager[/webdav]: Seeding random number generator
class java.security.SecureRandom
2001-05-31 10:08:08 StandardManager[/webdav]: Seeding of random number
generator has been completed
2001-05-31 10:08:08 StandardWrapper[/webdav:default]: Loading container servlet
default
2001-05-31 10:08:08 default: init
2001-05-31 10:08:08 StandardWrapper[/webdav:invoker]: Loading container servlet
invoker
2001-05-31 10:08:08 invoker: init
2001-05-31 10:08:08 StandardWrapper[/webdav:jsp]: Using Jasper classloader for
servlet jsp
2001-05-31 10:08:09 jsp: init
2001-05-31 10:08:09 StandardWrapper[/webdav:ssi]: Loading container servlet ssi
2001-05-31 10:08:09 ssi: init
2001-05-31 10:08:09 StandardHost[localhost]: Installing web application at
context path /forums from URL jar:file:D:\tomcat\webapps\forums.war!/
2001-05-31 10:08:09 StandardManager[/forums]: Seeding random number generator
class java.security.SecureRandom
2001-05-31 10:08:09 StandardManager[/forums]: Seeding of random number
generator has been completed
2001-05-31 10:08:09 StandardContext[/forums]: WARNING: URL pattern demo must
start with a / in Servlet 2.3
2001-05-31 10:08:09 StandardWrapper[/forums:default]: Loading container servlet
default
2001-05-31 10:08:09 default: init
2001-05-31 10:08:09 StandardWrapper[/forums:invoker]: Loading container servlet
invoker
2001-05-31 10:08:09 invoker: init
2001-05-31 10:08:09 StandardWrapper[/forums:jsp]: Using Jasper classloader for
servlet jsp
2001-05-31 10:08:10 jsp: init
2001-05-31 10:08:10 StandardWrapper[/forums:ssi]: Loading container servlet ssi
2001-05-31 10:08:10 ssi: init
2001-05-31 10:08:10 StandardHost[localhost]: Installing web application at
context path /forum from URL file:D:\tomcat\webapps\forum
2001-05-31 10:08:10 StandardManager[/forum]: Seeding random number generator
class java.security.SecureRandom
2001-05-31 10:08:10 StandardManager[/forum]: Seeding of random number generator
has been completed
2001-05-31 10:08:10 ContextConfig[/forum] Parse error in application web.xml
org.xml.sax.SAXParseException: Element type "web-app" is not declared.
at org.apache.crimson.parser.Parser2.error(Parser2.java:3013)
at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1308)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:499)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:304)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:433)
at org.xml.sax.helpers.XMLReaderAdapter.parse(XMLReaderAdapter.java:223)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:317)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:108)
at org.apache.catalina.util.xml.XmlMapper.readXml(XmlMapper.java:275)
at
org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConfig.java:247)
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:820)
at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:217)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:155)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3189)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:413)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:641)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:300)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:389)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:232)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:155)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:278)
at org.apache.catalina.core.StandardService.start(StandardService.java:353)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:458)
at org.apache.catalina.startup.Catalina.start(Catalina.java:725)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:647)
at org.apache.catalina.startup.Catalina.process(Catalina.java:177)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:196)
2001-05-31 10:08:10 ContextConfig[/forum]: Occurred at line 1 column -1
2001-05-31 10:08:10 ContextConfig[/forum]: Marking this application unavailable
due to previous error(s)
2001-05-31 10:08:10 StandardWrapper[/forum:default]: Loading container servlet
default
2001-05-31 10:08:10 default: init
2001-05-31 10:08:10 StandardWrapper[/forum:invoker]: Loading container servlet
invoker
2001-05-31 10:08:10 invoker: init
2001-05-31 10:08:10 StandardWrapper[/forum:jsp]: Using Jasper classloader for
servlet jsp
2001-05-31 10:08:10 StandardWrapper[/forum:jsp]: Marking servlet jsp as
unavailable
2001-05-31 10:08:10 StandardContext[/forum]: Servlet /forum threw load()
exception
javax.servlet.ServletException: Error instantiating servlet class
org.apache.jasper.servlet.JspServlet
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:817)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3277)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:413)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:641)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:300)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:389)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:232)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:155)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:278)
at org.apache.catalina.core.StandardService.start(StandardService.java:353)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:458)
at org.apache.catalina.startup.Catalina.start(Catalina.java:725)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:647)
at org.apache.catalina.startup.Catalina.process(Catalina.java:177)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:196)
----- Root Cause -----
java.lang.VerifyError: (class: org/apache/jasper/servlet/JspServlet, method:
init signature: (Ljavax/servlet/ServletConfig;)V) Incompatible argument to
function
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:237)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:810)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3277)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:785)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:413)
at org.apache.catalina.core.StandardHost.install(StandardHost.java:641)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:300)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:389)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:232)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:155)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1131)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:278)
at org.apache.catalina.core.StandardService.start(StandardService.java:353)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:458)
at org.apache.catalina.startup.Catalina.start(Catalina.java:725)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:647)
at org.apache.catalina.startup.Catalina.process(Catalina.java:177)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:196)
2001-05-31 10:08:10 StandardWrapper[/forum:ssi]: Loading container servlet ssi
2001-05-31 10:08:10 ssi: init
RE: How can I redirect a page when using apache>mod_jk>tomcat
Posted by Martin van den Bemt <mv...@mvdb.com>.
Don't know how jsp pages work though (they are servlets is all I know, so
I'm speaking from a servlet point of view) : after the redirect use a
return..
Mvgr,
Martin
> -----Original Message-----
> From: Brandon Cruz [mailto:bcruz@norvax.com]
> Sent: Thursday, May 31, 2001 4:46 PM
> To: tomcat-user@jakarta.apache.org
> Subject: How can I redirect a page when using apache>mod_jk>tomcat
>
>
> Is there any way I can redirect a jsp page using this
> configuration without
> having apache confused and printing out all the headers?
>
>
How can I redirect a page when using apache>mod_jk>tomcat
Posted by Brandon Cruz <bc...@norvax.com>.
Is there any way I can redirect a jsp page using this configuration without
having apache confused and printing out all the headers?
RE: response.sendRedirect vs. requestDispatcher.forward
Posted by Martin van den Bemt <mv...@mvdb.com>.
Hi,
Never used the reqeuestdispatcher, but in your case it could be something
like :
response.sendRedirect("http://<servername>/<context>/login.jsp");
(don't know where tomcat is serving jsp files though, I never use them..)
Mvgr,
Martin
> -----Original Message-----
> From: Brandon Cruz [mailto:bcruz@norvax.com]
> Sent: Thursday, May 31, 2001 3:26 PM
> To: tomcat-user@jakarta.apache.org
> Subject: RE: response.sendRedirect vs. requestDispatcher.forward
>
>
> So what is the correct way to redirect? I have started using
> relative links
> to redirect and it seems to fix the problem. Is this just coincidence, or
> is there an explanation for that?
>
> Brandon
>
> -----Original Message-----
> From: Martin van den Bemt [mailto:mvdb@mvdb.com]
> Sent: Wednesday, May 30, 2001 6:38 PM
> To: tomcat-user@jakarta.apache.org
> Subject: RE: response.sendRedirect vs. requestDispatcher.forward
>
>
> If you webserver is serving in /usr/local/apache/htdocs, you are
> redirecting
> to /usr/local/apache/htdocs/login.jsp, which is handled in this example by
> apache, who doesn't know anything about jsp files. (that's why you got
> tomcat in the first place...)
>
> Mvgr,
> Martin
>
> > -----Original Message-----
> > From: Brandon Cruz [mailto:bcruz@norvax.com]
> > Sent: Thursday, May 31, 2001 1:31 AM
> > To: tomcat-user@jakarta.apache.org
> > Subject: RE: response.sendRedirect vs. requestDispatcher.forward
> >
> >
> > Has anyone figured out why response.sendRedirect("/login.jsp")
> > will not work
> > when using apache-tomcat with mod_jk? It gets all screwed up
> and prints a
> > bunch of header information out to the page...is there a way around it
> > besides using javascript to redirect the page?
> >
> > Brandon Cruz
> >
> > -----Original Message-----
> > From: A Yang [mailto:ayang_ml@yahoo.ca]
> > Sent: Wednesday, May 30, 2001 1:13 PM
> > To: tomcat-user@jakarta.apache.org
> > Subject: RE: response.sendRedirect vs. requestDispatcher.forward
> >
> >
> > Hi,
> >
> > Thanks for the help. As it turns out, switching
> > between requestDispath.forward and response.redirect
> > will trip you up because of differences in what they
> > expect as their parameters.
> >
> > RequestDispatch.forward takes a URL that is a RELATIVE
> > path but also requires a leading slash.
> >
> > If you are brilliant (like myself) and you change your
> > code to use response.encodeRedirectURL but you KEEP
> > that leading slash, well then. Your response will
> > treat it like an absolute path and wind up plunking
> > you into a different servlet context, which Tomcat
> > will generate a new session for.
> >
> > Thanks again for your help,
> > Andy
> >
> > --- Martin van den Bemt <mv...@mvdb.com> wrote:
> > > A different hostname creates a new session which
> > > could be the problem here..
> > > (so http://www.example.com and http://example.com
> > > create a different session even it's the same
> > > server/context/etc..
> > >
> > > Mvgr,
> > > Martin
> > >
> > > > -----Original Message-----
> > > > From: Alex Fernandez [mailto:afm229@tid.es]
> > > > Sent: Tuesday, May 29, 2001 4:57 PM
> > > > To: tomcat-user@jakarta.apache.org
> > > > Subject: Re: response.sendRedirect vs.
> > > requestDispatcher.forward
> > > >
> > > >
> > > > Conceptually, requestDispatcher.forward() is
> > > different from
> > > > response.sendRedirect().
> > > >
> > > > In forward(), you are moving inside the same
> > > webapp, and as such it
> > > > doesn't even reach the client browser. The session
> > > is maintained.
> > > >
> > > > In sendRedirect(), you're instead moving across
> > > webapps, and it's the
> > > > browser that redirects to the specified location.
> > > In fact, it doesn't
> > > > even need to be another servlet, you may redirect
> > > to an ASP or a static
> > > > page. New request and response are created.
> > > >
> > > > It seems strange that the session is not
> > > maintained, though, since both
> > > > requests come from the same browser. Perhaps it's
> > > a bug?
> > > >
> > > > Un saludo,
> > > >
> > > > Alex.
> > > >
> > > > A Yang wrote:
> > > > >
> > > > > Hi All,
> > > > >
> > > > > Does anyone know offhand whether the Java
> > > Servlet
> > > > > specification requires a new HttpSession to be
> > > created
> > > > > when using HttpServletResponse.sendRedirect()?
> > > > >
> > > > > In a servlet, I was using:
> > > > >
> > > > >
> > > >
> > >
> > getServletConfig().getServletContext().getRequestDispatcher("/Resu
> > > > lt.jsp").forward(req,
> > > > > resp);
> > > > >
> > > > > at the end of a sequence of pages/servlets, but
> > > I
> > > > > wanted to replace it with
> > > > >
> > > > > response.sendRedirect("/Result.jsp");
> > > > >
> > > > > instead. The result page prints out the contents
> > > of
> > > > > several javabeans which are stored in the
> > > session.
> > > > >
> > > > > This worked fine when all I used were
> > > > > requestDispatcher.forward but with
> > > > > response.sendRedirect(), all of my session
> > > attributes
> > > > > are gone! In fact, the session id is different
> > > after
> > > > > the sendRedirect.
> > > > >
> > > > > I'm pretty sure the session is supposed to
> > > survive
> > > > > across any series of GET's and POST's until it
> > > is
> > > > > invalidated explicitly (or timed out).
> > > > >
> > > > > Any thoughts? I'm using Tomcat 3.2.1
> > > > >
> > > > > Thanks.
> > > > >
> > > > >
> > >
> > _______________________________________________________
> > > > > Do You Yahoo!?
> > > > > Get your free @yahoo.ca address at
> > > http://mail.yahoo.ca
> > > >
> > >
> >
> >
> > _______________________________________________________
> > Do You Yahoo!?
> > Get your free @yahoo.ca address at http://mail.yahoo.ca
> >
> >
>
>
>
RE: response.sendRedirect vs. requestDispatcher.forward
Posted by Brandon Cruz <bc...@norvax.com>.
So what is the correct way to redirect? I have started using relative links
to redirect and it seems to fix the problem. Is this just coincidence, or
is there an explanation for that?
Brandon
-----Original Message-----
From: Martin van den Bemt [mailto:mvdb@mvdb.com]
Sent: Wednesday, May 30, 2001 6:38 PM
To: tomcat-user@jakarta.apache.org
Subject: RE: response.sendRedirect vs. requestDispatcher.forward
If you webserver is serving in /usr/local/apache/htdocs, you are redirecting
to /usr/local/apache/htdocs/login.jsp, which is handled in this example by
apache, who doesn't know anything about jsp files. (that's why you got
tomcat in the first place...)
Mvgr,
Martin
> -----Original Message-----
> From: Brandon Cruz [mailto:bcruz@norvax.com]
> Sent: Thursday, May 31, 2001 1:31 AM
> To: tomcat-user@jakarta.apache.org
> Subject: RE: response.sendRedirect vs. requestDispatcher.forward
>
>
> Has anyone figured out why response.sendRedirect("/login.jsp")
> will not work
> when using apache-tomcat with mod_jk? It gets all screwed up and prints a
> bunch of header information out to the page...is there a way around it
> besides using javascript to redirect the page?
>
> Brandon Cruz
>
> -----Original Message-----
> From: A Yang [mailto:ayang_ml@yahoo.ca]
> Sent: Wednesday, May 30, 2001 1:13 PM
> To: tomcat-user@jakarta.apache.org
> Subject: RE: response.sendRedirect vs. requestDispatcher.forward
>
>
> Hi,
>
> Thanks for the help. As it turns out, switching
> between requestDispath.forward and response.redirect
> will trip you up because of differences in what they
> expect as their parameters.
>
> RequestDispatch.forward takes a URL that is a RELATIVE
> path but also requires a leading slash.
>
> If you are brilliant (like myself) and you change your
> code to use response.encodeRedirectURL but you KEEP
> that leading slash, well then. Your response will
> treat it like an absolute path and wind up plunking
> you into a different servlet context, which Tomcat
> will generate a new session for.
>
> Thanks again for your help,
> Andy
>
> --- Martin van den Bemt <mv...@mvdb.com> wrote:
> > A different hostname creates a new session which
> > could be the problem here..
> > (so http://www.example.com and http://example.com
> > create a different session even it's the same
> > server/context/etc..
> >
> > Mvgr,
> > Martin
> >
> > > -----Original Message-----
> > > From: Alex Fernandez [mailto:afm229@tid.es]
> > > Sent: Tuesday, May 29, 2001 4:57 PM
> > > To: tomcat-user@jakarta.apache.org
> > > Subject: Re: response.sendRedirect vs.
> > requestDispatcher.forward
> > >
> > >
> > > Conceptually, requestDispatcher.forward() is
> > different from
> > > response.sendRedirect().
> > >
> > > In forward(), you are moving inside the same
> > webapp, and as such it
> > > doesn't even reach the client browser. The session
> > is maintained.
> > >
> > > In sendRedirect(), you're instead moving across
> > webapps, and it's the
> > > browser that redirects to the specified location.
> > In fact, it doesn't
> > > even need to be another servlet, you may redirect
> > to an ASP or a static
> > > page. New request and response are created.
> > >
> > > It seems strange that the session is not
> > maintained, though, since both
> > > requests come from the same browser. Perhaps it's
> > a bug?
> > >
> > > Un saludo,
> > >
> > > Alex.
> > >
> > > A Yang wrote:
> > > >
> > > > Hi All,
> > > >
> > > > Does anyone know offhand whether the Java
> > Servlet
> > > > specification requires a new HttpSession to be
> > created
> > > > when using HttpServletResponse.sendRedirect()?
> > > >
> > > > In a servlet, I was using:
> > > >
> > > >
> > >
> >
> getServletConfig().getServletContext().getRequestDispatcher("/Resu
> > > lt.jsp").forward(req,
> > > > resp);
> > > >
> > > > at the end of a sequence of pages/servlets, but
> > I
> > > > wanted to replace it with
> > > >
> > > > response.sendRedirect("/Result.jsp");
> > > >
> > > > instead. The result page prints out the contents
> > of
> > > > several javabeans which are stored in the
> > session.
> > > >
> > > > This worked fine when all I used were
> > > > requestDispatcher.forward but with
> > > > response.sendRedirect(), all of my session
> > attributes
> > > > are gone! In fact, the session id is different
> > after
> > > > the sendRedirect.
> > > >
> > > > I'm pretty sure the session is supposed to
> > survive
> > > > across any series of GET's and POST's until it
> > is
> > > > invalidated explicitly (or timed out).
> > > >
> > > > Any thoughts? I'm using Tomcat 3.2.1
> > > >
> > > > Thanks.
> > > >
> > > >
> >
> _______________________________________________________
> > > > Do You Yahoo!?
> > > > Get your free @yahoo.ca address at
> > http://mail.yahoo.ca
> > >
> >
>
>
> _______________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.ca address at http://mail.yahoo.ca
>
>
RE: response.sendRedirect vs. requestDispatcher.forward
Posted by Martin van den Bemt <mv...@mvdb.com>.
If you webserver is serving in /usr/local/apache/htdocs, you are redirecting
to /usr/local/apache/htdocs/login.jsp, which is handled in this example by
apache, who doesn't know anything about jsp files. (that's why you got
tomcat in the first place...)
Mvgr,
Martin
> -----Original Message-----
> From: Brandon Cruz [mailto:bcruz@norvax.com]
> Sent: Thursday, May 31, 2001 1:31 AM
> To: tomcat-user@jakarta.apache.org
> Subject: RE: response.sendRedirect vs. requestDispatcher.forward
>
>
> Has anyone figured out why response.sendRedirect("/login.jsp")
> will not work
> when using apache-tomcat with mod_jk? It gets all screwed up and prints a
> bunch of header information out to the page...is there a way around it
> besides using javascript to redirect the page?
>
> Brandon Cruz
>
> -----Original Message-----
> From: A Yang [mailto:ayang_ml@yahoo.ca]
> Sent: Wednesday, May 30, 2001 1:13 PM
> To: tomcat-user@jakarta.apache.org
> Subject: RE: response.sendRedirect vs. requestDispatcher.forward
>
>
> Hi,
>
> Thanks for the help. As it turns out, switching
> between requestDispath.forward and response.redirect
> will trip you up because of differences in what they
> expect as their parameters.
>
> RequestDispatch.forward takes a URL that is a RELATIVE
> path but also requires a leading slash.
>
> If you are brilliant (like myself) and you change your
> code to use response.encodeRedirectURL but you KEEP
> that leading slash, well then. Your response will
> treat it like an absolute path and wind up plunking
> you into a different servlet context, which Tomcat
> will generate a new session for.
>
> Thanks again for your help,
> Andy
>
> --- Martin van den Bemt <mv...@mvdb.com> wrote:
> > A different hostname creates a new session which
> > could be the problem here..
> > (so http://www.example.com and http://example.com
> > create a different session even it's the same
> > server/context/etc..
> >
> > Mvgr,
> > Martin
> >
> > > -----Original Message-----
> > > From: Alex Fernandez [mailto:afm229@tid.es]
> > > Sent: Tuesday, May 29, 2001 4:57 PM
> > > To: tomcat-user@jakarta.apache.org
> > > Subject: Re: response.sendRedirect vs.
> > requestDispatcher.forward
> > >
> > >
> > > Conceptually, requestDispatcher.forward() is
> > different from
> > > response.sendRedirect().
> > >
> > > In forward(), you are moving inside the same
> > webapp, and as such it
> > > doesn't even reach the client browser. The session
> > is maintained.
> > >
> > > In sendRedirect(), you're instead moving across
> > webapps, and it's the
> > > browser that redirects to the specified location.
> > In fact, it doesn't
> > > even need to be another servlet, you may redirect
> > to an ASP or a static
> > > page. New request and response are created.
> > >
> > > It seems strange that the session is not
> > maintained, though, since both
> > > requests come from the same browser. Perhaps it's
> > a bug?
> > >
> > > Un saludo,
> > >
> > > Alex.
> > >
> > > A Yang wrote:
> > > >
> > > > Hi All,
> > > >
> > > > Does anyone know offhand whether the Java
> > Servlet
> > > > specification requires a new HttpSession to be
> > created
> > > > when using HttpServletResponse.sendRedirect()?
> > > >
> > > > In a servlet, I was using:
> > > >
> > > >
> > >
> >
> getServletConfig().getServletContext().getRequestDispatcher("/Resu
> > > lt.jsp").forward(req,
> > > > resp);
> > > >
> > > > at the end of a sequence of pages/servlets, but
> > I
> > > > wanted to replace it with
> > > >
> > > > response.sendRedirect("/Result.jsp");
> > > >
> > > > instead. The result page prints out the contents
> > of
> > > > several javabeans which are stored in the
> > session.
> > > >
> > > > This worked fine when all I used were
> > > > requestDispatcher.forward but with
> > > > response.sendRedirect(), all of my session
> > attributes
> > > > are gone! In fact, the session id is different
> > after
> > > > the sendRedirect.
> > > >
> > > > I'm pretty sure the session is supposed to
> > survive
> > > > across any series of GET's and POST's until it
> > is
> > > > invalidated explicitly (or timed out).
> > > >
> > > > Any thoughts? I'm using Tomcat 3.2.1
> > > >
> > > > Thanks.
> > > >
> > > >
> >
> _______________________________________________________
> > > > Do You Yahoo!?
> > > > Get your free @yahoo.ca address at
> > http://mail.yahoo.ca
> > >
> >
>
>
> _______________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.ca address at http://mail.yahoo.ca
>
>
RE: response.sendRedirect vs. requestDispatcher.forward
Posted by Brandon Cruz <bc...@norvax.com>.
Has anyone figured out why response.sendRedirect("/login.jsp") will not work
when using apache-tomcat with mod_jk? It gets all screwed up and prints a
bunch of header information out to the page...is there a way around it
besides using javascript to redirect the page?
Brandon Cruz
-----Original Message-----
From: A Yang [mailto:ayang_ml@yahoo.ca]
Sent: Wednesday, May 30, 2001 1:13 PM
To: tomcat-user@jakarta.apache.org
Subject: RE: response.sendRedirect vs. requestDispatcher.forward
Hi,
Thanks for the help. As it turns out, switching
between requestDispath.forward and response.redirect
will trip you up because of differences in what they
expect as their parameters.
RequestDispatch.forward takes a URL that is a RELATIVE
path but also requires a leading slash.
If you are brilliant (like myself) and you change your
code to use response.encodeRedirectURL but you KEEP
that leading slash, well then. Your response will
treat it like an absolute path and wind up plunking
you into a different servlet context, which Tomcat
will generate a new session for.
Thanks again for your help,
Andy
--- Martin van den Bemt <mv...@mvdb.com> wrote:
> A different hostname creates a new session which
> could be the problem here..
> (so http://www.example.com and http://example.com
> create a different session even it's the same
> server/context/etc..
>
> Mvgr,
> Martin
>
> > -----Original Message-----
> > From: Alex Fernandez [mailto:afm229@tid.es]
> > Sent: Tuesday, May 29, 2001 4:57 PM
> > To: tomcat-user@jakarta.apache.org
> > Subject: Re: response.sendRedirect vs.
> requestDispatcher.forward
> >
> >
> > Conceptually, requestDispatcher.forward() is
> different from
> > response.sendRedirect().
> >
> > In forward(), you are moving inside the same
> webapp, and as such it
> > doesn't even reach the client browser. The session
> is maintained.
> >
> > In sendRedirect(), you're instead moving across
> webapps, and it's the
> > browser that redirects to the specified location.
> In fact, it doesn't
> > even need to be another servlet, you may redirect
> to an ASP or a static
> > page. New request and response are created.
> >
> > It seems strange that the session is not
> maintained, though, since both
> > requests come from the same browser. Perhaps it's
> a bug?
> >
> > Un saludo,
> >
> > Alex.
> >
> > A Yang wrote:
> > >
> > > Hi All,
> > >
> > > Does anyone know offhand whether the Java
> Servlet
> > > specification requires a new HttpSession to be
> created
> > > when using HttpServletResponse.sendRedirect()?
> > >
> > > In a servlet, I was using:
> > >
> > >
> >
>
getServletConfig().getServletContext().getRequestDispatcher("/Resu
> > lt.jsp").forward(req,
> > > resp);
> > >
> > > at the end of a sequence of pages/servlets, but
> I
> > > wanted to replace it with
> > >
> > > response.sendRedirect("/Result.jsp");
> > >
> > > instead. The result page prints out the contents
> of
> > > several javabeans which are stored in the
> session.
> > >
> > > This worked fine when all I used were
> > > requestDispatcher.forward but with
> > > response.sendRedirect(), all of my session
> attributes
> > > are gone! In fact, the session id is different
> after
> > > the sendRedirect.
> > >
> > > I'm pretty sure the session is supposed to
> survive
> > > across any series of GET's and POST's until it
> is
> > > invalidated explicitly (or timed out).
> > >
> > > Any thoughts? I'm using Tomcat 3.2.1
> > >
> > > Thanks.
> > >
> > >
>
_______________________________________________________
> > > Do You Yahoo!?
> > > Get your free @yahoo.ca address at
> http://mail.yahoo.ca
> >
>
_______________________________________________________
Do You Yahoo!?
Get your free @yahoo.ca address at http://mail.yahoo.ca
RE: response.sendRedirect vs. requestDispatcher.forward
Posted by A Yang <ay...@yahoo.ca>.
Hi,
Thanks for the help. As it turns out, switching
between requestDispath.forward and response.redirect
will trip you up because of differences in what they
expect as their parameters.
RequestDispatch.forward takes a URL that is a RELATIVE
path but also requires a leading slash.
If you are brilliant (like myself) and you change your
code to use response.encodeRedirectURL but you KEEP
that leading slash, well then. Your response will
treat it like an absolute path and wind up plunking
you into a different servlet context, which Tomcat
will generate a new session for.
Thanks again for your help,
Andy
--- Martin van den Bemt <mv...@mvdb.com> wrote:
> A different hostname creates a new session which
> could be the problem here..
> (so http://www.example.com and http://example.com
> create a different session even it's the same
> server/context/etc..
>
> Mvgr,
> Martin
>
> > -----Original Message-----
> > From: Alex Fernandez [mailto:afm229@tid.es]
> > Sent: Tuesday, May 29, 2001 4:57 PM
> > To: tomcat-user@jakarta.apache.org
> > Subject: Re: response.sendRedirect vs.
> requestDispatcher.forward
> >
> >
> > Conceptually, requestDispatcher.forward() is
> different from
> > response.sendRedirect().
> >
> > In forward(), you are moving inside the same
> webapp, and as such it
> > doesn't even reach the client browser. The session
> is maintained.
> >
> > In sendRedirect(), you're instead moving across
> webapps, and it's the
> > browser that redirects to the specified location.
> In fact, it doesn't
> > even need to be another servlet, you may redirect
> to an ASP or a static
> > page. New request and response are created.
> >
> > It seems strange that the session is not
> maintained, though, since both
> > requests come from the same browser. Perhaps it's
> a bug?
> >
> > Un saludo,
> >
> > Alex.
> >
> > A Yang wrote:
> > >
> > > Hi All,
> > >
> > > Does anyone know offhand whether the Java
> Servlet
> > > specification requires a new HttpSession to be
> created
> > > when using HttpServletResponse.sendRedirect()?
> > >
> > > In a servlet, I was using:
> > >
> > >
> >
>
getServletConfig().getServletContext().getRequestDispatcher("/Resu
> > lt.jsp").forward(req,
> > > resp);
> > >
> > > at the end of a sequence of pages/servlets, but
> I
> > > wanted to replace it with
> > >
> > > response.sendRedirect("/Result.jsp");
> > >
> > > instead. The result page prints out the contents
> of
> > > several javabeans which are stored in the
> session.
> > >
> > > This worked fine when all I used were
> > > requestDispatcher.forward but with
> > > response.sendRedirect(), all of my session
> attributes
> > > are gone! In fact, the session id is different
> after
> > > the sendRedirect.
> > >
> > > I'm pretty sure the session is supposed to
> survive
> > > across any series of GET's and POST's until it
> is
> > > invalidated explicitly (or timed out).
> > >
> > > Any thoughts? I'm using Tomcat 3.2.1
> > >
> > > Thanks.
> > >
> > >
>
_______________________________________________________
> > > Do You Yahoo!?
> > > Get your free @yahoo.ca address at
> http://mail.yahoo.ca
> >
>
_______________________________________________________
Do You Yahoo!?
Get your free @yahoo.ca address at http://mail.yahoo.ca
RE: response.sendRedirect vs. requestDispatcher.forward
Posted by Martin van den Bemt <mv...@mvdb.com>.
A different hostname creates a new session which could be the problem here..
(so http://www.example.com and http://example.com create a different session
even it's the same server/context/etc..
Mvgr,
Martin
> -----Original Message-----
> From: Alex Fernandez [mailto:afm229@tid.es]
> Sent: Tuesday, May 29, 2001 4:57 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Re: response.sendRedirect vs. requestDispatcher.forward
>
>
> Conceptually, requestDispatcher.forward() is different from
> response.sendRedirect().
>
> In forward(), you are moving inside the same webapp, and as such it
> doesn't even reach the client browser. The session is maintained.
>
> In sendRedirect(), you're instead moving across webapps, and it's the
> browser that redirects to the specified location. In fact, it doesn't
> even need to be another servlet, you may redirect to an ASP or a static
> page. New request and response are created.
>
> It seems strange that the session is not maintained, though, since both
> requests come from the same browser. Perhaps it's a bug?
>
> Un saludo,
>
> Alex.
>
> A Yang wrote:
> >
> > Hi All,
> >
> > Does anyone know offhand whether the Java Servlet
> > specification requires a new HttpSession to be created
> > when using HttpServletResponse.sendRedirect()?
> >
> > In a servlet, I was using:
> >
> >
> getServletConfig().getServletContext().getRequestDispatcher("/Resu
> lt.jsp").forward(req,
> > resp);
> >
> > at the end of a sequence of pages/servlets, but I
> > wanted to replace it with
> >
> > response.sendRedirect("/Result.jsp");
> >
> > instead. The result page prints out the contents of
> > several javabeans which are stored in the session.
> >
> > This worked fine when all I used were
> > requestDispatcher.forward but with
> > response.sendRedirect(), all of my session attributes
> > are gone! In fact, the session id is different after
> > the sendRedirect.
> >
> > I'm pretty sure the session is supposed to survive
> > across any series of GET's and POST's until it is
> > invalidated explicitly (or timed out).
> >
> > Any thoughts? I'm using Tomcat 3.2.1
> >
> > Thanks.
> >
> > _______________________________________________________
> > Do You Yahoo!?
> > Get your free @yahoo.ca address at http://mail.yahoo.ca
>
Re: response.sendRedirect vs. requestDispatcher.forward
Posted by Alex Fernández <af...@tid.es>.
Conceptually, requestDispatcher.forward() is different from
response.sendRedirect().
In forward(), you are moving inside the same webapp, and as such it
doesn't even reach the client browser. The session is maintained.
In sendRedirect(), you're instead moving across webapps, and it's the
browser that redirects to the specified location. In fact, it doesn't
even need to be another servlet, you may redirect to an ASP or a static
page. New request and response are created.
It seems strange that the session is not maintained, though, since both
requests come from the same browser. Perhaps it's a bug?
Un saludo,
Alex.
A Yang wrote:
>
> Hi All,
>
> Does anyone know offhand whether the Java Servlet
> specification requires a new HttpSession to be created
> when using HttpServletResponse.sendRedirect()?
>
> In a servlet, I was using:
>
> getServletConfig().getServletContext().getRequestDispatcher("/Result.jsp").forward(req,
> resp);
>
> at the end of a sequence of pages/servlets, but I
> wanted to replace it with
>
> response.sendRedirect("/Result.jsp");
>
> instead. The result page prints out the contents of
> several javabeans which are stored in the session.
>
> This worked fine when all I used were
> requestDispatcher.forward but with
> response.sendRedirect(), all of my session attributes
> are gone! In fact, the session id is different after
> the sendRedirect.
>
> I'm pretty sure the session is supposed to survive
> across any series of GET's and POST's until it is
> invalidated explicitly (or timed out).
>
> Any thoughts? I'm using Tomcat 3.2.1
>
> Thanks.
>
> _______________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.ca address at http://mail.yahoo.ca
Retrieving the current directory path...
Posted by Rui Oliveira <ol...@milu.ipn.pt>.
Hello,
is there a way to find out the operating system path where a JSP is being
executed?
Many thanks
Rui