Joel Carklin

Greenhorn
+ Follow
since Jun 15, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Joel Carklin

Hi, I'm new to web services and Axis, I don't quite understand the workings yet, and hope I can explain myself clearly.
I'm using a wsdd file to inform the Axis server which class to instantiate when it receives a method call. The class contains the method logic for dealing with the call. These methods need to connect to databases and in some cases need to 'forward' the method call to another web service. The database connection data (address, passwords etc) as well as the endpoint of the web service the call is forwarded to, are dynamic, and are contained in configuration files for another app within which axis is 'embedded'. Is there any way to pass this information to axis so when it instantiates the class it does so with the correct parameters. Can Axis call a construcor which accepts parameters? Alternatively, can I point axis to an already instantiated object of the defined class, so it doesn't need to instatiate it at all?

Thanks
Joel
20 years ago
Hi everyone,
I'm confused about sessions and contexts and ssl
for the following reason:
I have 3 web apps: sharedWebApp, customerWebApp and
administratorWebApp (for example).
The sharedWebApp is used by both customers and administrators, it contains no secured pages.
Both the customer and admin webapps require login and pages are served over ssl.
In my server.xml, I define 3 contexts,
the sharedApp is the 'default context' defined as follows:
<Context path="" docBase="/path/sharedApp/web"/>
and
<Context path="/customer" docBase="/path/customerApp/web"/>
<Context path="/administrator" docBase="/path/administratorApp/web"/>
Now, this is the confusing part:
When I start tomcat and go directly to
http://localhost:8080/customer I go to customerApp index.jsp, on ssl as expected. index is a login page,
I can log in, browse about and everything is cool.
When I start tomcat and go to http://localhost:8080 I go to the sharedApp index.jsp as expected. this index page has a link,
<a href="/customer"> which goes to the customerApp index page as expected (after checking certificates etc) I can login to the customerApp as normal, but when I try browse around I get 'thrown out'. This is because a session attribute I set upon successful login, is no longer there when I try to go to another page??? It's like there is another session started or something
Sorry for being long winded,. not sure how to explain exactly whats happening.
Anyway, thanks for any comments
Joel
Hope this is the right group to post to...
22 years ago
Hi All,
My situation is this:
I send an xml message to another server and then expect a reply xml message. I need to set a timeout so that if the I don't get a response mesaage after say 5 seconds then my method will return null, rather than continuing to wait for the response.
I looked at the java util Timer class, but it confused me in this particular scenario.
Any help / suggestions appreciated.
Thanks
Joel
22 years ago
From the SCWCD Faq
http://www.javaranch.com/scwcdfaq.jsp


While the objectives doesn't specify any Specification version, generally speaking Servlet Specification 2.3 covers most of the objectives pertaining to Servlets and JSP Specification 1.2 covers most of the objectives pertaining to JSP.

I have found them very useful for iteration, for dealing with date time entry/display...
I guess you could do all thses things without tag libraries but the web page would be a nightmare if you just wanted to work on the design...
Hi,
The Javabean API requires a class to have a no args constructor. This is so the system is able to instantiate the bean using the instantiate() method found in the java.beans.Beans package. I assume the jsp engine uses the same method to instantiate the bean though I'm not positive.
But Yes, it is mandatory to have no args constructor
scope, as I understand it, refers to an object which holds attrubutes. Each attribute has a unique identifying name linked to an object. A javabean would be such an attribute. There are 4 kinds of scope, indicating how much access there is to the bean. for example, a bean with page scope is only visible and accessable by the jsp page which contains it. a bean with request scope is visible to the page which contains it as well as any jsp or servlet the page is forwarded to. Session scope indicaties a bean is visible to all jsps and servlets which are part of the same session and application scope means the bean is available to all jsps and servlets in the entire web application...
I think

The date time classes of the Java API must be the most confusing / frustrating setup Sun could possibly think up...
I want to take someones birthday say 21 July 1971
and then check if they have a birthday between two dates say 2 July 2001 and 20 April 2002.
I just can't seem get it right...
Any help suggestions please
22 years ago
Thanks for all your help.
22 years ago
Hi,
Can someone please explain to me how I would calculate the number of weeks between two dates. I know I would be using the calendar class but I've got myself into a muddle!
Any assistance apreciated
Thanks
Joel
22 years ago
Hi Colin,
That's a yes. I would want to be able to search on a number of different variables. at the moment I have a number of methods
for example getAddressListBySurname(String theSurname),
getAddressListByFirstname(String theFirstname)...
23 years ago
Hi,
I have an arraylist of 'Address' objects, each object stores a persons name, address details, etc, with appropriate get / set methods. I was wondering what is the best way to search this list. Say for example I want all the people with the surname 'smith'; and there may be many. At the moment I create an iterator of the arraylist and run through each object. At each iteration I say - if object.getSurname.equals("Smith") - and then, if surname does equal smith I add the object to a new arraylist which, at the end of the iteration, is then returned.
This works pretty well, and for small lists is no problem. I am worried though that with larger lists this is a slow and tedious way of doing it.
Questions are: should I be using a different collection to a List? Is there a better, faster, more efficient way to search through lists?
Thanks in advance for any help / advice
Joel
P.S. If this question is more appropriate for another dicussion group, please let me know, wasn't sure where to ask...
23 years ago
Thanks for your help guys :-)
23 years ago
Hi,
why is java's time / date mechanisms so confusing??
Everytime I try do the simplest thing I get into a muddle.
All I want to do is display the current time Plus say half an hour. I can create a timestamp but then it displays the date and time including seconds, milliseconds and even nanoseconds. All I want to display is hours and minutes...
hope this is the right forum to post what I think is a beginners question??
23 years ago
Hi ejb-guru's
I have 2 related questions I hope someone can advise me on (I'm new to EJB's), relating to the java.util.Timer class and EJB's
<Context>
I am working on a basic shopping cart system, using a stateful-session bean to represent the customers shopping process. The customer reserves items (ie puts them in his cart while continuing to shop), then, after a specified time, if he has not checked out those items(ie moved to payment stage) they will automatically be unreserved until such time as he is
ready to pay (at which time the system will attempt to rereserve them). I wanted to use the util.Timer class and util.TimerTask to schedule and implement this unreservation process.
</context>
<Questions>
Firstly, the Timer class works by creating a seperate thread to run in. I know(although I don't fully understand why) that it is prohibited to create threads in a J2EE container since threads are managed by the container and shouldn't be messed with. How will using the Timer class affect / be affected by this? Is there a better way?
Second, if I create the Timer object in the stateful session bean it would mean that for every customer there will be a seperate thread running which is obviously not ideal. Ideally, I want to be able to create one Timer thread that all the EJB's can share. Is this possible, any clues on how I might implement such a scenario? Could I use a servlet to do it? We want to avoid writing a seperate service that's external to the J2EE container/server.
</Questions>
Any comments / ideas appreciated
Joel
Hi All,
I have a jsp which iterates through shop offers and presents them in a table on the page.
Therefore I have a number of parameters named offerId, and an equal number of parameters named
quantity. When the form is submitted I want the 'quantity' ordered to match up with the 'offerId', ie quantity[0] will be from the same record as offer[0]
The following code seems to show that they do match up:
String[] offers = request.getParameterValues("offerId");
String[] quantity = request.getParameterValues("quantity");
for(int i=0; i < offers.length; i++)
System.out.println("OfferId: " + offers[i] + " | " + "Quantity: " + quantity[i]);
I just want too make sure though, in the above situation am I guaranteed that the 2 will match up?
I don't want to end up with a situation where accidently the wrong item is ordered or the wrong quantity? Is there a better way to do this?
Thanks for any help
Joel
23 years ago