MichaelJ McCabe

Ranch Hand
+ Follow
since Feb 09, 2010
Merit badge: grant badges
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 MichaelJ McCabe

Ulf Dittmer wrote:Well, the images are not created until the web page in which they appear accesses them (which means that if a JSP page has a cewolf:chart tag, but no corresponding cewolf:img tag, then they aren't created at all).

If a page contains multiple images, then it'll take a while until all are being requested, generated, and returned to the browser (because browsers only send a few requests in parallel). The "Cewolf Set" page of the sample web app is an example of a page where this can be observed.

If this is repeatable behavior -and it probably isn't- then I'd check the web access logs to see if the image requests reach the server, and use something like the Firefox extension LiveHTTPHeaders to see if those requests are sent by the browser. This might provide clues as to what's going on.

Thanks for your response.

Its not repeatable unfortunatily, but it is happening every one in a thousand. And it really cant happen at all. Is there a way of preloading? Regardless of solving the issue, it would make the page look neater if this could be done.

Also Ulf, the bug fix
•BUG FIX: Memory leak when using the <imgurl> tag

when was this done?

And Finally, where is this "Cewolf Set" page? Dont want to sound like an idiot, but I cannot find it anywhere (In your distribution or the original)
This question is really directed at Ulf, but perhaps someone else can help too.

I apear to be having issues with, every now and again, the ceworlf images loading. Now, these images are links to larger graphs which are populated from the data passed to Cewolf graphs.

Every now and again, some images just show blank, but when clicked on, the data is there.

The only thing I can think of is that the data is being loaded (I am using struts with actions, so all the calculations and data formatting has to be done before the page loads), but the images are not being created quick enough to display?

If I am right (which I am not 100% about). How do I go about ensuring that the Cewolf images preload before they are shown?

Martijn Verburg wrote:You'll want to find out the host OS of the FTP server, that's usually enough to configure your client correctly. Also I assume you've logged in through a Command Line client to check your permissions, home directory etc are OK?

I know the host OS as Windows NT, but dont see how that would affect it. I logged in through command line using the username and password provided. And when listing the directory, it shows the files in the folder using ASCII mode data connection. So I know that works...

Martijn Verburg wrote:Hi Michael,

Have you tried Apache commons-net? And yes the type of FTP server does matter, there are some subtleties between them and often you have to configure your FTP lib to talk to a particular flavour. _very_ rarely you have to write a plugin to make yours work.

Fantastic, thanks for your response. I have only been given the host, username and password for the FTP folder. But I can get more information regarding the folder if I know what to ask for... problem is, I dont know what to ask :P

What kinda things do i, or can I find out about it to get a better idea of what I need to use?
Hi, my knowledge of FTP in general is quite limited so bear with me.

I have gone through 3 different open source scripts now, and each one, I get the same problem. It connects to the ftp folder fine, but cannot get the directory listing. It either times out or returns nothing.

At the moment I am using this - http://www.enterprisedt.com/products/edtftpj/

Basically, what I need to do, is connect to a predesignated ftp folder and download everything from there, to my local machine. Pretty simple. But edtftpj connects fine then when using FTPFile[] files = ftp.directoryList(); it times out.

I have a feeling it is to do with the ftp server i'm connnecting to, but I dont know enough. Does anyone have any ideas?
Please excuse my lack of MySql knowledge here.

Basically, every day I have a CSV file with a weeks worth of data. And every day that passes by, the csv files is automatically edited and removed the last day and adds the new day. So that it always has the LAST weeks data.

I need to parse this data and put it into a database.

The problem is here, obviously, is that if I just parse this data in, there will be duplication. Every day, im adding a new set of data which I parsed for the last 6 days, even though it is identical. Mysql will take a new primary key and add this in as seperate content.

I know the simple answer is to check that the data isnt already there, or to make sure that I only parse the LAST day. But I was thinking to myself, why complicate things, if there was a way of overwritting the data if there is a duplication?
Thank you very much, again, for all your help. I now have it working.

Both ${maxXValue} and ${sessionScope.maxXValue} didnt work so I ended up doing

<% int maxXValue = (Integer)session.getAttribute("maxXValue"); %>

then using

value="<%=maxXValue %>"

looking great

Ulf Dittmer wrote:I'm not sure what you mean by "get a value to my JSP page" - JSP has access to the user's session, so it can retrieve the value.

The "params" Map in the processChart method contains all values that are passed in via cewolf:param tags, so I think adding that single line of JSP code is all it takes to implement this (plus the Java code that retrieves the element from the Map and uses it).

Ah ok, I understand. But I am getting "cannot find symbol - maxXValue" when trying to compile.

I am using this in my processChart method

and this in my jsp page cewolf chart

Ulf Dittmer wrote:You can use the JSP EL to pass the value to the postprocessor:

<cewolf:param name="maxXValue" value="${maxXValue}"/>

Assuming that there are no other attributes with that name in the page or request scope, it will get it from the session. Or you can use "${sessionScope.maxXValue}".

I dont need to get a value to my JSP page though. I need to set the max X value within the ChartPostProcessor i have below

I am setting a cewolf's chart maxX value as follows

The problem I am having, is that the 'value' needs to change in relation to a session variable. I obviously cant do


because of the local variable "session" being accessed from within a inner class. How would I go about injecting a variable into this chart processor?

David Newton wrote:Define the DAO bean in Spring and include it in the Quartz job bean: you might want to read up on some Spring basics before proceeding too much further; this IoC/DI (Inversion of Control/Dependency Injection) is one of the most basic aspects of Spring. getting a handle on it early will save you a lot of effort.

Thank you very much for all your help David. I looked into what you said and got it working by defining the DAO bean and;

12 years ago

David Newton wrote:Inject the DAO directly into your Quartz job--that's what Spring is for; why convolute things?

How would I go about doing this?
12 years ago

David Newton wrote:That's no bean, that's an action. Spring knows nothing about it.

Struts actions can be Spring beans (or vice-versa, depending on your point of view), but the action class itself would need to be defined as a Spring bean. There's Struts 1-Spring integration, so this is not a big deal.

That said: that's a *bad* idea, there should be no reason why a Quartz job would need to access a Struts action, unless something has gone wrong with your design: that's an inappropriate coupling.

Ok Thanks for the clear up. I'm very new to all this.

The reason I was to access a Struts action is as follows. Due to my lack of knowledge, I cannot think of a better way.

Within this quartz job, i want access to my SpringHibernateDao. Now I do this using

and my service finder

this is the ONLY way I know of doing this. And it requires a HttpServletRequest. And the only way I know of having that is through a struts action
12 years ago

Christophe Verré wrote:You're telling Spring that there is a JobDetailBean class called Myjob in the "path" package. Is the MyJob class in a package called "path" ? I don't see any package declaration in your code.

the "path" was just filled in as the path was really long. So although it wasnt specifically that, it turned out it was a path problem... which is quite embarasing.

But it brings me onto a simular question;

I want to reference a bean within the quartz job. Its a bean which is defined in my Struts-config, with its own action. Is this possible? The bean is as follows

12 years ago
Hi Ulf.

I had a question regarding this. within the PageViewCountData class, there is a method "hasExpired" which returns whether the producer's data is over 5 seconds old or not.

I wanted to fully understand this, and perhaps solve the reason why I'm getting problems. Does this mean that after 5 seconds the date is set to be invalidated? The reason I bring this up, is that I am getting problems that sometimes, on page load, the content of the graphs are not showing. Now this could be down to multiple reason, of which I am checking, but this interested me and I thought i'd ask.

Does it mean that if the page takes longer than 5 seconds to load, the content will not show? I may be being stupid, but if this IS the case, how do I go about extending this?