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 6629743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:18:14+00:00 2026-05-25T22:18:14+00:00

The server, a stand-alone SE application running Spring 2.5.6 and an embedded jetty. Clients,

  • 0

The server, a stand-alone SE application running Spring 2.5.6 and an embedded jetty.
Clients, Swing application, connects to the server using HttpInvoker.

There are a lot of services exposed by the server and now, new requirements have emerged saying I need to log (almost) every invocation made by the client.

What I would like to to do is for the client to send some extra information, (username, workstationId etc. Strings and ints).
A typical method on the server would look like this

public void doStuff(int someParam) {
   // Do stuff
   List result = method(someParam)

   // Audit
   // get the client information from somewhere?!!
   String username;
   int workstationId;

   auditDao.doStuffPerformed(username, workstationId, someParam, result);

}

So, how do I get the client information from within a method on the server.

One solution that I’ve tried is to add client information as request attributes and call method RequestContextHolder.getRequestAttributes(); from within method.

I have added a CommonsHttpInvokerRequestExecutor on the client side and overloaded the following method in order to add the additional information.

@Override
protected PostMethod createPostMethod(HttpInvokerClientConfiguration config) throws IOException {
  PostMethod postMethod = super.createPostMethod(config);
  postMethod.addRequestHeader("someHeader", "someHeader2");
  postMethod.addParameter("someParam", "someParam2");
  postMethod.setRequestHeader("someRequestHeader", "someRequestHeader2");
  return postMethod;
}

This will however not work. The headers or parameters are not accessible on the server.

Any response would be greatly appreciated.

  • 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-25T22:18:14+00:00Added an answer on May 25, 2026 at 10:18 pm

    I think you’re on the right track. You should just use a custom SimpleHttpInvokerServiceExporter subclass on the server-side, and override readRemoteInvocation to extract the headers set by the client from the HttpExchange argument.

    These header values could be stored in a static ThreadLocal session variable, which would be accessible anywhere in the server-side code.

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

Sidebar

Related Questions

I have a stand-alone, Swing application that uses Hibernate for its persistence layer. I
I have access to a server using SSH. I need to run a stand-alone
I have one stand alone client server application. I want to move it to
I'm trying to create a SOAP Server application that is a stand alone application
I want to create an application that runs on the users computer, a stand-alone
I have a client-server application, where there two options for the server - standalone
I am developing a SOAP web service using Spring 3.0, Spring-WS, SpringSource toolsuite running
I created a web application through the NetBeans IDE running a glassfish server and
How to make from your Custom HTTP Module a stand aloun TCP\HTTP server capable
I'm looking for a stand-alone Pie Chart which I can use in a GWT

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.