Advertisement

06.08.2007 at 07:14AM PDT, ID: 22621771
[x]
Attachment Details

Resonse sendRedirect Method Problem in JSP

Asked by rnzimiro in Java Server Pages (JSP)

Tags: ,

Kello experts. I am having a proble with response.sendRedirect method in one of my pages in JSP
Here is the error message:
Jun 8, 2007 10:09:46 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet jsp threw exception
javax.servlet.ServletException: Exception in JSP: /macsweb/userGetMacsUser.jsp:17

14:                 strMessage = "No such user exists in the MACS system";
15:             }else{
16:                 String strURL = "userViewMacsUser.jsp?userID="+ macsUser.getUserID();
17:                 response.sendRedirect("http://www.msn.com");
18:                 return;
19:             }
20:         }


Stacktrace:
        at com.cbc.macs.web.Filter.MACWebAuthenticateFilter.doFilter(MACWebAuthenticateFilter.java:106)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:619)
Jun 8, 2007 10:09:46 AM org.apache.catalina.core.StandardHostValve custom
SEVERE: Exception Processing ErrorPage[exceptionType=javax.servlet.ServletException, location=/MACSWebErrorPage.jsp]
java.lang.IllegalStateException
        at org.apache.coyote.Response.reset(Response.java:296)
        at org.apache.catalina.connector.Response.reset(Response.java:645)
        at org.apache.catalina.connector.Response.reset(Response.java:909)
        at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:356)
        at org.apache.catalina.core.StandardHostValve.throwable(StandardHostValve.java:212)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:134)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
        at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
        at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:619)


Here is the code that should execute
<%
    String strUID = "";
    String strMessage = "";
    String strMethod = request.getMethod();
    if(strMethod.equalsIgnoreCase("POST")){
        strUID = macsUser.getUserID();
        if(!strUID.equalsIgnoreCase("")){
            String strUser = macsUser.GetUser();
            if(strUser.equalsIgnoreCase("")){
                strMessage = "No such user exists in the MACS system";
            }else{
                String strURL = "userViewMacsUser.jsp?userID="+ macsUser.getUserID();
                response.sendRedirect("http://www.msn.com");
                return;
            }
        }
    }
%>
I just started to have this problem but this piece of code has worked before. I am at a loss and have no idea where else to look

Thanks
Start Free Trial
 
Loading Advertisement...
 
[+][-]06.08.2007 at 06:26PM PDT, ID: 19246858

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Java Server Pages (JSP)
Tags: sendredirect, jsp
Sign Up Now!
Solution Provided By: objects
Participating Experts: 3
Solution Grade: B
 
 
[+][-]06.09.2007 at 03:33PM PDT, ID: 19250319

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.10.2007 at 08:49PM PDT, ID: 19255756

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.10.2007 at 09:16PM PDT, ID: 19255814

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.10.2007 at 09:20PM PDT, ID: 19255820

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.12.2007 at 02:35AM PDT, ID: 19264642

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.12.2007 at 07:12PM PDT, ID: 19271330

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.12.2007 at 10:40PM PDT, ID: 19272318

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32