Re: 301 Redirect Question

2004-11-17 Thread Tim Funk
You need to code them yourself in your servlet/jsp.
response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
response.addHeader("Location", "/more/cowbell.jsp");
-Tim
Lyndon Smith wrote:
Hi Allistair
I have a question for the Tomcat User Group.
I hope you don't mind me asking you because the answer should be a simple
yes or no but I can't get an answer anywhere.
I am new to the mailing list and I don't know how to submit a question to
it.
The Question:
Is it possible with Tomcat 4.1.30 running within Apache Web Server to use
301 redirects?
(If so how?)
Regards
Lyndon
- Original Message - 
From: "Allistair Crossley" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Wednesday, November 17, 2004 11:08 AM
Subject: [OFF TOPIC] RE: enormous loggin when starting tomcat


Your root logger might be set at debug level, or you have set debug
logging on struts. Have you got a log4j config going?
-Original Message-
From: koen boutsen [mailto:[EMAIL PROTECTED]
Sent: 17 November 2004 11:03
To: [EMAIL PROTECTED]
Subject: enormous loggin when starting tomcat
Hello
I'm using Tomcat 5.0.28 and I'm trying to deploy a struts application.
This application is rather large and so is my struts-config.xml file.
When tomcat starts or I restart the application, I have to
wait more than a minute (sometimes 4') before all the log
messages are done.
Does anyone have an idea what's the cause of this and how I
can resolve it ?
Thanks in advance
Koen
--
___
Find what you are looking for with the Lycos Yellow Pages
http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.c
om/default.asp?SRC=lycos10
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---
QAS Ltd.
Developers of QuickAddress Software
http://www.qas.com";>www.qas.com
Registered in England: No 2582055
Registered in Australia: No 082 851 474
---

-
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]

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


301 Redirect Question

2004-11-17 Thread Lyndon Smith
Hi Allistair

I have a question for the Tomcat User Group.

I hope you don't mind me asking you because the answer should be a simple
yes or no but I can't get an answer anywhere.

I am new to the mailing list and I don't know how to submit a question to
it.

The Question:

Is it possible with Tomcat 4.1.30 running within Apache Web Server to use
301 redirects?

(If so how?)

Regards

Lyndon


- Original Message - 
From: "Allistair Crossley" <[EMAIL PROTECTED]>
To: "Tomcat Users List" <[EMAIL PROTECTED]>
Sent: Wednesday, November 17, 2004 11:08 AM
Subject: [OFF TOPIC] RE: enormous loggin when starting tomcat


> Your root logger might be set at debug level, or you have set debug
logging on struts. Have you got a log4j config going?
>
> > -Original Message-
> > From: koen boutsen [mailto:[EMAIL PROTECTED]
> > Sent: 17 November 2004 11:03
> > To: [EMAIL PROTECTED]
> > Subject: enormous loggin when starting tomcat
> >
> >
> > Hello
> >
> > I'm using Tomcat 5.0.28 and I'm trying to deploy a struts application.
> > This application is rather large and so is my struts-config.xml file.
> > When tomcat starts or I restart the application, I have to
> > wait more than a minute (sometimes 4') before all the log
> > messages are done.
> >
> > Does anyone have an idea what's the cause of this and how I
> > can resolve it ?
> >
> > Thanks in advance
> >
> > Koen
> > -- 
> > ___
> > Find what you are looking for with the Lycos Yellow Pages
> > http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.c
> > om/default.asp?SRC=lycos10
> >
> >
> > -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> 
> ---
> QAS Ltd.
> Developers of QuickAddress Software
> http://www.qas.com";>www.qas.com
> Registered in England: No 2582055
> Registered in Australia: No 082 851 474
> ---
> 
>
>
> -
> 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: Server.xml / App Context / Redirect question

2003-02-05 Thread Sean Dockery


  
  




Copy everything in your projectX web application to 
C:\myWebSite\webapps\projectX.  That is...

C:\...\projectX\WEB-INF
...etc...
C:\...\projectX\index.jsp
...etc...

At 10:35 2003-02-05 -0500, you wrote:
Hi,
I am having trouble configuring Tomcat (server.xml) to use my application, 
which is (and always will be) the only Java app. running on my server. I 
am using the "built in" web server, as I have very little traffic and 
virtually no static content, so coupling it with Apache is not necessary.

How do I configure Server.xml to go directly to a directory of my choosing 
by just typing in the name of server on the host? (I have successfully 
changed the port to 80 from 8080, so that is not an issue. I also changed 
host files on my Intranet so every box knows the name of my server)

For example, if I have a server named Titan (this is on an Intranet, not 
the Internet) with an application in a directory called projectX, I wish 
to simply launch a browser and type in http://Titan and be directed 
directly to my web-app's (projectX) front door. I had this working, but 
somehow I changed something and I am now being directed to the default 
Tomcat home page. I am having to type http://Titan/projectX into the 
address bar to get to my app.

I did add the default context as such: 

What am I doing wrong?

Also, I should NEVER append /projectX/ to a file name when using a 
response.sendRedirect(), correct? (Ex: 
response.sendRedirect("/projectX/main.jsp"))
This would result in very non-portable code, right? But I DO need the 
slash before the file name, right? (Ex: response.sendRedirect("/main.jsp"))

Any info appreciated.

JW





_
Help STOP SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail


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

Sean Dockery
[EMAIL PROTECTED]
Certified Java Web Component Developer
Certified Delphi Programmer
SBD Consultants
http://www.sbdconsultants.com



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




Server.xml / App Context / Redirect question

2003-02-05 Thread Noncubicle Corp
Hi,
I am having trouble configuring Tomcat (server.xml) to use my application, 
which is (and always will be) the only Java app. running on my server. I am 
using the "built in" web server, as I have very little traffic and virtually 
no static content, so coupling it with Apache is not necessary.

How do I configure Server.xml to go directly to a directory of my choosing 
by just typing in the name of server on the host? (I have successfully 
changed the port to 80 from 8080, so that is not an issue. I also changed 
host files on my Intranet so every box knows the name of my server)

For example, if I have a server named Titan (this is on an Intranet, not the 
Internet) with an application in a directory called projectX, I wish to 
simply launch a browser and type in http://Titan and be directed directly to 
my web-app's (projectX) front door. I had this working, but somehow I 
changed something and I am now being directed to the default Tomcat home 
page. I am having to type http://Titan/projectX into the address bar to get 
to my app.

I did add the default context as such: 

What am I doing wrong?

Also, I should NEVER append /projectX/ to a file name when using a 
response.sendRedirect(), correct? (Ex: 
response.sendRedirect("/projectX/main.jsp"))
This would result in very non-portable code, right? But I DO need the slash 
before the file name, right? (Ex: response.sendRedirect("/main.jsp"))

Any info appreciated.

JW





_
Help STOP SPAM with the new MSN 8 and get 2 months FREE*   
http://join.msn.com/?page=features/junkmail


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



SSL, JK redirect question

2002-10-24 Thread Martin Jacobson
I have tc4.1.12, Apache 2.0.43 mod_ssl and mod_jk set up and working 
successfully on my Mac (OS X 10.1.5), but tweaking the Apache config to 
get it to work was... involved, let's say :-)

Users enter the site (using http: protocol) at /drs/home. This contains 
a button labelled "Login" that takes them to /drs/private/home. Because 
/drs/private/* is under a security contraint, it triggers a redirect to 
/drs/login which POSTs to j_security_check, etc.

Previously, using tomcat-standalone, the 
CONFIDENTIAL triggered the 
switch to https: - however, this no longer works when Apache/mod_jk are 
in the loop.

Because /drs/private/* isn't accessible via http: I was getting an 
Apache-generated 404 error when the login button on the home page was 
clicked: the solution I found was to place a
Redirect /drs/private/home https:///drs/private/home
in httpd.conf

Of course, this gives an extra redirect, and seems inelegant...does 
anyone have a better solution? [And no, I don't think mod_rewrite is a 
better solution!]

Martin.

PS I don't want to hard-code the full URL in the button on-click 
handler, as I don't want to have Yet Another Thing To Change when I move 
to the production server.


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 



RE: Redirect question

2001-01-22 Thread Michael Wentzel

I don't know how the flow of your webapp is working in this
situation but if you put the following in the referrer to 
the first jsp or possibly on your first jsp and ACTION="redirect.jsp"
depending on you work flow:





...


The values will be in the request if you handle navigation
by submitting the form.

The only reason this would be programmatically better than the
previous solution is if it can not be assumed that the user
has cookies enabled or if cookies are not even an option per
project specs.


---
Michael Wentzel
Software Developer
http://www.aswethink.com">Software As We Think
mailto:[EMAIL PROTECTED]">Michael Wentzel

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




RE: Redirect question

2001-01-22 Thread David Oxley

Ok. I knew that I could do it with a cookie. Thanks anyway. But is there
anyway of putting onto the request and doing an HTTP POST much like a form
submit?

Dave.
[EMAIL PROTECTED]

-Original Message-
From: Andy Nuss [mailto:[EMAIL PROTECTED]]
Sent: 21 January 2001 22:43
To: '[EMAIL PROTECTED]'
Subject: RE: Redirect question



1)original jsp

HttpSession session = req.getSession(false);
MyParams params = new MyParams("a", "b", "c");
String retrieveid = "QUICK_RETRIEVE" + "/myredirect.jsp" + new
Object().hashCode();
session.setAttribute(retrieveid, params);
Cookie ck = new Cookie("QUICK_RETRIEVE", retrieveid);
ck.setPath("/myredirect.jsp");
resp.addCookie(ck);
resp.sendRedirect("/myredirect.jsp");

2)  redirected jsp

HttpSession session = req.getSession(false);
Cookie[] cks = req.getCookies();
Cookie ck = findCookieByNamePath(cks, "QUICK_RETRIEVE",
"/myredirect.jsp");
MyParams params = (MyParams)session.getAttribute(ck.getValue());


-Original Message-
From: David Oxley [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 21, 2001 6:02 AM
To: [EMAIL PROTECTED]
Subject: Redirect question


When sending a HttpServletResponse resp.sendRedirect how can I specify
parameters without having them appear on the URL in the browser address bar?

Thanks.
Dave.
[EMAIL PROTECTED]

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



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

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




RE: Redirect question

2001-01-21 Thread Andy Nuss


1)original jsp

HttpSession session = req.getSession(false);
MyParams params = new MyParams("a", "b", "c");
String retrieveid = "QUICK_RETRIEVE" + "/myredirect.jsp" + new
Object().hashCode();
session.setAttribute(retrieveid, params);
Cookie ck = new Cookie("QUICK_RETRIEVE", retrieveid);
ck.setPath("/myredirect.jsp");
resp.addCookie(ck);
resp.sendRedirect("/myredirect.jsp");

2)  redirected jsp

HttpSession session = req.getSession(false);
Cookie[] cks = req.getCookies();
Cookie ck = findCookieByNamePath(cks, "QUICK_RETRIEVE",
"/myredirect.jsp");
MyParams params = (MyParams)session.getAttribute(ck.getValue());


-Original Message-
From: David Oxley [mailto:[EMAIL PROTECTED]]
Sent: Sunday, January 21, 2001 6:02 AM
To: [EMAIL PROTECTED]
Subject: Redirect question


When sending a HttpServletResponse resp.sendRedirect how can I specify
parameters without having them appear on the URL in the browser address bar?

Thanks.
Dave.
[EMAIL PROTECTED]

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



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




Redirect question

2001-01-21 Thread David Oxley

When sending a HttpServletResponse resp.sendRedirect how can I specify
parameters without having them appear on the URL in the browser address bar?

Thanks.
Dave.
[EMAIL PROTECTED]

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




Re: send redirect question

2000-11-30 Thread Moursli Nabil

no!
- Original Message -
From: Anand Prasad <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 30, 2000 4:04 AM
Subject: RE: send redirect question


> Craig,
>
> Is there way using RequestDispatcher or  sendReDirect()   to send a page
to
> particular frame.
>
> For example.  sendRedirect("index.html" target=_top);
>
> -_Anand
>
>
> -Original Message-
> From: Rick Bosch [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, November 29, 2000 3:32 PM
> To: [EMAIL PROTECTED]
> Subject: Re: send redirect question
>
>
> if I have a bean that is called from a jsp and has the call
>
> if (!(cookie.tempContains("loggedin"))){
> try{
> String
>
param=(request.getParameter("show")!=null)?"?show="+request.getParameter("sh
> ow"):"";
> response.sendRedirect("index.jsp"+param);
> commit=true;
> }catch(IOException e){
> log.write("Problem launching"+e.getMessage());
> }
> }else{
>
> and in my jsp
>
> 
> <%
> mybean.init( request,  response);
> if(mybean.commit){return;}
> %>
> 
> 
>
> However we have found that some versions of ie if they mess with the back
> button and up with messed up pages (described below).
>
> 1) how can i fix it?
>
> 2) Then would you say it is not safe to redirect from a bean that you have
> pass a refrence to http response?
>
>
>
> thanks
> -rick
>
> > From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
> > Reply-To: [EMAIL PROTECTED]
> > Date: Tue, 28 Nov 2000 12:45:46 -0800
> > To: [EMAIL PROTECTED]
> > Subject: Re: send redirect question
> >
> > Rick Bosch wrote:
> >
> >> we have several jsp pages that call beans.  Some beans for one reason
or
> >> another will redirect a user to another page, howver in some cases its
> >> possible for a redirect to occur and if the logic of the bean is to
> continue
> >> writing after a reddirect the client get messed up pages usually the
> >> original then some http headers and then the new page.  How is it jsp
> pages
> >> are somehow "aware" of a redirect but if i call a redirect from a bean
it
> >> seems to be ignored???
> >>
> >
> > Deep down, a JSP page is just a Java class.  And the Java language has
no
> > concept like the setjmp()/longjmp() combination of C, where you can
change
> the
> > logical flow of control with what amounts to a "go to" statement to a
> > completely
> > different method in a completely different source file.
> >
> > When you call response.sendRedirect() -- or RequestDispatcher.forward(),
> which
> > has the same basic issue -- control will ultimately be returned to your
> page
> > when the method you just called returns.  It is up to you to add a
> "return"
> > statement afterwards, to stop creating the remainder of the current
page.
> >
> > The only time that this is done for you by the container is when you use
> > , or execute a JSP custom tag that tells the container to
> skip
> > the
> > remainder of the current page.
> >
> >>
> >> thanks
> >> -rick
> >
> > Craig McClanahan
> >




RE: send redirect question

2000-11-30 Thread Kief Morris

Anand Prasad typed the following on 19:04 29/11/2000 -0800
>Is there way using RequestDispatcher or  sendReDirect()   to send a page to
>particular frame.
>
>For example.  sendRedirect("index.html" target=_top);

Unfortunately it's the browser which decides which frame to load a page
into, you can't force it on the server side. So a servlet or JSP page can't
decide to load itself into a particular frame any more than a plain HTML
page can decide to load _itself_ into a particular frame.

So if your sendRedirect("index.html") is in myServlet, the HTML which contains
the link tag that loads the original URL has to specify the frame to load 
it in:

click

Whatever output myServlet generates, even if it's a redirect, will show up in
the top frame.

A technique to get better control over your framesets is to load a frameset
which is a JSP page, and give it some parameter which will tell it what to
load in each frame. All of your links will contain target="_top", and the 
entire
frameset is loaded:

sendRedirect("smart_frameset.jsp?main=index.html&nav=nav.html");

Your smart_frameset.jsp checks its parameters and writes its frameset tags
accordingly to load the correct URL in each frame. It's not terribly efficient,
since you're reloading the whole frameset whether you need to or not.

Kief


---
   bitBull makes the Internet bite: http://www.bitBull.com/demos/




RE: send redirect question

2000-11-30 Thread Anand Prasad

Craig,

Is there way using RequestDispatcher or  sendReDirect()   to send a page to
particular frame.

For example.  sendRedirect("index.html" target=_top); 

-_Anand


-Original Message-
From: Rick Bosch [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 29, 2000 3:32 PM
To: [EMAIL PROTECTED]
Subject: Re: send redirect question


if I have a bean that is called from a jsp and has the call

if (!(cookie.tempContains("loggedin"))){
try{
String
param=(request.getParameter("show")!=null)?"?show="+request.getParameter("sh
ow"):"";
response.sendRedirect("index.jsp"+param);
commit=true;
}catch(IOException e){
log.write("Problem launching"+e.getMessage());
}
}else{

and in my jsp 


<%
mybean.init( request,  response);
if(mybean.commit){return;}
%>

 

However we have found that some versions of ie if they mess with the back
button and up with messed up pages (described below).

1) how can i fix it?

2) Then would you say it is not safe to redirect from a bean that you have
pass a refrence to http response?



thanks
-rick

> From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Tue, 28 Nov 2000 12:45:46 -0800
> To: [EMAIL PROTECTED]
> Subject: Re: send redirect question
> 
> Rick Bosch wrote:
> 
>> we have several jsp pages that call beans.  Some beans for one reason or
>> another will redirect a user to another page, howver in some cases its
>> possible for a redirect to occur and if the logic of the bean is to
continue
>> writing after a reddirect the client get messed up pages usually the
>> original then some http headers and then the new page.  How is it jsp
pages
>> are somehow "aware" of a redirect but if i call a redirect from a bean it
>> seems to be ignored???
>> 
> 
> Deep down, a JSP page is just a Java class.  And the Java language has no
> concept like the setjmp()/longjmp() combination of C, where you can change
the
> logical flow of control with what amounts to a "go to" statement to a
> completely
> different method in a completely different source file.
> 
> When you call response.sendRedirect() -- or RequestDispatcher.forward(),
which
> has the same basic issue -- control will ultimately be returned to your
page
> when the method you just called returns.  It is up to you to add a
"return"
> statement afterwards, to stop creating the remainder of the current page.
> 
> The only time that this is done for you by the container is when you use
> , or execute a JSP custom tag that tells the container to
skip
> the
> remainder of the current page.
> 
>> 
>> thanks
>> -rick
> 
> Craig McClanahan
> 



Re: send redirect question

2000-11-29 Thread Rick Bosch

if I have a bean that is called from a jsp and has the call

if (!(cookie.tempContains("loggedin"))){
try{
String
param=(request.getParameter("show")!=null)?"?show="+request.getParameter("sh
ow"):"";
response.sendRedirect("index.jsp"+param);
commit=true;
}catch(IOException e){
log.write("Problem launching"+e.getMessage());
}
}else{

and in my jsp 


<%
mybean.init( request,  response);
if(mybean.commit){return;}
%>

 

However we have found that some versions of ie if they mess with the back
button and up with messed up pages (described below).

1) how can i fix it?

2) Then would you say it is not safe to redirect from a bean that you have
pass a refrence to http response?



thanks
-rick

> From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Tue, 28 Nov 2000 12:45:46 -0800
> To: [EMAIL PROTECTED]
> Subject: Re: send redirect question
> 
> Rick Bosch wrote:
> 
>> we have several jsp pages that call beans.  Some beans for one reason or
>> another will redirect a user to another page, howver in some cases its
>> possible for a redirect to occur and if the logic of the bean is to continue
>> writing after a reddirect the client get messed up pages usually the
>> original then some http headers and then the new page.  How is it jsp pages
>> are somehow "aware" of a redirect but if i call a redirect from a bean it
>> seems to be ignored???
>> 
> 
> Deep down, a JSP page is just a Java class.  And the Java language has no
> concept like the setjmp()/longjmp() combination of C, where you can change the
> logical flow of control with what amounts to a "go to" statement to a
> completely
> different method in a completely different source file.
> 
> When you call response.sendRedirect() -- or RequestDispatcher.forward(), which
> has the same basic issue -- control will ultimately be returned to your page
> when the method you just called returns.  It is up to you to add a "return"
> statement afterwards, to stop creating the remainder of the current page.
> 
> The only time that this is done for you by the container is when you use
> , or execute a JSP custom tag that tells the container to skip
> the
> remainder of the current page.
> 
>> 
>> thanks
>> -rick
> 
> Craig McClanahan
> 



Re: send redirect question

2000-11-28 Thread Craig R. McClanahan

Rick Bosch wrote:

> we have several jsp pages that call beans.  Some beans for one reason or
> another will redirect a user to another page, howver in some cases its
> possible for a redirect to occur and if the logic of the bean is to continue
> writing after a reddirect the client get messed up pages usually the
> original then some http headers and then the new page.  How is it jsp pages
> are somehow "aware" of a redirect but if i call a redirect from a bean it
> seems to be ignored???
>

Deep down, a JSP page is just a Java class.  And the Java language has no
concept like the setjmp()/longjmp() combination of C, where you can change the
logical flow of control with what amounts to a "go to" statement to a completely
different method in a completely different source file.

When you call response.sendRedirect() -- or RequestDispatcher.forward(), which
has the same basic issue -- control will ultimately be returned to your page
when the method you just called returns.  It is up to you to add a "return"
statement afterwards, to stop creating the remainder of the current page.

The only time that this is done for you by the container is when you use
, or execute a JSP custom tag that tells the container to skip the
remainder of the current page.

>
> thanks
> -rick

Craig McClanahan





send redirect question

2000-11-28 Thread Rick Bosch

we have several jsp pages that call beans.  Some beans for one reason or
another will redirect a user to another page, howver in some cases its
possible for a redirect to occur and if the logic of the bean is to continue
writing after a reddirect the client get messed up pages usually the
original then some http headers and then the new page.  How is it jsp pages
are somehow "aware" of a redirect but if i call a redirect from a bean it
seems to be ignored???

thanks
-rick