Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3949708
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:31:32+00:00 2026-05-20T01:31:32+00:00

I have written a custom interceptor that does some parameter validation. I want to

  • 0

I have written a custom interceptor that does some parameter validation. I want to be able to return an error code and serialize a JAXB-annotated class as the response body.

If I throw a WebApplicationException, it doesn’t have any special processing done to serialize the Response object inside (which makes sense; I assume that is done by another interceptor).

How should I go about stopping the interceptor chain but still have JAXB serialize the response entity?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T01:31:32+00:00Added an answer on May 20, 2026 at 1:31 am

    Well, at least in the CXF JAX-RS interceptor flow, if you set:

    message.getExchange().put(Response.class, response);
    

    …then the actual service does not get invoked, while the other phases do get invoked. Haven’t dug in to the CXF code to see where that logic kicks in.

    So I built a response like this:

    Response response = Response
        .status(Response.Status.FORBIDDEN)
        .entity(new ErrorEntity("This is a JAXB object with an error string"))
        .build();
    

    I also have some custom authentication running in a CXF JAX-RS filter and I only want to check the parameters when the authentication is alright, so I set my parameter interceptor class to run during the PRE_INVOKE phase.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written an IIS module (base IHttpModule) that does some custom (OpenAuth) authentication
I have written some custom R code that wraps a third-party binary. One of
I have written a custom credit card validation attribute that checks CardNumber property is
I have written a custom control that renders some graphics. The graphics itself is
For an integration test setup, we have written some custom scripts and code to
I have written a custom Windows Service that writes data to a custom Event
I have written a custom server control which (pseudo-code) looks like public class MyCustomCtrl
I have written a custom MSBuild task, call it TaskA, that parses a file
I have written a custom dialog (form) that I can use in a C#
I have written a custom SessionStoreProvider class that inherits from the SessionStateStoreProviderBase. I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.