Win a copy of Head First Android this week in the Android forum!

John Groller

+ Follow
since May 08, 2008
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 John Groller

I'm not sure I understand enough to even ask the question coherently, but here it goes...

Here at work, we are required to use Spring to "inject" our objects into our Stateless Session Beans. We have a base class in our internal framework that we are supposed to extend for all beans that are "configurable using Spring".

I'm familiar with the configuration xml file, and how you list out all the beans in it... but I'm having trouble connecting the dots.

A "Hello World!" type explanation for this would be perfect.

I'm having some trouble getting Castor to interpret boolean attributes when unmarshalling.

With my XSD I've got:
<xsd:attribute name="returnSessionData" type="xsd:boolean"/>

Castor generates all the classes successfully with the type of "boolean" for the get/set returnSessionData methods and fields. However, when I unmarshall the following XML...

<InitiateSession returnSessionData="true">

... the returnSessionData field in the Castor class never gets switched to "true". It seems to be always interpreted as "false". I have tried many combinations... "yes" and "no", "0" and "1", different combinations of upper case and lower case, to no avail.

Any idea what I might be doing wrong?
I'd also like to know the answer to this one...
Hello JavaRanch!

I've got a class in a WAR. It's not a servlet, it's just a straight up class. However, it will be invoked when a SOAP call comes in from our vendor.

To load a Bean that I need, I'm doing this...

My problem is that no relative path that I use works. Physical paths do work, but since I'm developing on a Windows box and will be deploying to AIX boxes, physical paths won't match up.

Is there a way for me to determine the context root of the WAR in a class that's not a Servlet (and therefore does not have an HttpServletRequest object)? I read somewhere that I could grab the SOAPContext and use that, but that just seemed like a lot of work to do something simple.

Thanks in advance for any help.
13 years ago
Hey there...

I'm actually the person who wrote the question. I signed up at work but gave JavaRanch my home email address. We're not allowed to check our home email at work, so I asked a co-worker if I could post my question under her name until I was able to login later.

Since my post I was able to figure out a solution. Talking to some other programmers at work who are more familiar with Spring, they recommended using "BeanFactory". Using that I was able to pull in the spring context xml file, and then loading up the bean.

Previously, I had been given an example where the bean is loaded based off an attribute sent in the servlet request object. And being rather new to the whole Java world, it's still a bit uncomfortable for me to stray from the examples I'm given.

Thanks for your reply, but I'm good to go now!