Dan Grindstaff wrote:I was told I need to write a wrapper class and I was wondering what all that entails. I believe that I need ti identify the API components of the spellchecker and expose them to web app?
Yeah, that sounds right. But is this one of the cases where the pointy-haired manager says "Simple, all you have to do is..."? Or was it said by somebody who actually knows something about the application in question? I ask because the vast majority of applications don't have a published API whereby other code can access their functions.
If your application has a GUI interface that's a pretty good sign that it wasn't designed for access like that. Of course that's just a general statement, so yes. Start by identifying the spellchecker's API components.
Dan Grindstaff wrote:... it runs as an applet so maybe it cannot be accessed as a library...
Well, at least it's Java. So it might well have an API, and the applet is just an example of a wrapper which calls that API. From what David says it sounds like you have a pretty good chance.
Dan Grindstaff wrote:Thanks, again for the great answers! I have some more information that I need to share. I need to somehow modify Jazzy to function on the back end so that I pass it requests from a servlet (string) and it passes back a spelling suggestion if there is an error. These are my marching orders. This seems to me to be a little cumbersome. Shouldn't there be a way to call it's functionality like a program would reference a library? Any ideas would be greatly appreciated. Thanks!
Have you found its API? It looks like the site completely lacks documentation, but they do provide a source-code download so you should be able to see what methods are available, and perhaps build javadocs from it to make some reference material.
I made a local copy of the API, and the code is poorly documents (no surprise I guess being as they don't provide any documentation on their website). But there is an interface called SpellDictionary which looks to be the crux of the tool. It provides methods to check if a word is correct and methods to get suggested words if it is not correct. So you will want to look at implementations of that interface.
And I am sure looking at the provided examples will help.
Looks like their download site does have a javadoc download. Check under the >Jazzy > Jazzy 0.5 > option.
What context do you WANT to use this in? You talk about wrapping it in a bean, now to call it from a JSP. What exactly are you trying to spell check? When exactly do you expect the spellchecking to occur?
My fear is that you have client - side code, say an HTML text area, and you want to spell check the contents of it. That is fine, but using JEE technologies (alone) you would do the spell checking on the Server Side. You would have to submit the form, pass the contents through the spell checker as in the code that David provided (best called from a Servlet or an action class called from the Servlet), then send the results of the spell check back to the client. This sounds a bit out of the way, but if you are good with Ajax it may not be so tough.
If you need to use a Java spellchecker, but you want to do it client-side then you are really left with an Applet.
Steve Luke wrote:My fear is that you have client - side code, say an HTML text area, and you want to spell check the contents of it. That is fine, but using JEE technologies (alone) you would do the spell checking on the Server Side. You would have to submit the form, pass the contents through the spell checker as in the code that David provided (best called from a Servlet or an action class called from the Servlet), then send the results of the spell check back to the client. This sounds a bit out of the way, but if you are good with Ajax it may not be so tough..
Hi, This is exactly what I want to do. That is why I was thinking the bean residing on the app server would work. I am not very good with AJAX but was told I need to ramp up on JSON to pass results back to the page.
Catch up on JSON and AJAX, as well as basic Servlet communications to address the rest.