rails 3.0 异常处理

in your application.rb
ActionController::Base
  rescue_from ActionController::RoutingError, :with => :render_404

  private
  def render_404(exception = nil)
    if exception
        logger.info "Rendering 404: #{exception.message}"
    end

    render :file => "#{Rails.root}/public/404.html", :status => 404, :layout => false
  end

你可能感兴趣的:(java,html,Rails)