You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Rick Bosch <rb...@actv.com> on 2000/11/28 19:50:18 UTC

send redirect question

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

linux and mod_jk

Posted by Landaluze Produktions IS - Carlos <li...@lpis.com>.
i am using linux suse.
i have dounload the tomcat 3.2 final
i have a fiel mod_jk.so
for running with linux i must compile this file(mod_jk.so)?
if i must compiled it:
i have my tomcat in /opt/jakarta
the mod. in /usr/lib/apache
how i compile it?
thanks
Carlos


Re: connection pool

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.

Landaluze Produktions IS - Carlos wrote:

> in the tomcat conf file (server.xmlk) i have see that there is a conection
> pool for oracle and mysql

This is not actually a connection pool.  It is configuring which JDBC driver
will be used by the JDBCRealm module to look up users for container-managed
security.  You can certainly use SQLServer for this as long as you have a JDBC
driver that supports it -- the details for how to configure the parameters for
this driver should be in the driver's documentation.

The basic entry in server.xml would look similar to the others -- you would
replace the class name with the class name of the driver you want to use, modify
the username and password parameters, and then set up the connection url however
the driver's documentation tells you to.

>
> 1.- is posible to make a conecion pool to a MSQL server?
> 2.- if a am using a JDBC driver (rmijdbc) and the SQLserver ip is
> 192.168.1.3, how can i make a conection pool to this database?
> i dont known how can i do it?
> please help me
> Thaks
> Carlos

Craig McClanahan



connection pool

Posted by Landaluze Produktions IS - Carlos <li...@lpis.com>.
in the tomcat conf file (server.xmlk) i have see that there is a conection
pool for oracle and mysql
1.- is posible to make a conecion pool to a MSQL server?
2.- if a am using a JDBC driver (rmijdbc) and the SQLserver ip is
192.168.1.3, how can i make a conection pool to this database?
i dont known how can i do it?
please help me
Thaks
Carlos


Re: send redirect question

Posted by Rick Bosch <rb...@actv.com>.
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 

<jsp:useBean id="mybean" class="actv.login.PickDir" />
<%
    mybean.init( request,  response);
    if(mybean.commit){return;}
%>
<html>
<head> 

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" <Cr...@eng.sun.com>
> Reply-To: tomcat-user@jakarta.apache.org
> Date: Tue, 28 Nov 2000 12:45:46 -0800
> To: tomcat-user@jakarta.apache.org
> 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
> <jsp:forward>, 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

Posted by "Craig R. McClanahan" <Cr...@eng.sun.com>.
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
<jsp:forward>, or execute a JSP custom tag that tells the container to skip the
remainder of the current page.

>
> thanks
> -rick

Craig McClanahan