RE: Request dispatcher fails on encoded url when used in post (Bug?)

2003-08-27 Thread Filip Hanik
that is a funky url, it has a space in it, and the last / should be
encoded

Filip

 -Original Message-
 From: Neil Aggarwal [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, August 26, 2003 5:45 PM
 To: 'Tomcat-User'
 Cc: Jeff Patterson
 Subject: Request dispatcher fails on encoded url when used in post
 (Bug?)


 Hello:

 I am getting a failure in my code when using a request dispatcher
 to forward the request to an encoded url from a post operation.

 To see it in action, do the following:
 1. Turn off cookies on your browser
 2. Visit http://dev.jammconsulting.com/gen?_template=/index.jsp
 3. Hit the Test button.

 You will get this error:

 HTTP Status 404 - /gen;jsessionid=BF99242CF6F9E32C44D50EACE5576AD5
 
 
 type Status report
 message /gen;jsessionid=BF99242CF6F9E32C44D50EACE5576AD5
 description The requested resource
 (/gen;jsessionid=BF99242CF6F9E32C44D50EACE5576AD5) is not available.
 
 
 Apache Tomcat/4.1.27

 Now, turn on cookies and try it again.  You will get a page that states:
 This is compose.jsp
 Session id is BFBC13C89DD4B3F5A98EF8E53F0D6A45

 I thought that Tomcat is supposed to act the same with cookies on or off

 when I use encodeURL on all of my urls.


 Here is the code behind this sample:

 In httpd.conf, ask apache to map all urls that begin with /gen into
 tomcat:
   LocationMatch /gen
 JkUriSet worker ajp13:localhost:8009
   /LocationMatch

 In tomcat server.xml, I told tomcat that the root context uses
 my app:
 Context path= docBase=email debug=0/

 In my app's web.xml, told it to map all request for /gen to
 my test servlet:
 ?xml version=1.0 encoding=ISO-8859-1?

 !DOCTYPE web-app
 PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
 http://java.sun.com/dtd/web-app_2_3.dtd;

 web-app

 servlet
 servlet-namesls/servlet-name
 servlet-class
 servlet.TestServlet
 /servlet-class
 /servlet

 servlet-mapping
 servlet-namesls/servlet-name
 url-pattern/gen/*/url-pattern
 /servlet-mapping

 session-config
 session-timeout50/session-timeout
 /session-config

 /web-app

 Here is my test servlet, which forwards all requests to the appropriate
 template:
 package servlet;

 import java.io.*;
 import java.net.*;

 import javax.servlet.*;
 import javax.servlet.http.*;

 public class TestServlet extends HttpServlet {
   private void process(HttpServletRequest request, HttpServletResponse
 response)
   throws ServletException, IOException {

 getServletContext().getRequestDispatcher(request.getParameter(_template
 )).forward(request, response);
   }

   protected void doGet(HttpServletRequest request, HttpServletResponse
 response)
   throws ServletException, IOException {
 process(request,response);
   }

   protected void doPost(HttpServletRequest request, HttpServletResponse
 response)
   throws ServletException, IOException {
 process(request,response);
   }
 }

 Here is the index.jsp template, which posts to the massCompose template:
 P
 Session id is %= session.getId() %
 P

 form name=groupList method=post action=%=
 response.encodeUrl(/gen) %
   input type=hidden name=_template value=/massCompose.jsp
   input type=submit value=test
 /form

 Here is the massCompose template which forwards to the compose template:
 %
   RequestDispatcher rdispatch =
 request.getRequestDispatcher(response.encodeURL(/gen?_template=/compose
 .jsptype=normal));
   rdispatch.forward(request, response);
 %

 Here is the compose template which just displays a message:
 HTML

   BODY
 This is compose.jsp
 P
 Session id is %= session.getId() %
 P
   /BODY

 /HTML

 Any ideas why this is occurring?

 Thanks,
   Neil

 --
 Neil Aggarwal, JAMM Consulting, (972)612-6056, www.JAMMConsulting.com
 FREE! Valuable info on how your business can reduce operating costs by
 17% or more in 6 months or less! = http://newsletter.JAMMConsulting.com


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Request dispatcher fails on encoded url when used in post (Bug?)

2003-08-27 Thread Neil Aggarwal
Filip:

There is no space in the url, it is an underscore.

As far as the last slash, why would it work correctly with cookies
on and not with cookies off?  

It should work the same with and without cookies. If it did not work 
in both cases, that would make sense to me.

Thanks, 
Neil

--
Neil Aggarwal, JAMM Consulting, (972)612-6056, www.JAMMConsulting.com
FREE! Valuable info on how your business can reduce operating costs by 
17% or more in 6 months or less! = http://newsletter.JAMMConsulting.com

 -Original Message-
 From: Filip Hanik [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, August 26, 2003 8:12 PM
 To: Tomcat Users List
 Subject: RE: Request dispatcher fails on encoded url when 
 used in post (Bug?)
 
 
 that is a funky url, it has a space in it, and the last / should be
 encoded
 
 Filip
 
  -Original Message-
  From: Neil Aggarwal [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, August 26, 2003 5:45 PM
  To: 'Tomcat-User'
  Cc: Jeff Patterson
  Subject: Request dispatcher fails on encoded url when used in post
  (Bug?)
 
 
  Hello:
 
  I am getting a failure in my code when using a request dispatcher
  to forward the request to an encoded url from a post operation.
 
  To see it in action, do the following:
  1. Turn off cookies on your browser
  2. Visit http://dev.jammconsulting.com/gen?_template=/index.jsp
  3. Hit the Test button.
 
  You will get this error:
 
  HTTP Status 404 - /gen;jsessionid=BF99242CF6F9E32C44D50EACE5576AD5
  
 --
 --
  
  type Status report
  message /gen;jsessionid=BF99242CF6F9E32C44D50EACE5576AD5
  description The requested resource
  (/gen;jsessionid=BF99242CF6F9E32C44D50EACE5576AD5) is not available.
  
 --
 --
  
  Apache Tomcat/4.1.27
 
  Now, turn on cookies and try it again.  You will get a page 
 that states:
  This is compose.jsp
  Session id is BFBC13C89DD4B3F5A98EF8E53F0D6A45
 
  I thought that Tomcat is supposed to act the same with 
 cookies on or off
 
  when I use encodeURL on all of my urls.
 
 
  Here is the code behind this sample:
 
  In httpd.conf, ask apache to map all urls that begin with /gen into
  tomcat:
LocationMatch /gen
  JkUriSet worker ajp13:localhost:8009
/LocationMatch
 
  In tomcat server.xml, I told tomcat that the root context uses
  my app:
  Context path= docBase=email debug=0/
 
  In my app's web.xml, told it to map all request for /gen to
  my test servlet:
  ?xml version=1.0 encoding=ISO-8859-1?
 
  !DOCTYPE web-app
  PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
  http://java.sun.com/dtd/web-app_2_3.dtd;
 
  web-app
 
  servlet
  servlet-namesls/servlet-name
  servlet-class
  servlet.TestServlet
  /servlet-class
  /servlet
 
  servlet-mapping
  servlet-namesls/servlet-name
  url-pattern/gen/*/url-pattern
  /servlet-mapping
 
  session-config
  session-timeout50/session-timeout
  /session-config
 
  /web-app
 
  Here is my test servlet, which forwards all requests to the 
 appropriate
  template:
  package servlet;
 
  import java.io.*;
  import java.net.*;
 
  import javax.servlet.*;
  import javax.servlet.http.*;
 
  public class TestServlet extends HttpServlet {
private void process(HttpServletRequest request, 
 HttpServletResponse
  response)
throws ServletException, IOException {
 
  
 getServletContext().getRequestDispatcher(request.getParameter(
 _template
  )).forward(request, response);
}
 
protected void doGet(HttpServletRequest request, 
 HttpServletResponse
  response)
throws ServletException, IOException {
  process(request,response);
}
 
protected void doPost(HttpServletRequest request, 
 HttpServletResponse
  response)
throws ServletException, IOException {
  process(request,response);
}
  }
 
  Here is the index.jsp template, which posts to the 
 massCompose template:
  P
  Session id is %= session.getId() %
  P
 
  form name=groupList method=post action=%=
  response.encodeUrl(/gen) %
input type=hidden name=_template value=/massCompose.jsp
input type=submit value=test
  /form
 
  Here is the massCompose template which forwards to the 
 compose template:
  %
RequestDispatcher rdispatch =
  
 request.getRequestDispatcher(response.encodeURL(/gen?_templat
 e=/compose
  .jsptype=normal));
rdispatch.forward(request, response);
  %
 
  Here is the compose template which just displays a message:
  HTML
 
BODY
  This is compose.jsp
  P
  Session id is %= session.getId() %
  P
/BODY
 
  /HTML
 
  Any ideas why this is occurring?
 
  Thanks,
  Neil
 
  --
  Neil Aggarwal, JAMM Consulting, (972)612-6056, 
www.JAMMConsulting.com
 FREE! Valuable info on how your business can reduce operating costs by
 17% or more in 6 months or less! =
http

Re: Request dispatcher fails on encoded url when used in post (Bug?)

2003-08-27 Thread Bill Barker
See http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22734.  You can also
search bugzilla, since this one has come up several times (this is just the
latest incarnation :).

Neil Aggarwal [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hello:

 I am getting a failure in my code when using a request dispatcher
 to forward the request to an encoded url from a post operation.

 To see it in action, do the following:
 1. Turn off cookies on your browser
 2. Visit http://dev.jammconsulting.com/gen?_template=/index.jsp
 3. Hit the Test button.

 You will get this error:

 HTTP Status 404 - /gen;jsessionid=BF99242CF6F9E32C44D50EACE5576AD5
 
 
 type Status report
 message /gen;jsessionid=BF99242CF6F9E32C44D50EACE5576AD5
 description The requested resource
 (/gen;jsessionid=BF99242CF6F9E32C44D50EACE5576AD5) is not available.
 
 
 Apache Tomcat/4.1.27

 Now, turn on cookies and try it again.  You will get a page that states:
 This is compose.jsp
 Session id is BFBC13C89DD4B3F5A98EF8E53F0D6A45

 I thought that Tomcat is supposed to act the same with cookies on or off

 when I use encodeURL on all of my urls.


 Here is the code behind this sample:

 In httpd.conf, ask apache to map all urls that begin with /gen into
 tomcat:
   LocationMatch /gen
 JkUriSet worker ajp13:localhost:8009
   /LocationMatch

 In tomcat server.xml, I told tomcat that the root context uses
 my app:
 Context path= docBase=email debug=0/

 In my app's web.xml, told it to map all request for /gen to
 my test servlet:
 ?xml version=1.0 encoding=ISO-8859-1?

 !DOCTYPE web-app
 PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
 http://java.sun.com/dtd/web-app_2_3.dtd;

 web-app

 servlet
 servlet-namesls/servlet-name
 servlet-class
 servlet.TestServlet
 /servlet-class
 /servlet

 servlet-mapping
 servlet-namesls/servlet-name
 url-pattern/gen/*/url-pattern
 /servlet-mapping

 session-config
 session-timeout50/session-timeout
 /session-config

 /web-app

 Here is my test servlet, which forwards all requests to the appropriate
 template:
 package servlet;

 import java.io.*;
 import java.net.*;

 import javax.servlet.*;
 import javax.servlet.http.*;

 public class TestServlet extends HttpServlet {
   private void process(HttpServletRequest request, HttpServletResponse
 response)
   throws ServletException, IOException {

 getServletContext().getRequestDispatcher(request.getParameter(_template
 )).forward(request, response);
   }

   protected void doGet(HttpServletRequest request, HttpServletResponse
 response)
   throws ServletException, IOException {
 process(request,response);
   }

   protected void doPost(HttpServletRequest request, HttpServletResponse
 response)
   throws ServletException, IOException {
 process(request,response);
   }
 }

 Here is the index.jsp template, which posts to the massCompose template:
 P
 Session id is %= session.getId() %
 P

 form name=groupList method=post action=%=
 response.encodeUrl(/gen) %
   input type=hidden name=_template value=/massCompose.jsp
   input type=submit value=test
 /form

 Here is the massCompose template which forwards to the compose template:
 %
   RequestDispatcher rdispatch =
 request.getRequestDispatcher(response.encodeURL(/gen?_template=/compose
 .jsptype=normal));
   rdispatch.forward(request, response);
 %

 Here is the compose template which just displays a message:
 HTML

   BODY
 This is compose.jsp
 P
 Session id is %= session.getId() %
 P
   /BODY

 /HTML

 Any ideas why this is occurring?

 Thanks,
 Neil

 --
 Neil Aggarwal, JAMM Consulting, (972)612-6056, www.JAMMConsulting.com
 FREE! Valuable info on how your business can reduce operating costs by
 17% or more in 6 months or less! = http://newsletter.JAMMConsulting.com




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Request Dispatcher

2002-08-01 Thread Mike Jackson

I don't think so, at least I've never been able to do it.  What I've done is
added
attributes to the request (see the javadocs for details).  Attributes only
work
with objects, but that's both an advantage and a disadvantage.

--mikej
-=-
mike jackson
[EMAIL PROTECTED]

 -Original Message-
 From: Jacob Hookom [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 01, 2002 3:06 PM
 To: Tomcat Users List
 Subject: Request Dispatcher


 If I grab a request dispatcher, can I append extra parameters to be used
 at the destination?

 Original request: /app/RDServlet?id=3446

 RequestDispatcher rd =
 _context.getRequestDispatcher(/jsp/handler.jsp?ar=html);
 rd.forward();

 Is this legit to do?

 Jacob Hookom
 Comprehensive Computer Science
 University of Wisconsin, Eau Claire



 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.380 / Virus Database: 213 - Release Date: 7/24/2002



 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]





--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Request Dispatcher

2002-08-01 Thread Jacob Hookom

I wrote some test cases and figured out that you cannot append
parameters, but you can change their properties, so if you do:

/xmlwrapper/newsTest.html?contentType=44id=59550

I can regexp and forward

/content/news.jsp?contentType=htmlid=59550

Jacob Hookom 
Comprehensive Computer Science 
University of Wisconsin, Eau Claire 


-Original Message-
From: Mike Jackson [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, August 01, 2002 5:08 PM
To: Tomcat Users List
Subject: RE: Request Dispatcher

I don't think so, at least I've never been able to do it.  What I've
done is
added
attributes to the request (see the javadocs for details).  Attributes
only
work
with objects, but that's both an advantage and a disadvantage.

--mikej
-=-
mike jackson
[EMAIL PROTECTED]

 -Original Message-
 From: Jacob Hookom [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 01, 2002 3:06 PM
 To: Tomcat Users List
 Subject: Request Dispatcher


 If I grab a request dispatcher, can I append extra parameters to be
used
 at the destination?

 Original request: /app/RDServlet?id=3446

 RequestDispatcher rd =
 _context.getRequestDispatcher(/jsp/handler.jsp?ar=html);
 rd.forward();

 Is this legit to do?

 Jacob Hookom
 Comprehensive Computer Science
 University of Wisconsin, Eau Claire



 ---
 Outgoing mail is certified Virus Free.
 Checked by AVG anti-virus system (http://www.grisoft.com).
 Version: 6.0.380 / Virus Database: 213 - Release Date: 7/24/2002



 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]





--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.380 / Virus Database: 213 - Release Date: 7/24/2002
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.380 / Virus Database: 213 - Release Date: 7/24/2002
 


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Request dispatcher

2002-05-16 Thread Mike Jackson

Request dispatchers aren't the same a redirects (what I think you're looking
for).  As I understand things a request dispatcher is done on the server,
ie the page accessed accesses another page and the page you access still
looks
like the one you originally hit.  A redirect will send them to another page
and the url still change.  Fortunately it's easy to do redirects, there's a
sendRedirect method on the response object.

--mikej
-=-
mike jackson
[EMAIL PROTECTED]

 -Original Message-
 From: Dave Finch [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, May 16, 2002 12:58 PM
 To: 'Tomcat Users List'
 Subject: Request dispatcher


 Hi,

 I am trying to use the request dispatcher to send the user to
 another page.
 Everything is working fine but the URL on the new page is the originally
 requested url which causes issues if the user refreshes or bookmarks the
 page.
 Is there any way of changing the URL in the request object? (I
 don't want to
 use a client side sendRedirect)
 I am using Tomcat 4.0.1

 TIA,

 Dave Finch



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Request dispatcher

2002-05-16 Thread Dave Finch

I understand that. But I don't like the idea of sending the redirect
instruction to the client. Is it not correct that the user may sometimes see
'the resource has moved' or similar?
I would much rather keep everything serverside.

Dave Finch

-Original Message-
From: Mike Jackson [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, May 16, 2002 5:31 PM
To: Tomcat Users List
Subject: RE: Request dispatcher

Request dispatchers aren't the same a redirects (what I think you're looking
for).  As I understand things a request dispatcher is done on the server,
ie the page accessed accesses another page and the page you access still
looks
like the one you originally hit.  A redirect will send them to another page
and the url still change.  Fortunately it's easy to do redirects, there's a
sendRedirect method on the response object.

--mikej
-=-
mike jackson
[EMAIL PROTECTED]

 -Original Message-
 From: Dave Finch [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, May 16, 2002 12:58 PM
 To: 'Tomcat Users List'
 Subject: Request dispatcher


 Hi,

 I am trying to use the request dispatcher to send the user to
 another page.
 Everything is working fine but the URL on the new page is the originally
 requested url which causes issues if the user refreshes or bookmarks the
 page.
 Is there any way of changing the URL in the request object? (I
 don't want to
 use a client side sendRedirect)
 I am using Tomcat 4.0.1

 TIA,

 Dave Finch



--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Request dispatcher

2002-05-16 Thread Mike Jackson

I'm not an expert, but I think unless you involve the client I don't think
there's a way to change the URI.

And you're right, sometimes the sendRedirect doesn't work, some clients
ignore it (in my experience at least).

--mikej
-=-
mike jackson
[EMAIL PROTECTED]

 -Original Message-
 From: Dave Finch [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, May 16, 2002 4:02 PM
 To: 'Tomcat Users List'
 Subject: RE: Request dispatcher


 I understand that. But I don't like the idea of sending the redirect
 instruction to the client. Is it not correct that the user may
 sometimes see
 'the resource has moved' or similar?
 I would much rather keep everything serverside.

 Dave Finch

 -Original Message-
 From: Mike Jackson [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, May 16, 2002 5:31 PM
 To: Tomcat Users List
 Subject: RE: Request dispatcher

 Request dispatchers aren't the same a redirects (what I think
 you're looking
 for).  As I understand things a request dispatcher is done on the server,
 ie the page accessed accesses another page and the page you access still
 looks
 like the one you originally hit.  A redirect will send them to
 another page
 and the url still change.  Fortunately it's easy to do redirects,
 there's a
 sendRedirect method on the response object.

 --mikej
 -=-
 mike jackson
 [EMAIL PROTECTED]

  -Original Message-
  From: Dave Finch [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, May 16, 2002 12:58 PM
  To: 'Tomcat Users List'
  Subject: Request dispatcher
 
 
  Hi,
 
  I am trying to use the request dispatcher to send the user to
  another page.
  Everything is working fine but the URL on the new page is the originally
  requested url which causes issues if the user refreshes or bookmarks the
  page.
  Is there any way of changing the URL in the request object? (I
  don't want to
  use a client side sendRedirect)
  I am using Tomcat 4.0.1
 
  TIA,
 
  Dave Finch
 


 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]

 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Request dispatcher

2002-05-16 Thread Dave Finch

Thanks Mike,

I figured out how to modify the tomcat source to expose a method to allow me
to change the URL but I really don't wont to do that.

-Original Message-
From: Mike Jackson [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, May 16, 2002 7:28 PM
To: Tomcat Users List
Subject: RE: Request dispatcher

I'm not an expert, but I think unless you involve the client I don't think
there's a way to change the URI.

And you're right, sometimes the sendRedirect doesn't work, some clients
ignore it (in my experience at least).

--mikej
-=-
mike jackson
[EMAIL PROTECTED]

 -Original Message-
 From: Dave Finch [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, May 16, 2002 4:02 PM
 To: 'Tomcat Users List'
 Subject: RE: Request dispatcher


 I understand that. But I don't like the idea of sending the redirect
 instruction to the client. Is it not correct that the user may
 sometimes see
 'the resource has moved' or similar?
 I would much rather keep everything serverside.

 Dave Finch

 -Original Message-
 From: Mike Jackson [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, May 16, 2002 5:31 PM
 To: Tomcat Users List
 Subject: RE: Request dispatcher

 Request dispatchers aren't the same a redirects (what I think
 you're looking
 for).  As I understand things a request dispatcher is done on the server,
 ie the page accessed accesses another page and the page you access still
 looks
 like the one you originally hit.  A redirect will send them to
 another page
 and the url still change.  Fortunately it's easy to do redirects,
 there's a
 sendRedirect method on the response object.

 --mikej
 -=-
 mike jackson
 [EMAIL PROTECTED]

  -Original Message-
  From: Dave Finch [mailto:[EMAIL PROTECTED]]
  Sent: Thursday, May 16, 2002 12:58 PM
  To: 'Tomcat Users List'
  Subject: Request dispatcher
 
 
  Hi,
 
  I am trying to use the request dispatcher to send the user to
  another page.
  Everything is working fine but the URL on the new page is the originally
  requested url which causes issues if the user refreshes or bookmarks the
  page.
  Is there any way of changing the URL in the request object? (I
  don't want to
  use a client side sendRedirect)
  I am using Tomcat 4.0.1
 
  TIA,
 
  Dave Finch
 


 --
 To unsubscribe, e-mail:
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]

 --
 To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Request Dispatcher

2001-11-14 Thread Tom Drake

JSP provides an easier way to do what you are attempting.
However, the 'hot' include mechanism, is very much like a
function call. the output from the included jsp/servlet simply
appears in the middle of your output stream. It does not replace
the entire page.

If you need a completely different response, you may need
to use the 'forward' mechanism instead. If you do, you must
forward to the other page prior to producing any output
at all.

Tom
- Original Message - 
From: Scott Walter [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, November 14, 2001 10:16 AM
Subject: Request Dispatcher


| I am trying to use a RequestDispatcher include with a
| JSP page, it seems to be including the content above
| the location where I have coded the include.  Any 
| clues???
| 
| Below is my code
| %
| RequestDispatcher rd =
| request.getRequestDispatcher(pageName);
|  
| rd.include(request,response);
| %
| 
| =
| ~~~
| Scott
| 
| __
| Do You Yahoo!?
| Find the one for you at Yahoo! Personals
| http://personals.yahoo.com
| 
| --
| To unsubscribe:   mailto:[EMAIL PROTECTED]
| For additional commands: mailto:[EMAIL PROTECTED]
| Troubles with the list: mailto:[EMAIL PROTECTED]
| 
| 
| 


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




RE: Request Dispatcher

2001-11-14 Thread Rajah Kalipatnapu

thats exactly correct, and if do not want to use forward, may be u can use a
conditional
statement

-Original Message-
From: Tom Drake [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 14, 2001 10:32 AM
To: Tomcat Users List
Subject: Re: Request Dispatcher


JSP provides an easier way to do what you are attempting.
However, the 'hot' include mechanism, is very much like a
function call. the output from the included jsp/servlet simply
appears in the middle of your output stream. It does not replace
the entire page.

If you need a completely different response, you may need
to use the 'forward' mechanism instead. If you do, you must
forward to the other page prior to producing any output
at all.

Tom
- Original Message -
From: Scott Walter [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, November 14, 2001 10:16 AM
Subject: Request Dispatcher


| I am trying to use a RequestDispatcher include with a
| JSP page, it seems to be including the content above
| the location where I have coded the include.  Any
| clues???
|
| Below is my code
| %
| RequestDispatcher rd =
| request.getRequestDispatcher(pageName);
|
| rd.include(request,response);
| %
|
| =
| ~~~
| Scott
|
| __
| Do You Yahoo!?
| Find the one for you at Yahoo! Personals
| http://personals.yahoo.com
|
| --
| To unsubscribe:   mailto:[EMAIL PROTECTED]
| For additional commands: mailto:[EMAIL PROTECTED]
| Troubles with the list: mailto:[EMAIL PROTECTED]
|
|
|


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]


--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]