Tomcat – Configure remote debugging

The following hints allow to do remote debugging on tomcat using Java Platorm Debugger Architecture (JPDA).

This article is taken from the following source.

Configure Tomcat for remote debugging

Basically, it is enough to edit startup file (which can be startup.bat or startup.sh) under tomcat bin directory, and adding the following lines, for example below the set local command.

Windows:

Unix:

Finally, edit the call to the executable by adding “jpda” before “start” statement:

Windows:

Unix:

At this point start tomcat on the usual way.

Configure eclipse for remote debugging

The procedure for configuring eclipse for remote application is extremely simple.

Prerequisite:

Start tomcat with the above configuration, then on eclipse do the following steps:

  1. Select project to debug
  2. Choose “Debug configurations..” on Debug menu
  3. On “Remote Java Application” left menu, click “New Launch Configuration” button
  4. On Connection Type, select “Standard (Socket Attach)” combo item
  5. Type on the listening port (on the above tomcat configuration, was 8000)
  6. Click on Debug and start listening

That’s all!

Ractive.js – Create a droppable image div component with configurable size property

This example shows how to create a drag & drop image container with a configurable width and height; example’s requirements are jQuery and Ractive.js.

Download code

First off, let’s make a preview of what the user see when the page load:

Starred_MediaSoft_720x600

 

To display the page above, the developer has just to write the following code:

Ractive.js allows creating component for reusing in any web application.

The code for the image drag & drop div component is the following:

image_uploader_compo.html

The viewmodel will initialize the component and the page itself with the data to display; furthermore, the component fires an event ‘imagerefused’ in case the image dropped does not satisfy the width / height requirements specified in the imageuploader component, so it’s up to the viewmodel to catch and display a properly message.

viewmodel.js

Here’s the final result:

 

Starred_MediaSoft_720x600_image_deny
image uploader

Starred_MediaSoft_720x600_image_completed