Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!

Dirk Schumacher

+ Follow
since Sep 06, 2006
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Dirk Schumacher

Sagar Shroff wrote:Thanks for your reply , your answer makes sense.But i dint understood one statement of yours

Dirk Schumacher wrote:You would have to do that manually. Most likely you would end up doing that by using stateless EJB services.

How would your maintain session manually using stateless EJB ?


I just gave it a thought how I would do it in case I would have to implement it with the precondition of not using SFSB.

Goal is to persist the conversation state w/ a client in the backend which it loosely connected to the web request (Http, simple GenericServlet for e.g. XML stream handling, some XML JEE handling mechanism.)

This would be my general Session handling SLSB interface, which:

The pattern to follow is that calling doWhateverInTheSession implies that that register was called. Though the doWhateverInTheSession could register the session itself by checking the active session. It's up to your fantasy or use case.
If I remeber right, depending on the JEE version, it is not even possible to directly use a SLSB in a Servlet. In other words the container will not inject the SLSB into the Servlet. You would have to do that manually by using a remote SLSB.
This case you could also manually inject remotely a SFSB bean. More on the key of the problem at the bottom...

On an Http-Service (Servlet, JSF, Struts-Action,... which are all somehow in some way inherit from a Servlet) I would use the HttpSession Id to identify a client by using a SLSB with the following service methods:
Of course there needs to be done some more code in the servlet handling like creating / recognizing the http servlet session.

On a simple (generic) servlet receiving an XML for example the key is to recognize the client in order to map the client to a session.
Two ways to do that, but the latter I never implemented...

1. the XML must contain the login information to know about the user, for example:

Map the /root/@user/text() to register or get the Session. Each request must have the user set being used as the session id.
Actually there you have your session created anyways by the user and you must not use a session service. Most likely there is the need to track the conversation anyways by inspecting the xml.

2. Use Authentification which works with http:

I do not know straight away how to access the current user within a servlet there. But this is moving the information of /root/@user/text() to a more basic level at the http request call stack.

From here it is getting fuzzy since your use case is not known. Also it is not known what and where your information of your client (which maps to a session and could make it a stateful conversation) is located.
Inspect what information about your client is available where at each of your requests to the server. If you do not have identifying information of the client then you probably must provide it.
The goal is to map that identifying client information of the request on the server to a stateful conversion wherever this is located. The IP address is most not of use since it cannot safely determine a unique request caller.
For example an HttpServlet (which is a framework based on GenericServlet based which is framework based on is somehow using Cookies, URL-rewriting, ... to archive that goal.

The nature of TCP/IP is stateless for each request. Any program having converstion over TCP must deal w/ that stateless nature.

Setup a playground project testing it out with focus on the issue and surpressing any further business logic...

I hope it helps....

Well, I am not too much into that stuff but here is my guess:

WebServices are request based. Basically the Service is requested, the response is rendered and then the conversation is forgotten.
With HTTP one could use HttpSessions in order to keep the knowledge that a request comes from the same client.
The following steps belong to a lifecycle of a Session:
- Starting it
- Doing conversation
- Ending it.

Same with Stateless EJB services, isn't it?

Since a non HTTP WebService is stateless by nature, how could the container (handling the Sessions and Transactions) know how client requests belong to the same client or conversation?
You would have to do that manually. Most likely you would end up doing that by using stateless EJB services.

Answer in short: There is no bridge for the gap of the stateless nature of WebServices to the stateful nature of stateful EJBs.

I hope it helps. My answer is just the conclusion of all the knowledge I have regarding WebServices, Http and EJB.

thank you all for sharing your experiences. I am also planning to take the test and started with the exam topics showed on the oracle pages.
What is the issue with this auction application:

-Introducing the Auction Application
--Describe the auction application
--Define the domain objects of the auction application
--Describe the implementation model for the auction system

Where can I find more information about that?
Do I have to do extra oracle education stuff (and pay for it)?
Is it relevant for the exam anyway?

I would glad to know...
Best greets

I did not find an answer to this by searching through the ranch.
I want to debug JSPs using the remote debug facility.
I am running Eclipse 3.2.2 with Web Standard Tools - Web Core Version: 1.5.3
and externaly a Tomcat 5.0.

If I am debugging a JSP it works fine, but when the JSPs' file endings are not equal *.jsp eclipse will not step into it at all. I use *.jspd files and renaming them will actually work. Since it would be a mess to rename all dependencies I don't want to do so.
I also set the preference that *.jspd files are associated with a JSP-Editor (the same settings as for *.jsp files)

Does anyone have a clou?
Thanks in advance,
Hello out there,

I've been using eclipse quite a while.
There's one huge mystery around it for me.
When traveling with my fingers over the keyboard using lots of shortcuts it often happens that the language settings just magically change to english.
I know I am not always hitting the right shortcuts what makes me think that I change the language settings by accident. But I never figured by exactly which combination of keys I change it.
I use the german settings on windows. I figured it might be an OS problem but when restarting eclipse it all works out fine again. I figure that it has to deal with eclipse.
No one of the ecplise users know how to change this setting though they know the problem.
Is there any help out there for me?
If you are using Strings as Keys and Values it is easily to use
a properties file:


It already provides methods to store and read a Hashtable<String,String> via Streams.

If you are storing any Objects you might want to make them and learn how to use serialization.

I hope it helped.
11 years ago

my dad wants to list the MSDOS short file names:
i.e. afilename.txt = afilenam~.txt

I know that the does not implement a method for returning such a short name.
Is there any MSDOS-FILE-API able to do that. Is there any algoriothm to compute the short filename from the long one?

I'm thankful for any suggestions.
11 years ago
Having the same problem. I willinvestigate in the InvokerServlet and my web.xml. I am running tomcat 5.5 with eclipse(wtp). I could imagine there's the problem since eclipse uses its own "virtual" web-app directory for tomcat.
Let me know if anyone figured out why it loads twice....
11 years ago