Win a copy of Emmy in the Key of Code this week in the General Computing forum!

Frank Zammetti

Ranch Hand
+ Follow
since Dec 16, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Frank Zammetti

Congrats to me!! I win!! Woo-hoo!!

Err, wait, I'm the author, must have missed the disclaimer. My bad.

Seriously though, thanks everyone and Java Ranch and of course everyone that asked questions, it was a fun week. I'll try and stop by here from time to time even if I don't have another book to promote

Take care all,
Frank
That *is* the value You have to implement some sort of meaningful toString() on the Java class you're marshalling, otherwise you get the typical, basic Java implementation.
Not as far as I know. I don't recall reading where the name came from off the top of my head, but I suspect it came from the idea of a Dojo in martial arts in some way, but I'm not sure.
If you mean can Dojo call JSON-P based web services, then yes. If you mean the full-stack web services, using SOAP, WSDL, and so on, then I don't believe so.

I have to disagree with Chris on this one though... a client calling a web service is a very powerful concept that allows for all sorts of cool mashups, so I'm all for that (one of the projects in the book is exactly that). Now, if we're talking about calling full-blown web services from a JavaScript client, then I'd tend to agree, if for no other reason than all the XML parsing/generating code you'd need, which would be unpleasent.
Yeah, I'm with you, it's something I'd like to hear about too. I suspect there's probably only a limited set of cases where it would come into play, but they are interesting cases and worth discussing.

I suppose the way you could tackle it is that every time a user "registers", the app creates a separate Gears database for them, with the password stored in it in an encrypted form. This is in no way, shape or form 100% secure, but it's probably good enough for many situations. That way, the data is segregated and should, to a first approximation, be somewhat safe from others. Of course, you can just hack the SQLLite database files, but like I said, to a first approximation that might be an acceptable risk.

I think I remember seeing Dojo including some encryption support on top of Gears, but I'm not sure the status of that or how robust it is, or how far along it is, that could be another good, helpful piece of the puzzle.
With the caveat that I haven't tried this code, it should just be:

data.c[0]

..or...

for (var i = 0; i < data.c.length; i++) {
doSomething(data.c[i]);
}

So long as your JSP rendered the JSON properly, the c should be an array, which you should be able to just access with simple array notation.
No, the book doesn't discuss that at all because I'm not sure what the use case would be. Well, I take that back, I can think of some situations... a sovereign webapp run in a library for example, you might want to have the concept of users that maybe stores settings in Gears or something like that.

That being said, I think that's maybe a bit of an unusual use case... I think typically you tend to assume that a sovereign webapp is run by one user, since it's on their machine. Think of it like MS Word or something... you don't have to log in to use it, even though you may have some user-specific settings (initials for example).

Then again, a counter-example would be Firefox, where you have profiles. But even in that case there's nothing like authentication or logging in, there's simply switching profiles.

I haven't done much thinking about this I'll admit, so I'm just kind of throwing out some ideas here. But the answer to your question in any case is no, this isn't discussed in the book at all and I don't at present have any preferred method to do this.
I think Dojo's learning curve isn't *much* higher than any other framework... getting it on a page and getting some basics things done is fairly well-documented and isn't tough at all (Dojo is available via CDN, so you don't even necessarily need to download it).

I think the problem with Dojo, if you can even call it that, is that it's so powerful and expansive that getting your head around all it can do can be a challenge. My book can probably help in that regard, sure. My book however does assume that you aren't a JavaScript beginner, so that would definitely be a problem if you were new to client-side development in general. If you're new simply to Dojo though, I think it would be fine.
This is a pretty good reference:

http://www.boutell.com/newfaq/misc/urllength.html

In short, anything over ~2000 characters *may* be a problem and you shouldn't count on it working.
I don't think I'd limit it to just those three frankly... Ext JS is extremely capable, as is jQuery these days, and there's others that I'm not as familiar with but which look completely viable. There's lots of choices these days... sometimes too many, but many are viable.
Dojo is a pure JavaScript framework and as such you should be able to integrate it pretty easily with any Java framework (JSF might be a bit of a problem, and maybe others, but even there I'm sure it's possible, and who wants to use JSF anyway? LOL). My book however doesn't discuss Java at all, in fact it doesn't discuss back-end concerns at all.
Dojo too has class selector support, although I haven't played with it much... I can't give you the exact code off the top of my head, but you should be able to get pretty close in Dojo to what you write in jQuery.
Every empty I've ever seen to wrap up Dojo in some way that allows Java developers to not have to touch JavaScript have been... less than successful. Also speaking as someone who created a library to abstract Java developers away from JavaScript (the AjaxParta Taglib), I think there's something to be said for the general approach, but also in general I think it tends to not be worth the effort.

When you're first getting into Ajax I think something like AjaxParts Taglib can be helpful... and adding Ajax to an existing Java application is an area where it also can be helpful... but when you get to the point where you're really trying to develop a modern RIA, I think you just need to get into JavaScript, regardless of what library you choose (or no library at all if you want).
Assuming that was directed at me, I have no knowledge of Woodstock at all and thus can't help any.

If you meant that as a more general question to all readers, then I step aside for someone else to answer
Gotta give me a little time to respond, I had to actually sleep last night

Security is a very tough topic in ANY JavaScript environment... there's plenty of ways security can be breached. That being said, I don't perceive Dojo and being any worse than any other library out there. You are correct, Dojo provides callbacks for various situations that can arise when making an Ajax request, but that's the case for virtually every library out there. I'm not sure it's something you need to "work around" at all.