Skip to Navigation | Skip to Content



More java goodness | April 19th, 2007

So as promised, here is some more Java love in the form of an Eclipse plugin and a Struts 2 plugin.

Files
Eclipse Plugin 0.8 (This is plugin uses the trial versions of the components)
Struts 2 Plugin 0.8
Nitobi Taglib 0.8 (some small kinks worked out)
Nitobi Server Library 1.0.1 (This updated library (used to be called nitobicomponents.jar) is needed for the Struts 2 plugin)

Eclipse Plugin
This plugin is built on top of WTP (1.5.3) extension points and provides some custom project facets when creating a new Dynamic Web Project. It will copy over the needed script and style files to resources/nitobi/script and resources/nitobi/style in the root of your web content directory. It’ll also copy over the Nitobi Taglib and Nitobi Server Library jars to your project build path.

We’ve also added some contributions to the Snippet palette. Dragging a snippet to an open editor will insert a small, demonstrative declaration that will usually render without modification. I say “usually” because of course you’ll need to do some lifting of your own if you want to have the component bound to remote data.

Struts 2 Plugin
I put up a knowledgebase article on using Grid in Struts 2 and I realised while writing it that we could help simplify the process. So I put together a simple, but hopefully useful plugin which provides a Nitobi result type.

To use the result type, you need to declare a package in your struts.xml file that extends “nitobi-default” and your get handler action needs to specify a result type of “nitobi”. Par example:

<struts>
  <package name="grid" extends="nitobi-default">
    <action name="gethandler" class="example.GetHandlerAction">
      <result name="success" type="nitobi">
        <param name="encoding">UTF-8</param>
        <param name="handlername">gethandler</param>
      </result>
    </action>
  </package>
</struts>

Note that the result can take two optional parameters: encoding and handlername. The encoding attribute is used to set the encoding of the response. The handlername attribute is the name of your Action’s GenericGetHandler/GenericSaveHandler member variable that the Result will look for in the Value Stack. So, if in your Action you have a GenericGetHandler declared as such:

// You also need to declare a public getter for this member
// to make it available to the Result on the Value Stack.
GenericGetHandler monHandler;

You need to specify this using the handlername parameter. By default, encoding will be set to UTF-8 and handlername is set to handler.

There may be some kinks yet to work out so bear with me! We’ve got some improvements to the server library on tap and hopefully a NetBeans module too. Again, any feedback on this stuff would be most appreciated and will be reciprocated with a virtual, yet vigorous, high-five.

Posted in eclipse, java, struts2 | 1 Comment » | Add to Delicious | Digg It

This entry was posted on Thursday, April 19th, 2007 at 7:37 pm and is filed under eclipse, java, struts2. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Response to “More java goodness”

  1. Andre’s Blog » Blog Archive » links for 2007-04-20 Says:

    [...] Mike’s Blog » Blog Archive » More java goodness More eclipse and Java components for the Nitobi suite! yar! Here’s what you can get:Eclipse Plugin 0.8 (This is plugin uses the trial versions of the components) Struts 2 Plugin 0.8 Nitobi Taglib 0.8 (some small kinks worked out) Nitobi Server Library (tags: java eclipse ajax struts nitobi completeui components) [...]

Leave a Reply


Search Posts


My ideal work culture:
[See my summary] [What's yours?]

Archives

Categories