Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsOtherProgramming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old December 15th, 2005, 02:54 PM
jbruso jbruso is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 279 jbruso User rank is Lance Corporal (50 - 100 Reputation Level)jbruso User rank is Lance Corporal (50 - 100 Reputation Level)jbruso User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 2 Days 17 h 31 m 46 sec
Reputation Power: 5
Send a message via AIM to jbruso Send a message via MSN to jbruso Send a message via Yahoo to jbruso
Question Java Servlet Redirect exceptionHelper.Java

This should be pretty simple... but my experience with java is low. I have a servlet in a portal that displays an error when the portal can't load. Instead of displaying this error to the end-user, I'd like to instead, redirect the user to a different URL.

I've tried adding this to line 348, but the file won't compile...
Code:
response.sendRedirect(response.encodeRedirectURL('  http://dev.sheridan.edu/uportal/errors/') );


error msg:
Code:
C:\Uportal-VT\uPortal_rel-2-4-2>ant deploy
Buildfile: build.xml

prepare:

compile:
    [javac] Compiling 1 source file to C:\Uportal-VT\uPortal_rel-2-4-2\build\WEB
-INF\classes
    [javac] C:\Uportal-VT\uPortal_rel-2-4-2\source\org\jasig\portal\ExceptionHel
per.java:347: unclosed character literal
    [javac]                     response.sendRedirect(response.encodeRedirectURL
('http://dev.sheridan.edu/uportal/errors/') );
    [javac]
     ^
    [javac] C:\Uportal-VT\uPortal_rel-2-4-2\source\org\jasig\portal\ExceptionHel
per.java:348: ')' expected
    [javac]                     PrintWriter out = resp.getWriter();
    [javac]                                                           ^
    [javac] 2 errors

BUILD FAILED
C:\Uportal-VT\uPortal_rel-2-4-2\build.xml:460: Compile failed; see the compiler
error output for details.

Total time: 11 seconds


So, I'm kinda stuck.

Thank you for your help.

First few lines of Exception.java handler file... the forum won't let me post the whole thing:

Code:

package org.jasig.portal;

import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.servlet.http.HttpServletResponse;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class ExceptionHelper {

    private static final Log log = LogFactory.getLog(ExceptionHelper.class);
    
    // List of strings to match in traceback for various containers
	// This array must be expanded as additional Application Server
	// containers become better known
    public static final String boundaries[] =
        {
    		"at javax.servlet.http.HttpServlet."
    	};

}

Reply With Quote
Reply

Viewing: ASP Free ForumsOtherProgramming Help > Java Servlet Redirect exceptionHelper.Java


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT