Tuesday, April 23, 2013

javascript submit is not a function

Javascript:
When you try to call submit() from javascript like the one below,
function addRule() {
var ff=document.forms["testForm"];
ff.wizardAction.value="ADD";
ff.submit();
}

Error Message:
submit is not a function

Resolution:
It means that you named your submit button or some other element submit. Rename such button(s) to some other name and your call will magically work.

When you name the button submit, you override the submit() function on the form.

dynamic id styleId struts html tag

If you want the html ids to be generated dynamically such as 
<input type="text" name="rule" id="rule0">

check this 
<% int index = 0; %>
<html:text property="rule" styleid='<%="rule"+index%>' />
<% index++;%>

Common mistake:
<html:text property="rule" styleid="rule<%=index%>">
shows up on html,
<input type="text" name="rule" id="rule<%=index%>">



Thursday, April 18, 2013

Gems Tibco JMS Putty Xming

Tibco Enterprise service (EMS) is a fully complaint JMS implementation from TIBCO with some added enhancements like load-balancing, routing, fault-tolerant configurations, which help improve performance and minimize failures in the server.

Gems is a graphical user interface utility for TIBCO Enterprise Message Service  (EMS). It can be used by JMS developers as a general purpose test debugging tool and by  administrative support staff as a management and monitorig tool.

What do we do with this ?? I am primarily using this to
  • Server Management. Including, general server configuration, JMS destinations,  JNDI factories, users/groups, permissions, bridges, routes etc.
  • JMS support. Messages may be sent/received, queues may be browsed and message  contents inspected. Selectors and filters may be specified.
  • JMS Message Monitoring. Messages may be monitored (snooped) as they pass trough  the server. Request and reply messages can be correlated to provide service  response times.
  • JMS Message Management. Eg; purging messages, copy messages from a queue to  another queue on a different server.
  • Security. SSL connectivity, view only mode.

    Can i access this gems from putty directly??? No, you need  Xming (http://sourceforge.net/projects/xming/)

    What is Xming??
    We can run graphical programs on Linux/Solaris machines remotely and display them on your desktop computer running Windows. We can do this by using running two applications together on your Windows machine: Xming and PuTTY.

    1. Navigate to the Files section and download:
    • Xming setup from the Xming folder
    • the fonts package installer from the Xming-fonts folder
    1. By default both programs will be installed into the same location, so don't the worry about over writing files. We cannot work without both packages.
    2. Once installed, running All Programs > Xming > XLaunch is a good idea to see what the configuration looks like. In most cases, the default options should be just fine.
    3. Finally run All Programs > Xming > Xming to start the PC X Server. The “X” icon should be visible on the Windows Taskbar. The X Server must be started before setting up a SSH connection to a remote system.
    What is PuTTY ?? 
    As we all know, PuTTY is a free SSH client. Through PuTTY we connect to a remote machine. 

    Any Configuration needed on PuTTY, to run GEMS??? Yes
    Under Session, enter the hostname, port 22, connection type is ssh
    Connection > SSH > X11. Check the box next to Enable X11 Forwarding. By default the X Display location is empty. You can enter localhost:0. The remote authentication should be set to MIT-Magic-Cookie-1

    navigate to the desired folder and run
    ./xxxxxx.sh &
    & runs the command in background so that you can work on your terminal and run the graphical application.