JApplet focus in JSP page

I have an applet embeded in a JSP page. In this applet I have some text feilds for data entry. After the each data entry this field get validated . If the entered data is wrong then it popup a message using the JOptionPane.
Now the problem. :- after message, I want to set back the focus to the respective fields. I had used setfocus(), grabfocus() etc..But nothing get worked.. Please advice ... tanx in advance...........
Rgds
Joe

That's struts-specific. We're here in a JSP/JSTL forum.

Similar Messages

  • How can i get the value of an jcombobox in a japplet into my html/jsp page

    hii
    i hav a japplet which contains an editable jcombobox
    which i have embedded into my jsp page .Now i want to get the value of jcombobox in my japplet into a taxt box in my .jsp page which will change as the value of jcombobox changes .Now in doing this i guess i will have to writer some public event in my japplet which will return the value into my web page .
    Now in doing so my first problem is to refer the japplet from my jsp page .In case of ordinary applets which does nt use swing i hav used id attribute in my applet tag and the document recognize it as its object just like any other html controls.
    but here although my japplet is running after installing plug -in the document is not regognizing the japplet .I hav tried with both <object > and <applet> tag .
    The name attribute in object tag is only changing the name of the class into that name given in the name attribute in the browser .
    I need to solve this out .Any help will be greatly appreciated

    Please help me .Its very urgent

  • Passing value from JApplet to Jsp page

    Hello,
    How can i pass a value that is entered in a JTextArea in a JApplet and fetch the entered value from JTextArea and display it in a JSP page.
    It would be kindful if someone could help me with this problem.
    Regards
    Sanam

    hello,
    Thanks for ur reply,
    Sorry to say that i did not understand where to implement ur code in my code.
    Below is my code could u plz tell me where do i put in ur code.
    My code works fine u can compile it.
    javac *.java;
    appletviewer BIA.java
    Can u plz tell the JSP code.
    It would be very kindful if u could please help me.
    Thank you
    //**************** BIA.java***********
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import java.net.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import java.util.Vector;     
    import java.applet.*;     
    import java.awt.image.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.lang.reflect.Field;
    <applet code = "BIA" width = 500 height = 500>
    </applet>
    public class BIA extends JApplet
         public static Container cp;
         public BIAP panel;     
         public TB action;
         public void init()
              panel = new BIAP();
              action = new TB(panel);
              action.setLayout(new GridLayout(2,2));     
              cp = getContentPane();
              cp.setLayout(new BorderLayout());
              cp.add(action, "North");
              cp.add(new JScrollPane(panel));
              repaint();
    //******************* BIAP.java*************
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import java.net.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import java.util.Vector;     
    import java.applet.*;     
    import java.awt.image.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import java.lang.reflect.Field;
    class BIAP extends JPanel
         public BIA bia;
         public BufferedImage image;
         public double scale, scaleInc;
         public JTextArea jt;
         public BIAP()
              loadImage();
              setBackground(Color.white);
              scale = 1.0;
              scaleInc = 0.01;
              setLayout(null);
              jt = new JTextArea("Welcome");
              jt.setBounds(0,0, 90,30);
              add(jt);     
              repaint();
         protected void paintComponent(Graphics g)
              super.paintComponent(g);
                   Graphics2D g2 = (Graphics2D)g;
              g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                        RenderingHints.VALUE_INTERPOLATION_BICUBIC);
              int w = getWidth();
              int h = getHeight();
              int imageWidth = image.getWidth();
              int imageHeight = image.getHeight();
              int x = (w - imageWidth)/2;
              int y = (h - imageHeight)/2;
              g2.drawImage(image, x, y, this);
         private void loadImage()
              String fileName = "Terragen___Losing_Grip_by_Blackheart6004.jpg";
              try
              URL url = getClass().getResource(fileName);
              System.out.println(url);
              image = ImageIO.read(url);
              catch(MalformedURLException mue)
              System.out.println("url: " + mue.getMessage());
              catch(IOException ioe)
              System.out.println("read: " + ioe.getMessage());
         public Dimension getPreferredSize()
              Dimension d = new Dimension();
              d.width = (int)(scale * image.getWidth());
              d.height = (int)(scale * image.getHeight());
              return d;
         //method used for Zoom Operation
         public void setScale (int inc)
              scale += inc * scaleInc;
              revalidate();
              repaint();
    //************************** TB*********************
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import java.net.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import java.util.Vector;     
    import java.applet.*;
    import java.awt.image.*;
    import javax.swing.*;
    import javax.swing.event.*;
    class TB extends JPanel
         BIAP panel;
         JButton save = new JButton("Save");
         public TB(BIAP biap)
              panel = biap;
              ActionListener sa = new ActionListener()
                   public void actionPerformed(ActionEvent e)          
                        JButton button = (JButton)e.getSource();
                        if(button == save)
                             //panel.fileSave();
              save.addActionListener(sa);
              add(save);
    }

  • My JSP page takes a lot of time to go to next JSP

    Hi All,
    I have a JSP page which loads dynamically depending on what the user enters. This page works fine for items upto 20-30 but as the number of items increases, my JSP page takes a lot of time to go to the next one. Heres what my JSP looks like:
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-form.tld" prefix="form" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <%@ taglib uri="/WEB-INF/rswtags.tld" prefix="rsw" %>
    <jsp:useBean id="dateFormatIntl" scope="session" type="java.lang.String"/>
    <html>
    <head>
    <title><bean:message key="title.application"/> - <bean:message key='header.return_to_vendor_detail'/></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <%@ include file="rsw_functions.jsp" %>
    <%@ include file="shipment_rtv_functions.jsp" %>
    <script language="JavaScript" type="text/javascript">
    var page = "<bean:message key='header.return_to_vendor_detail'/>"
    var rtvEntryArray = new Array();
    var totalAmtString;
    function setFormValues()
    var rtvEntriesString = "";
    for (var v = 0; v < rtvEntryArray.length; v++)
    var rtvEntryString = rtvEntryArray[v].itemNumber + "~"
    + rtvEntryArray[v].itemQty + "~"
    <rsw:display displayElementName="rtv_reason">
    + rtvEntryArray[v].inventoryStatusCode + "~"
    + rtvEntryArray[v].inventoryStatusName + "~"
    + rtvEntryArray[v].reasonCodeId + "~"
    + rtvEntryArray[v].reasonCodeName + "~" +
    </rsw:display>
    <rsw:display_false displayElementName="rtv_reason">
    + " " + "~"
    + " " + "~"
    + " " + "~"
    + " " + "~" +
    </rsw:display_false>
    rtvEntryArray[v].valid;
    rtvEntriesString = rtvEntriesString + rtvEntryString + ";";
    document.rtvVsatShipmentForm.rtvEntriesString.value = rtvEntriesString;
    function writeItem(itemNumber, itemQty, inventoryStatusCode, inventoryStatusName,
    reasonCodeId, reasonCodeName)
    if(!acquireFakeLock()) return;
    if (!arrayContainsItem(itemNumber, reasonCodeId))
    addEntry(itemNumber, itemQty, inventoryStatusCode, inventoryStatusName,
    reasonCodeId, reasonCodeName, "true");
    else
    setItemQtyReasonArray(itemNumber, itemQty, reasonCodeId, reasonCodeName);
    writeTable(false);
         releaseFakeLock();
    function handleApply()
    <%-- change this if 'please select...' value changes to something other than a space --%>
    if (document.rtvVsatShipmentForm.applyReasonCode.value == " ")
    alert('<bean:message key="error.must_enter_a_reason" />');
    return;
    if (checkQuantityGreaterThenZero(document.rtvVsatShipmentForm.applyQty))
    formatQuantity(document.rtvVsatShipmentForm.applyQty);
    if (document.rtvVsatShipmentForm.applyId.value == '')
    alert("<bean:message key='error.no_dsd_order_entries' />");
    document.rtvVsatShipmentForm.applyId.focus();
    return;
    writeItem(document.rtvVsatShipmentForm.applyId.value,
    document.rtvVsatShipmentForm.applyQty.value
    <rsw:display displayElementName="rtv_reason">,
    document.rtvVsatShipmentForm.selectedInventoryStatus.options[document.rtvVsatShipmentForm.selectedInventoryStatus.selectedIndex].value,
    document.rtvVsatShipmentForm.selectedInventoryStatus.options[document.rtvVsatShipmentForm.selectedInventoryStatus.selectedIndex].text,
    document.rtvVsatShipmentForm.applyReasonCode.options[document.rtvVsatShipmentForm.applyReasonCode.selectedIndex].value,
    document.rtvVsatShipmentForm.applyReasonCode.options[document.rtvVsatShipmentForm.applyReasonCode.selectedIndex].text
    </rsw:display>
    document.rtvVsatShipmentForm.applyId.value = '';
    document.rtvVsatShipmentForm.applyQty.value = 1;
    document.rtvVsatShipmentForm.applyId.focus();
    <rsw:display displayElementName="rtv_reason">
    document.rtvVsatShipmentForm.selectedInventoryStatus.value
    = document.rtvVsatShipmentForm.selectedInventoryStatus.options[0].value;
    selectFromInvStatus();
    </rsw:display>
    totalAmounts();
    function clearFields()
    document.rtvVsatShipmentForm.returnAuth.value = "";
    document.rtvVsatShipmentForm.applyId.value = "";
    document.rtvVsatShipmentForm.applyQty.value = "1";
    document.rtvVsatShipmentForm.applyId.focus();
    document.rtvVsatShipmentForm.selectedInventoryStatus.value = document.rtvVsatShipmentForm.selectedInventoryStatus.options[0].value;
    selectFromInvStatus();
    function getCurrentOptions()
    if (document.rtvVsatShipmentForm.selectedInventoryStatus.value == "AVAILABLE")
    return availableOptions;
    return unavailableOptions;
    function populateDropDown(dropdownField)
         var currentOptions;
    currentOptions = getCurrentOptions();     
    dropdownField.options.length = 0;
    var oPleaseSelectOption = document.createElement("OPTION");
    oPleaseSelectOption.value = " ";
    oPleaseSelectOption.text = "<bean:message key="label.please_select"/>";
    dropdownField.options.add(oPleaseSelectOption);
    for (var i = 0; i < currentOptions.length; i++)
    dropdownField.options.add(currentOptions);
    function selectFromInvStatus()
    populateDropDown(document.rtvVsatShipmentForm.applyReasonCode);
    function initialize()
    document.rtvVsatShipmentForm.applyId.focus();
    createReasonOptionObjects();
    selectFromInvStatus();
    <logic:equal name="rtvVsatShipmentForm" property="returnAuthRequired" value="true">
    if (document.rtvVsatShipmentForm.returnAuth.value == '')
    document.rtvVsatShipmentForm.returnAuth.focus();
    </logic:equal>
    createEntryArray(document.rtvVsatShipmentForm.rtvEntriesString.value, false);
    <rsw:display displayElementName="rtv_reason">
    </rsw:display>
    totalAmounts();
    function next()
    setFormValues();
    if (document.rtvVsatShipmentForm.rtvEntriesString.value == '')
    alert("<bean:message key='error.no_dsd_order_entries' />");
    document.rtvVsatShipmentForm.applyId.focus();
    return;
    <logic:equal name="rtvVsatShipmentForm" property="returnAuthRequired" value="true">
    if (document.rtvVsatShipmentForm.returnAuth.value == '')
    alert("<bean:message key='error.return_auth_required' />");
    document.rtvVsatShipmentForm.returnAuth.focus();
    return;
    </logic:equal>
    if (!validateTextAreaLength(document.rtvVsatShipmentForm.comments,
    "<bean:message key='label.comments'/>", 255))
    return false;
    document.rtvVsatShipmentForm.submit();
    function doBack()
    backLink.href = "<bean:write name='rtvVsatShipmentForm' property='previousAction' />";
    document.rtvVsatShipmentForm.action=backLink.href;
    document.rtvVsatShipmentForm.submit();
    function handleItemLookup()
    window.open(itemLookupLink.href + "?actionToReturnTo=shipment_rtv_vsat_create&fieldToPopulateUponReturn=applyId","RSWLookupWindow");
    </script>
    <jsp:include page="/elements/top_banner2.jsp" flush="true"/>
    <!-- Beginning of Page Body -->
    <body onload="initialize();displayErrors();">
    <form:form action="shipment_rtv_vsat_to_summary.do" style="margin-top:0">
    <input type="hidden" name="fieldToPopulateUponReturn" value="applyId">
    <span style="display:none">
    <html:link styleId="itemLookupLink" href="item_lookup_start.do"></html:link>
    <html:link styleId="backLink" href="dummyLink"></html:link>
    </span>
    <html:hidden property="rtvEntriesString"/>
    <form:hidden property="fromLocationId" />
    <table width="700" class="bgColor" cellpadding="0" cellspacing="0" border="0">
    <tr>
    <td class="spacerCell">
    </td>
    </tr>
    <tr>
    <td class="leadSpacerCell" rowspan="3"></td>
    <td class="bodymd" width="125">
    <bean:message key="label.rtv_number" />:
    </td>
    <td class="bodymd">
    <bean:write name="rtvVsatShipmentForm" property="rtvNumber" />
    </td>
    <td class="bodymd">
    </td>
    <td class="bodymd">
    <bean:message key= "label.date" />: 
    </td>
    <td class="bodymd" align="left">
    <bean:write name="rtvVsatShipmentForm" property="createDate"/>
    </tr>
    <tr>
    <td class="spacerCell">
    </td>
    <td colspan="3"></td>
    <logic:equal name="dateFormatIntl" value="true">
    <td align="left" valign="top" class="bodymd">
    <span class="bodyxsm">(<bean:message key="label.date_format_string_intl"/>)</span>
    </td>
    </logic:equal>
    <logic:notEqual name="dateFormatIntl" value="true">
    <td>
    <span class="bodyxsm">(<bean:message key="label.date_format_string_us"/>)</span>
    </td>
    </logic:notEqual>
    </tr>
    <tr>
    <td class="bodymd">
    <bean:message key="label.status" />: 
    <td class="bodymd">
    <rsw:display displayElementName="rtv_status">
    <form:select property="selectedStatusCode" >
    <form:options name="rtvVsatShipmentForm" property="statusIds"
    labelProperty="statusNames" />
    </form:select>
    </rsw:display>
    <rsw:display_false displayElementName="rtv_status">
    <bean:write name="rtvNonVsatShipmentForm" property="selectedStatus.description" />
    </rsw:display_false>
    </td>
    </td>
    </tr>
    <tr>
    <td class="spacerCell">
    </td>
    </tr>
    <tr>
    <td class="leadSpacerCell"></td>
    <td class="bodymd">
    <bean:message key="label.ship_from_location" />:
    </td>
    <td class="bodymd" colspan="5">
    <bean:write name="rtvVsatShipmentForm" property="fromLocationId" />
    </td>
    </tr>
    <tr>
    <td class="spacerCell">
    </td>
    </tr>
    <tr>
    <td class="leadSpacerCell">
    <td class="bodymd">
    <bean:message key="label.supplier_name" />:
    </td>
    <td class="bodymd">
    <bean:write name="rtvVsatShipmentForm" property="supplierName" />
    </td>
    <td class="bodymd" width="125">
    <bean:message key="label.supplier_number" />: 
    </td>
    <td class="bodymd" colspan="3">
    <bean:write name="rtvVsatShipmentForm" property="supplierId" />
    </td>
    </tr>
    <tr>
    <td class="spacerCell">
    </td>
    </tr>
    <tr>
    <td class="leadSpacerCell">
    <td class="bodymd">
    <bean:message key="label.rtv_paid" />: 
    </td>
    <td class="bodymd" align="left">
    <form:select property="selectedPaymentStatusCode" >
    <form:options name="rtvVsatShipmentForm" property="paymentStatusIds"
    labelProperty="paymentStatusNames" />
    </form:select>
    </td>
    <td class="leadSpacerCell">
    </td>
    </tr>
    <%-- <tr>
    <td class="bodymd">
    <bean:message key="label.check_number" />: 
    </td>
    <td class="bodymd" align="left">
    <form:text name="rtvVsatShipmentForm" property="checkNumber" maxlength="12"/>
    </td>
    </tr>
    --%>
    </table>
    <table width="700" class="bgColor" cellpadding="0" cellspacing="0" border="0">
    <tr>
    <td class="spacerCell">
    </td>
    <tr>
    <td class="leadSpacerCell">
    </td>
    <td colspan="3">
    <table border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td class="bodymd">
    <bean:message key="label.return_authorization_no" />: 
    </td>
    <td class="bodymd" align="left">
    <form:text name="rtvVsatShipmentForm" property="returnAuth" maxlength="12"/>
    </td>
    <td class="leadSpacerCell">
    </td>
    </tr>
    </table>
    </td>
    </tr>
    <tr>
    <td class="spacerCell">
    </td>
    </tr>
    <tr>
    <td class="leadSpacerCell">
    </td>
    <td class="bodymd" valign="top">
    <bean:message key="label.supplier_address" />
    </td>
    </tr>
    <tr>
    <td class="leadSpacerCell">
    </td>
    <td colspan="6">
    <table border="0">
    <tr>
    <td width="10" rowspan="4">
    </td>
    <td class="bodymd">
    <form:text property="addressLine1" style="width:200" />
    </td>
    <td width="5">
    </td>
    <td class="bodymd">
    <bean:message key="label.city" />: 
    </td>
    <td colspan="3" class="bodymd">
    <form:text property="addressCity" style="width:200" />
    </td>
    </tr>
    <tr>
    <td class="bodymd">
    <form:text property="addressLine2" style="width:200" />
    </td>
    <td width="5">
    </td>
    <td class="bodymd">
    <bean:message key="label.state_or_province" />: 
    </td>
    <td class="bodymd">
    <form:text property="addressStateOrProvince" style="width:80" />
    </td>
    <td class="bodymd">
    <bean:message key="label.postal_code" />: 
    </td>
    <td class="bodymd">
    <form:text property="addressPostalCode" style="width:80" />
    </td>
    </tr>
    <tr>
    <td class="bodymd">
    <form:text property="addressLine3" style="width:200" />
    </td>
    <td width="5">
    </td>
    <td class="bodymd">
    <bean:message key="label.country" />: 
    </td>
    <td colspan="3" class="bodymd">
    <form:text property="addressCountry" style="width:200" />
    </td>
    </tr>
    </table>
    </td>
    <tr>
    <td class="spacerCell">
    </td>
    </tr>
    <tr>
    <td class="spacerCell">
    </td>
    </tr>
    <tr>
    <td class="leadSpacerCell">
    </td>
    <td class="bodymd" valign="top">
    <bean:message key="label.comments" />: 
    </td>
    <td>
    <form:textarea property="comments" cols="65" rows="3" onkeypress="limitKeyPress(this, 255)"/>
    </td>
    </tr>
    <tr>
    <td class="spacerCell">
    </td>
    </tr>
    <tr>
    <td colspan="3" class="horizontalLine">
    </td>
    </tr>
    <tr>
    <td class="spacerCell">
    </td>
    </tr>
    </table>
    <table width="700" cellpadding="0" cellspacing="0" border="0" class="bgColor">
    <tr>
    <td class="leadSpacerCell"></td>
    <td class="bodymdbold"><bean:message key='label.item'/>: </td>
    <td><form:text size="15" property="applyId"/>  </td>
    <td class="bodymdbold"><bean:message key='label.quantity'/>: </td>
    <td><form:text size="8" maxlength="8" property="applyQty" />  </td>
    <rsw:display displayElementName="rtv_reason">
    <td style="display:none" class="bodymdbold"><bean:message key='label.inventory_status'/>: </td>
    <td style="display:none">
    <form:select property="selectedInventoryStatus" onchange="selectFromInvStatus();">
    <form:options name="rtvVsatShipmentForm" property="inventoryStatusCodes"
    labelProperty="inventoryStatusDescriptions" />
    </form:select>
    </td>
    <td class="bodymdbold"><bean:message key='label.reason_code'/>: </td>
    <td>
    <select name="applyReasonCode">
    <%-- <logic:iterate name="rtvVsatShipmentForm" property="rtvReasons" id="reason">
    <option value="<bean:write name="reason" property="code"/>">
    <bean:write name="reason" property="description"/>
    </option>
    </logic:iterate>
    --%>
    </select>
    </td>
    </rsw:display>
    </tr>
    <tr>
    <td class="leadSpacerCell"></td>
    <td class=bodymd>
    <a class="genericLink" href="" onClick="handleItemLookup(); return false"><bean:message key='link.item'/></a>
    </td>
    </tr>
    <tr>
    <td class="leadSpacerCell"></td>
    <td colspan="9" align="left">
    <br>
    <input type="submit"
    value="<bean:message key='button.apply'/>"
    onClick="handleApply();return false;">  
    <input type="button" value="Clear" onclick="clearFields()";></td>
    </tr>
    <tr>
    <td class="spacerCell">
    </td>
    </tr>
    <tr>
    <td class="horizontalWhiteLine" colspan="10"></td>
    </tr>
    </table>
    <table class="bgColor" width="700" cellpadding="0" cellspacing="0" border="0">
    <tr>
    <td class="spacerCell">
    </td>
    </tr>
    <tr>
    <td><rsw:errors/></td>
    </tr>
    </table>
    <div id="item_list_div">
    </div>
    <table width="700" cellpadding="0" cellspacing="0" border="0" class="bgColor">
    <tr>
    <td class="spacerCell"></td>
    </tr>
    <tr>
    <td>
    <table width="700" cellpadding="0" cellspacing="0" border="0" class="bgColor">
    <tr>
    <td class="bodymdbold" align="right" nowrap><div id="total_amt_div"></div></td>
    </tr>
    </table>
    </td>
    </tr>
    <tr>
    <td class="spacerCell"></td>
    </tr>
    <tr>
    <td class="horizontalLine" colspan="3"></td>
    </tr>
    </table>
    <table cellpadding="0" cellspacing="0" border="0" width="700">
    <tr>
    <td class="spacerCell"></td>
    </tr>
    <tr>
    <td class="leadSpacerCell">
    </td>
    <td align="left">
    <input type="button" value="<bean:message key='button.next'/>"
    onclick="next();">
    <input type=button value="<bean:message key='button.back'/>"
    onclick="doBack();">
    <input type=button value="<bean:message key='button.cancel'/>"
    onclick="doSubmit('main', 'main.do');">
    </td>
    </tr>
    </table>
    </form:form>
    <div id="log"></div>
    </body>
    <!-- End of Page Body -->
    <jsp:include page="/elements/bottom_banner2.jsp" flush="true"/>
    <script language="JavaScript" type="text/javascript">
    function handleAction(retVal,position)
    if (retVal != null)
    var command = retVal["command"];
    if (command == "OK")
    updateArray(retVal["id"],
    formatQuantityFromVar(retVal["qty"]), true,
    <rsw:display displayElementName="rtv_reason">
    retVal["inventoryStatusCode"],
    retVal["inventoryStatusName"],
    retVal["reasonCode"],
    retVal["reasonDescription"],
    </rsw:display>
    <rsw:display_false displayElementName="rtv_reason">
    null, null, null, null,
    </rsw:display_false>
    position);
    totalAmounts();
    if (command == "Remove")
    deleteRow(position);
    writeTable(false);
    totalAmounts();
    function showEditWindow(sku, qty,
    <rsw:display displayElementName="rtv_reason">
    inventoryStatusCode, reasonCode,
    </rsw:display>
    position)
    if(!acquireFakeLock()) return;
    var elements = editWindowDiv.document.all;
    elements("editWindowId").value=sku;
    elements("editWindowQty").value = qty;
    <rsw:display displayElementName="rtv_reason">
    elements("editWindowInventoryStatusCode").value = inventoryStatusCode;
    elements("hiddenReasonCode").value = reasonCode;
    </rsw:display>
    var retVal;
    // if (IE6)
    retVal = window.showModalDialog("popup.jsp", editWindowDiv,
    "dialogWidth:335px;dialogHeight:230px;scroll:no;status:no;unadorned:no");
    else
    retVal = window.showModalDialog("javascript:document.write(window.dialogArguments.innerHTML);editWindowInit();",editWindowDiv,
    "dialogWidth:335px;dialogHeight:230px;scroll:no;status:no;unadorned:no");
    handleAction(retVal,position);
         releaseFakeLock();
    function updateArray(itemNumber, itemQty, fromEditWindow,
    inventoryStatusCode, inventoryStatusName,
    reasonCodeId, reasonCodeName, position, supplierCost)
    if (((rtvEntryArray[position].reasonCodeId != reasonCodeId)
    && arrayContainsItem(itemNumber, reasonCodeId))
         ||
         ((rtvEntryArray[position].itemNumber != itemNumber)
         && arrayContainsItemsExceptPos(itemNumber, reasonCodeId, position)))
    deleteRow(position);
    setItemQtyReasonArray(itemNumber, itemQty, reasonCodeId, reasonCodeName, supplierCost);
    else
    var rtvEntry = new Object();
    rtvEntry.itemNumber = itemNumber;
    rtvEntry.itemQty = itemQty;
    rtvEntry.inventoryStatusCode = inventoryStatusCode;
    rtvEntry.inventoryStatusName = inventoryStatusName;
    rtvEntry.reasonCodeId = reasonCodeId;
    rtvEntry.reasonCodeName = reasonCodeName;
    rtvEntry.supplierCost = supplierCost;
    rtvEntry.valid = rtvEntryArray[position].valid;
    rtvEntryArray[position] = rtvEntry;
    writeTable();
    </script>
    <div id="editWindowDiv" style="display:none">
    <html>
    <head>
    <style type="text/css">
    .titleTxt { font-size: 12 ; font-style: italic ; font-weight: bold; color: white ; font-family: arial }
    .bodymd {color: #000000; font-family: arial; font-size: 10pt; text-decoration: none}
    .bodymdbold {color: #000000; font-family: arial; font-size: 10pt; text-decoration: none; font-weight: bold}
    .bgColor { background-color: #efefef }
    </style>
    <title><bean:message key="title.edit_window" /></title>
    <script language="JavaScript">
    function handleOk()
    if (checkQuantityGreaterThenZero(document.editPopupForm.editWindowQty))
    var returnArray = new Array();
    returnArray["id"] = document.editPopupForm.editWindowId.value;
    returnArray["qty"] = document.editPopupForm.editWindowQty.value;
    <rsw:display displayElementName="rtv_reason">
    returnArray["inventoryStatusCode"] = document.editPopupForm.editWindowInventoryStatusCode.options[document.editPopupForm.editWindowInventoryStatusCode.selectedIndex].value;
    returnArray["inventoryStatusName"] = document.editPopupForm.editWindowInventoryStatusCode.options[document.editPopupForm.editWindowInventoryStatusCode.selectedIndex].text;
    returnArray["reasonCode"] = document.editPopupForm.editWindowReasonCode.options[document.editPopupForm.editWindowReasonCode.selectedIndex].value;
    returnArray["reasonDescription"] = document.editPopupForm.editWindowReasonCode.options[document.editPopupForm.editWindowReasonCode.selectedIndex].text;
    </rsw:display>
    returnArray["command"] = "OK";
    window.returnValue = returnArray;
    window.close();
    function handleCancel()
    window.close();
    function handleRemove()
    var returnArray = new Array();
    returnArray["command"] = "Remove";
    window.returnValue = returnArray;
    window.close();
    function init()
    document.title = "<bean:message key="title.edit_window" />";
    document.editPopupForm.editWindowQty.focus();
    <rsw:display displayElementName="rtv_reason">
    createReasonOptionObjects();
    setReasonOptions();
    document.editPopupForm.editWindowReasonCode.value = document.editPopupForm.hiddenReasonCode.value;
    </rsw:display>
    <rsw:display displayElementName="rtv_reason">
    function setReasonOptions()
    var currentOptions;
    document.editPopupForm.editWindowReasonCode.options.length = 0;
    if (document.editPopupForm.editWindowInventoryStatusCode.value == "AVAILABLE")
    currentOptions = availableOptions;
    else
    currentOptions = unavailableOptions;
    for (var i = 0; i < currentOptions.length; i++)
    document.editPopupForm.editWindowReasonCode.options.add(currentOptions[i]);
    </rsw:display>
    var availableOptions = new Array();
    var unavailableOptions = new Array();
    <rsw:display displayElementName="rtv_reason">
    function createReasonOptionObjects()
    var oOption;
    <logic:iterate name="rtvVsatShipmentForm" property="availableInventoryStatusReasons" id="reason">
    oOption = document.createElement("OPTION");
    oOption.value = "<bean:write name="reason" property="code"/>";
    oOption.text = "<bean:write name="reason" property="description"/>";
    availableOptions[availableOptions.length] = oOption;
    </logic:iterate>
    <logic:iterate name="rtvVsatShipmentForm" property="unavailableInventoryStatusReasons" id="reason">
    oOption = document.createElement("OPTION");
    oOption.value = "<bean:write name="reason" property="code"/>";
    oOption.text = "<bean:write name="reason" property="description"/>";
    unavailableOptions[unavailableOptions.length] = oOption;
    </logic:iterate>
    </rsw:display>
    </script>
    <%@ include file="rsw_functions.jsp" %>
    </head>
    <body leftmargin="0" topmargin="0" style="border:4px ridge lightgrey">
    <span style="margin-top:0;margin-left:0,margin-bottom:0;margin-right:0">
    <table cellspacing="0" cellpadding="0" border="0" bordercolor="#000000" width="330">
    <tr>
    <td bgcolor="#ff9999" width="100%" height="1" colspan="2"></td>
    </tr>
    <tr>
    <td bgcolor="#ff0000" height="15" align="left"><span
    class=titleTxt>  <bean:message key="label.edit" /> </span></td>
    <td bgcolor="#ff0000" height="15" align="right"><span
    class="titleTxt"><bean:message key="label.application_title" />   </span></td>
    </tr>
    <tr>
    <td bgcolor="#000000" width="100%" height="1" colspan="2"></td>
    </tr>
    </table>
    </span>
    <form name="editPopupForm" style="margin-top:0;margin-left:0,margin-bottom:0;margin-right:0"
    onsubmit="handleOk();return false;">
    <input type="hidden" name="editWindowPosition" value="">
    <input type="hidden" name="hiddenReasonCode" value="">
    <table cellspacing='0' class='bgColor' cellpadding='0' border='0' width='330'>
    <tr><td> </td></tr>
    <tr>
    <td class='bodymd'>  <bean:message key='label.item'/>:</td>
    <td class='bodymd'><input type="text" name="editWindowId" value="[id]" ></td>
    </tr>
    <tr>
    <!--Start RQST 34502 SIR 61007-->
    <!--td class='bodymd'--><!--  --><!--bean:message key='label.count_quantity'/--><!--:--><!--/td-->
    <td class='bodymd'>  <bean:message key='label.return_quantity'/>:</td>
    <!--End RQST 34502 SIR 61007-->
    <td class='bodymd'><input type="text" maxlength="8" name="editWindowQty" value="[qty]"></td>
    </tr>
    <rsw:display displayElementName="rtv_reason">
    <tr>
    <td style="display:none" class='bodymd'>  <bean:message key='label.inventory_status'/>:</td>
    <td style="display:none" class='bodymd'><select name="editWindowInventoryStatusCode" onchange="setReasonOptions();">
    <option value="AVAILABLE"><bean:message key="label.available"/></option>
    <option value="UNAVAILABLE"><bean:message key="label.unavailable"/></option>
    </select></td>
    </tr>
    <tr>
    <td class='bodymd'>  <bean:message key='label.reason_code'/>:</td>
    <td class='bodymd'><select name="editWindowReasonCode">
    <logic:iterate name="rtvVsatShipmentForm" property="rtvReasons" id="editWindowReason">
    <option value="<bean:write name="editWindowReason" property="code"/>">
    <bean:write name="editWindowReason"

    God Lord! Does anyone else here write JSPs that look like that?
    If I had to maintain that I would shoot myself straight in the temple.
    Sorry, I don't have answer to your question, I just had to say that.
    Do you like your job?

  • How can I send email from an JSP page  with HTML format either using jsp

    hi,
    I have an jsp page with online application form,after compleating the form if i select submit it will send all the compleated data to the mail id we mentioned in the form tag,for this i am using javascript,but instead of receiving the data in the format of strings,my client want to receive the data in the same format as he's filling in the jsp page(html format) through e-mail.any help would be appreciated.the fallowing is the code right now i am using for email application.
    <code>
    function send()
    if(validatePersonalInfo(document.theform))
         document.theform.submit()
         location.href=location.reload()
    function validatePersonalInfo(form)
         var tmpStr ="";
         if (form.Name.value == "") {
              tmpStr = "Name";
              document.all.dName.style.visibility="visible";
              document.theform.Name.focus();
         else{
              document.all.dName.style.visibility="hidden";
         if (form.SSN.value == "") {
              tmpStr = tmpStr + ", Social Security Number";
         document.all.dSSN.style.visibility="visible";
         if(form.Name.value != "")
              {document.theform.SSN.focus();}
         else{
              document.all.dSSN.style.visibility="hidden";
    if (tmpStr == "") {
              return true;
         } else {
              alert("Please Fill the Following Fields: " + tmpStr);
              return false;
    <FORM NAME="theform" METHOD="post"
    ACTION="mailto:[email protected]?subject=Online Application Form for MinorityDealer." ENCTYPE="text/plain">
    <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="10" NOF="LY">
    <TH>
    <P>
         <FONT SIZE="3" FACE="Arial,Helvetica,Univers,Zurich BT">Online�Application</font></TH><BR>
    </TABLE>
    <table width="718" border="1" cellspacing="0" cellpadding="3" bgcolor="#CCCCFF" align="center">
         <tr>
    <td colspan="2"><font class="captionText">Name*�</font><br><input type="text" size="25" name="Name" class="bodyText">
    <div id="dName" name="dName" style="position:absolute;visibility:hidden"><font color="red">Name is Mandatory*</font></div>
    </td>
              <td colspan="2"><font class="captionText">Social Security Number*�</font><br><input type="text" size="9" name="SSN" class="bodyText">
              <div id="dSSN" name="dSSN" style="position:absolute;visibility:hidden"><font color="red">SSN is Mandatory*</font></div></td>
    </tr>
    <tr>
    <td colspan="2"><font class="captionText">Total Personal Assets</font><br><input type="text" size="10" name="TotPersAss3" class="bodyText"></td>
              <td colspan="2"><font class="captionText">Total Personal Liabilities & NetWorth</font><br><input type="text" size="10" name="TotPerLiab3" class="bodyText"></td>
    </tr>
         </tr>
    </TABLE>
    <IMG Valign="middle" name="imgSubmit" src="images/buttons/Submit.gif" width="66" height="29" border="0" alt="Submit">
    </code>

    Can any one do some help to solve this problem.
    Regards.

  • Applet Focus in JSP.

    I have an applet embeded in a JSP page. In this applet I have some text feilds for data entry. After the each data entry this field get validated . If the entered data is wrong then it popup a message using the JOptionPane.
    Now the problem. :- after message, I want to set back the focus to the respective fields. I had used setfocus(), grabfocus() etc..But nothing get worked.. Please advice ... tanx in advance...........
    Rgds
    Joe

    Did you try requestFocus()? There is no setFocus().
    Although grabFocus() is supposed to do the same thing, I've never used it, probably part of that switch from AWT to Swing some 8 years ago.

  • How do I get the URL of a jsp page?

    I have a jsp page which has a link to a servlet page, in the servlet page, I want to get the URL of the jsp page.
    I tried to use request.getHeader("referer"), it seems like if it is a link in the jsp directly lead to the servlet, it works, but if the link calls a javascript function which opens up a window runing the servlet, it is not working. I have to do the second way, so it is not working by doing request.getHeader("referer")
    I tried to use javascript "location.href", I get the whole url by alerting the url in the jsp page:
    http://localhost:8080/pos-webapp/serv/qt_old?currentpage=portal&bcd=ABC123&pnm=P1001830&prnm=1&psd=236863.0&ln=01&sln=NYPPA&stp=2.1&stt=A&_POSID=1F8464122ADAF4EEC9B1A94C286EB252
    then I pass this url when calling with my servlet, in the servlet page, when I do request.getParameter("url"), the url is actually cut off like this:
    http://localhost:8080/pos-webapp/serv/qt_old?currentpage=portal
    anything after &pnm is cut off, anyone has any idea?
    Thanks in advance.

    Thank you.
    but how do I put encoding in the javascript code? do I need to decode in my servlet page?
    here is my code in the jsp page:
    linkset[3]+='<div class="menuitems">Email Diagnostics to AutoOne</div>'<%     
    function emailDiagnostics()
    win = window.open("/pos-webapp/serv/email_diagnostics?url=" + location.href + "&browser=" + navigator.appName, "emailDiagnostics",
    "width=350, height=140, resizable=no, scrollbars=no, toolbar=no, location=yes, directories=no, status=no, menubar=no, copyhistory=no, left=450, top=300");
    win.focus();
    }

  • How update the info on same Jsp page

    i have a Jsp page.on left side of this page having menu bar. in this menu bar having links of some colleges.
    i want when i click on link of first college name, same page should be updaed with updated menu bar where i can show the information of the concerning college.
    please focus on this.

    I have two Jsp pages named bestschool.jsp and schoolnames.jsp.
    I am calling schoolnames.jsp from bestschool.jsp.
    I want when I click the link on INDUS School. It can show all concerning link of INDUS School links like profile, result, facility etc. in the same place instead of other naming school links.
    my requiremet main is i want to update the information on same Jsp page.
    How can I implement this with in Servlets/Jsp.
    Please review below JSP’s files
    schoolnames.jsp
    <table width="200" border="0" align="center" cellpadding="5">
    <tr>
    <td height="100" bgcolor="#476bc0">
    <div align="center" class="boldhead"><font size="+1">
    School list</font></div>
    </td>
    <tr>
    <td height="30" bgcolor="#5577C6">
    <a href="" class="smalltext">INDUS School</a></td>
    </tr>
    <tr>
    <td height="30" bgcolor="#728DCF">
    <a href="" class="smalltext">Vaise School</a>
    </td>
    </tr>
    <tr>
    <td height="30" bgcolor="#728DCF">
    <a href="" class="smalltext">D.G.V School</a></td>
    </tr>
    <tr>
    <td height="30" bgcolor="#728DCF">
    <a href="" class="smalltext">D.P.S School </a></td>
    </tr>bestschool.jsp
    <html>
    <head>
    <title>Best school</title>
    <link href="mystyle.css" rel"stylesheet" type="text/css">
    </head>
    <body>
    <div align="center"><font size="+2">
    Best Schools in Rohtak</font>
    </div>
    <table width="700" height="500" border="0" align="left"
    cellspacing="0">
    <td width="200" rowspan="2" valign="top">
    <%@ include file="schoolnames.jsp" %>
    </td>
    <td height="328" bgcolor="#476BC0" valign="top">
    <p> </p><p> </p><p> </p>
    </html>please suggest.

  • Passing values to the JSP page - Urgent

    Hi all,
    I have to pass the user id value to the JSP page. I have written the following code in the doInitialization() method
    IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
    IPortalComponentContext myContext = request.getComponentContext();
    IPortalComponentProfile myProfile = myContext.getProfile();
    IAuthentication ia = UMFactory.getAuthenticator();
    IUser portalUser = ia.getLoggedInUser(request.getServletRequest(), request.getServletResponse(false) );
    s = portalUser.getUniqueName();
    IPortalComponentSession componentSession = ((IPortalComponentRequest)getRequest()).getComponentSession();
    Object o = componentSession.getValue("myEvents");
    myEvents = (LoadEvents)o;
    //myEvents = (LoadEvents) myContext.getValue("myEvents");
    myEvents.setUserId(s);
    myContext.putValue("myBeanName", myEvents);
    I have also defined myEvents as a bean in my JSP page with scope APPLICATION. But I get User Id as "NULL".
    Thanks in advance.
    Rgds,
    Janvi.

    Hi Prakash,
    Please find the jsp code pasted below:
    <hbj:content
        id="myContext">
        <hbj:page
            title="Successful processing">
    <jsp:useBean id="myMeet" scope="application" class="com.sap.ep.bluestar.LoadEvents" />
    <jsp:useBean id="myEvents" class="com.sap.ep.bluestar.MonthView" scope="application" />
    <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" %>
    <%
    int leadSpaces, daysInMonth, leadSpaces_next,daysInMonth_next, col_Counter;
    myCal.setMonthView();
    java.util.Vector printVal_pre = new java.util.Vector();
    myCal.printMonth(myCal.getPre_month(),myCal.getPre_year());
    printVal_pre = myCal.getPrintValues();
    java.util.Vector printVal_cur = new java.util.Vector();
    myCal.printMonth(myCal.getCur_month(),myCal.getCur_year());
    printVal_cur = myCal.getPrintValues();
    java.util.Vector printVal_next = new java.util.Vector();
    myCal.printMonth(myCal.getNext_month(),myCal.getNext_year());
    printVal_next = myCal.getPrintValues();
    if(request.getMethod().equals("POST")){
         try {
              String action =(String) request.getParameter("action");
              if(action.equals("insert")){
              //     response.sendRedirect("_insertEvent.jsp");
                   //response.sendRedirect("test.html");
         } catch(Exception e) {
              System.out.println(e.getMessage());
    %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    <script language="javascript">
         function insertEvent(frm,eventDay){
              alert("here finally " + eventDay + " " + frm.eventMonth.value + "  " + frm.eventYear.value );
              frm.action.value = "insert";
              frm.submit();
         function openWin(frm,eventDay)
           var newWin = window.open("http://localhost:50100/irj/servlet/prt/portal/prtroot/Web_Calendar.eventHandler?variable=" + frm.eventMonth.value +  "/" + eventDay + "/" + frm.eventYear.value, 'popup',
         'resizable,height=200,width=325');
           if(newWin.focus) newWin.focus();
    </script>
    </head>
    <body>
    User is : <%= myCal.getUserId() %>
    <table width="745" height="583" border="0">
      <tr>
        <td width="258" height="23" align="center"><B> <% out.println(printVal_pre.elementAt(0).toString() + "  " + printVal_pre.elementAt(1).toString());
    leadSpaces = ((Integer)printVal_pre.elementAt(2)).intValue();
         daysInMonth = ((Integer)printVal_pre.elementAt(3)).intValue();
         %> </B> </td>
        <td width="215"> </td>
        <td width="258" align="center"><B> <% out.println(printVal_next.elementAt(0).toString() + "  " + printVal_next.elementAt(1).toString());
        leadSpaces_next = ((Integer)printVal_next.elementAt(2)).intValue();
        daysInMonth_next = ((Integer)printVal_next.elementAt(3)).intValue();
         %> </B></td>
      </tr>
      <tr>
        <td height="151"><table width="245" border="1">
          <tr>
            <th width="35" scope="col"><div align="center">S</div></th>
            <th width="35" scope="col"><div align="center">M</div></th>
            <th width="35" scope="col"><div align="center">T</div></th>
            <th width="35" scope="col"><div align="center">W</div></th>
            <th width="35" scope="col"><div align="center">T</div></th>
            <th width="35" scope="col"><div align="center">F</div></th>
            <th width="35" scope="col"><div align="center">S</div></th>
          </tr><tr>
         <% col_Counter = 0;
              for (int i = 0; i < leadSpaces; i++) {
                   out.print("<td> </td>");
                   col_Counter++;
              for (int i = 1; i <= daysInMonth; i++) {
                   // This "if" statement is simpler than messing with NumberFormat
                   if(i < 9) {
                        out.print("<td align='center'>" + " " + i + "</td>");
                        col_Counter++;
                   } else {
                        out.print("<td align='center'>" + i + "</td>");
                        col_Counter++;
                   if ((leadSpaces + i) % 7 == 0) { // Wrap if EOL
                        out.println("</tr><tr>");
              int cnt = col_Counter;
              if(col_Counter == 28){
                   out.println("</tr>");
              }else {
                   for(int i = 0; i < (42 - col_Counter);i++){
                        out.print("<td> </td>");
                        cnt++;
                        if((cnt%7) ==0)
                             out.println("</tr><tr>");
                   out.println("</tr>");
         %>
        </table></td>
        <td> </td>
        <td><table width="245" border="1">
          <tr>
            <th width="35" scope="col"><div align="center">S</div></th>
            <th width="35" scope="col"><div align="center">M</div></th>
            <th width="35" scope="col"><div align="center">T</div></th>
            <th width="35" scope="col"><div align="center">W</div></th>
            <th width="35" scope="col"><div align="center">T</div></th>
            <th width="35" scope="col"><div align="center">F</div></th>
            <th width="35" scope="col"><div align="center">S</div></th>
          </tr>
          <tr>
           <% col_Counter = 0;
              for (int i = 0; i < leadSpaces_next; i++) {
                   out.print("<td> </td>");
                   col_Counter++;
              for (int i = 1; i <= daysInMonth_next; i++) {
                   // This "if" statement is simpler than messing with NumberFormat
                   if(i < 9) {
                        out.print("<td align='center'>" + " " + i + "</td>");
                        col_Counter++;
                   } else {
                        out.print("<td align='center'>" + i + "</td>");
                        col_Counter++;
                   if ((leadSpaces_next + i) % 7 == 0) { // Wrap if EOL
                        out.println("</tr><tr>");
              cnt = col_Counter;
              if(col_Counter == 28){
                   out.println("</tr>");
              }else {
                   for(int i = 0; i < (42 - col_Counter);i++){
                        out.print("<td> </td>");
                        cnt++;
                        if((cnt % 7 ) ==0)
                        out.println("</tr><tr>");
                   out.println("</tr>");
         %>
        </table></td>
      </tr>
      <tr>
        <td colspan="3"><table width="735" height="383" border="1">
          <tr>
          <td colspan="7" align="center"><B> <% out.println(printVal_cur.elementAt(0).toString() + "  " + printVal_cur.elementAt(1).toString());
        leadSpaces = ((Integer)printVal_cur.elementAt(2)).intValue();
        daysInMonth = ((Integer)printVal_cur.elementAt(3)).intValue();
         %> </B></td>
          </tr>
          <tr>
            <th width="105" scope="col">SUN</th>
            <th width="105" scope="col">MON</th>
            <th width="105" scope="col">TUE</th>
            <th width="105" scope="col">WED</th>
            <th width="105" scope="col">THUR</th>
            <th width="105" scope="col">FRI</th>
            <th width="105" scope="col">SAT</th>
          </tr>
          <form name="eventCal" method="post" action="Web_Cal.jsp">
          <input name="eventMonth" type="hidden" value="<%= myCal.getCur_month() + 1 %>">
           <input name="eventYear" type="hidden" value="<%=myCal.getCur_year() %>">
          <input name="action" type="hidden" value="">
          <tr>
            <% col_Counter = 0;
              for (int i = 0; i < leadSpaces; i++) {
                   out.print("<td> </td>");
                   col_Counter++;
              for (int i = 1; i <= daysInMonth; i++) {
                   // This "if" statement is simpler than messing with NumberFormat
                   if(i < 9) {
                        out.print("<td align='center'>" + " " + "<a href='javascript:openWin(document.eventCal," + i + ");'>" + i + "</a></td>");
                        col_Counter++;
                   } else {
                        out.print("<td align='center'>" + "<a href='javascript:openWin(document.eventCal," + i + ");'>" + i + "</a></td>");
                        col_Counter++;
                   if ((leadSpaces + i) % 7 == 0) { // Wrap if EOL
                        out.println("</tr><tr>");
              if(col_Counter == 28){
                   out.println("</tr>");
              }else if(col_Counter < 35){     
                   for(int i = 0; i < (35 - col_Counter);i++)
                        out.print("<td> </td>");
                   out.println("</tr>");
              }else {
                   for(int i = 0; i < (42 - col_Counter);i++)
                        out.print("<td> </td>");
                   out.println("</tr>");
         %> </form>
        </table></td>
      </tr>
    </table>
    </body>
    </html>
    </hbj:textView>
        </hbj:page>
    </hbj:content>
    Regards,
    Janvi

  • An access control proxy in front of my JSP pages

    Hi All,
    I want to protect the access to my jsp pages. If for example the user types in his browser www.abc.com/page1.jsp, I want to capture that request and pass it to an access control engine. If the user is authorized then he should get that page if not he should be directed to another page.
    any answers will be appreciated ... I'm using tomcat 5.5.

    For example the user types in his browser www.abc.com/page1.jsp, I want to capture that request and pass it to an access control engine. If the user is authorized then he should get that page if not he should be directed to another page.
    Focus a bit on your design: Ask yourself how will the whole world accessing the page can be identified?
    It is via machine to machine authentication and handshake or user authentication and authorisation?
    Machine to machine will happen on a VPN infrastracture where specified connections are directed to a host port else the other, or user authentication and authorisation where user login to determine which bit of yourr page he has access to, then using MVC framework you can say hang-on! base on your credential you're authorised to use this page instead.
    Note if no one is identifying him/herself on your system before having access to the required resource then your design aim sounds excuse me to say abit difficult to achieve. Again from the look at things you're trying to achieve this using acccess router, please if that is the case then think otherwise because it is not possible,
    Edited by: bidox on Mar 29, 2008 9:25 AM

  • When a jsp page opened

    Hello everybody,
    I have a jsp page that includes personal_no and code areas. I want the mouse on personal_no item when this page is opened.
    Does any one have any idea?
    Thanks

    I dunno if I can get much more detailed than I did originally.
    the onLoad attribute runs when the form loads (duh!)
    <body onLoad="loadForm()">
    basically says that when the page loads, it should call the javascript function loadForm().
    The javascript function I defined was also fairly simple:
    <script language='javascript'>
    <!-- 
    function loadForm(){   
      document.forms[0].personal_no.focus(); 
    //-->
    </script>This is the javascript function loadForm and should be included in the <head> of you html/jsp page (whatever you are writing)
    It might need a little modification on your part - I was guessing as to the field name.
    the standard format is document.formName.controlName.focus
    where
    - formName is the name of your form
    - controlName is the name of your control (input type='text')
    If you had
    <form name="myForm">
    <input type="text" name="personal_no">
    </form>then the code could be
    "document.myForm.personal_no.focus()"
    This should put the cursor in the textfield personal_no on the form, so you can start typing without clicking in the field.
    If you are using IE, check the little icon in the lower left of the window. If it has a yellow exclamation mark, double click it to see what the javascript error is.
    jeez, thats a lot of explaining. Whether it clears things up, or just makes things more complicated, I dunno.
    But please try for more than 2 minutes before posting for help again :-)

  • Is any free tool bar for jsp page?

    hi,
    I am having web pages.
    so I am entering some data in text area.
    how to select the font ,size,colors in jsp page.
    i want features like word in jsp page.
    is it any free software available to change font,color of text.
    Thanks
    siva

    and here is the js script for textEditorContent.js ...
    function boldThis(from)
        strSelection = document.selection.createRange().text
        if (strSelection == "")
            document.form1.text.focus()
            if (from == 2) document.form1.text.select()
                strSelection = document.selection.createRange().text
            document.selection.createRange().text = strSelection + "<b></b>"
        else
            document.selection.createRange().text = "<b>" + strSelection + "</b>"
        return;
    function underlineThis(from)
        strSelection = document.selection.createRange().text
        if (strSelection == "")
            document.form1.text.focus()
            if (from == 2) document.form1.text.select()
                strSelection = document.selection.createRange().text
            document.selection.createRange().text = strSelection + "<u></u>"
        else
            document.selection.createRange().text = "<u>" + strSelection + "</u>"
        return;
    function italicThis(from)
        strSelection = document.selection.createRange().text
        if (strSelection == "")
            document.form1.text.focus()
            if (from == 2) document.form1.text.select()
                strSelection = document.selection.createRange().text
            document.selection.createRange().text = strSelection + "<i></i>"
        else
            document.selection.createRange().text = "<i>" + strSelection + "</i>"
        return;
    function fontThis(from)
        var ind=document.form1.fontnames.selectedIndex;
        newfont=document.form1.fontnames[ind].value;
        strSelection = document.selection.createRange().text
        if (strSelection == "")
            document.form1.text.focus()
            if (from == 2) document.form1.text.select()
                strSelection = document.selection.createRange().text
            document.selection.createRange().text = strSelection + "<font face='"+newfont+"'></font>"
        else
            document.selection.createRange().text = "<font face='"+newfont+"'>" + strSelection + "</font>"
        return;
    function sizeThis(from)
        var ind=document.form1.fontsizes.selectedIndex;
        newsize=document.form1.fontsizes[ind].value;
        strSelection = document.selection.createRange().text
        if (strSelection == "")
            document.form1.text.focus()
            if (from == 2) document.form1.text.select()
                strSelection = document.selection.createRange().text
            document.selection.createRange().text = strSelection + "<font size='"+newsize+"'></font>"
        else
            document.selection.createRange().text = "<font size='"+newsize+"'>" + strSelection + "</font>"
        return;
    function colorThis(from)
        var ind=document.form1.colors.selectedIndex;
        newcolor=document.form1.colors[ind].value;
        strSelection = document.selection.createRange().text
        if (strSelection == "")
            document.form1.text.focus()
            if (from == 2) document.form1.text.select()
                strSelection = document.selection.createRange().text
            document.selection.createRange().text = strSelection + "<font color='"+newcolor+"'></font>"
        else
            document.selection.createRange().text = "<font color='"+newcolor+"'>" + strSelection + "</font>"
        return;
    function newlineThis()
        strSelection = document.selection.createRange().text
        if (strSelection == "")
            document.form1.text.focus()
        document.selection.createRange().text = strSelection + "<br>";
        return;
    function insertPic()
        var ind=document.form1.pictures.selectedIndex;
        if(ind==0)
            alert(msg15)
            return false;
        newpic=document.form1.pictures[ind].value;
        strSelection = document.selection.createRange().text
        if (strSelection == "")
            document.form1.text.focus();
        document.selection.createRange().text = strSelection +"<img border=0 src='"+newpic+"'>";
        return;
    function ahrefThis()
        strSelection = document.selection.createRange().text
        if (strSelection == "")
            document.form1.text.focus()
        document.selection.createRange().text = "<a href='" + document.form1.hyperlinknm.value + "' target='_blank'>" + strSelection + "</a>"
        return;
    function textview()
        popupWindow5=open("EDETAIL_Text_View.jsp",'Windown','scrollbars=YES,resizable=YES,left=10,top=20,toolbar=no,width=1000,height=600');
        if (popupWindow5.opener == null)
            popupWindow5.opener = self;
        popupWindow5.focus();
    function callSave(size, module, msg)
        if(!checkMaxLength(document.form1.text,size,msg))
            return;
        if(isBlank(document.form1.text.value))
            alert(module+" "+msg11);
            document.form1.text.focus();
            document.form1.text.select();
            return false;
        if(module=='Question')
            var tempstr ="";
            var count = document.form1.rowCount.value;
            var ind = document.form1.anstype.selectedIndex;
            for (i=0; i<count; i++)
                if(count==1)
                    if(ind>0)  // RADIO or CHECKBOX or DROPDOWN
                        tempstr = document.form1.answerDesc.value;
                    if(ind==1) // RADIO BUTTON
                        if(!checkMaxLength(document.form1.answerDesc,500,"Answer Option"))
                            return;
                        if(!checkMaxLength(document.form1.feedbackDesc,500,"Answer Option"))
                            return;
                else
                    if(ind>0)  // RADIO or CHECKBOX or DROPDOWN
                        tempstr = document.form1.answerDesc.value;
    if(ind==1) // RADIO BUTTON
    if(!checkMaxLength(document.form1.answerDesc[i],500,"Answer Option"))
    return;
    if(!checkMaxLength(document.form1.feedbackDesc[i],500,"Answer Option"))
    return;
    if(ind>0)
    if(isBlank(tempstr) )
    alert(msg12);
    if(count==1)
    document.form1.answerDesc.focus();
    document.form1.answerDesc.select();
    else
    document.form1.answerDesc[i].focus();
    document.form1.answerDesc[i].select();
    return false;
    for (j=i+1; j<count; j++)
    if(document.form1.answerDesc[i].value==document.form1.answerDesc[j].value)
    alert(msg13);
    document.form1.answerDesc[j].focus();
    document.form1.answerDesc[j].select();
    return false;
    document.form1.submit();
    This function is used to go back to previous screen
    function goBack()
    if(window.confirm(msg14))
    if(document.form1.From.value=="Page")
    document.form1.action="EDETAIL_Add_Page_Content.jsp";
    else
    document.form1.action="EDETAIL_Upload_Text_Editor.jsp";
    document.form1.submit();
    By the way didnt this forum itself give you a big hint on Bold, Itallic & underline ?

  • How to get context sensitive help  in JSP Pages

    Is it possible to display context sensitive help in JSP Pages when I press the tab key on the keyboard base on the key focus. I don�t want to use any applet or Swing components, because it�s a web page viewed on the browser
    Thanks

    Java code inside a JSP is interpreted on the server and the HTML produced by the server it is shown in the client browser. The JSP code can incorporate calls to the JavaHelp API if it is available to the server. Those calls can be used on the server side to map parts of the JSP to contents of a help set (HTML pages).
    Given that, you can provide context sensitive help, but when it comes to view help information, you either can show HTML only (without TOC, index, etc.) or you'd need an applet.
    Ulrich

  • Unable to manage JSF tabSet in frame(jsp page)

    i am using frameset in jsp page and in top frame i m placing the jsp file which contains the JSF tabSet with 4 tabs and i have set the url proerty and target ='bottom" i.e the name of lower frame
    i am able to navigate the pages in lower frame but not able to keep focus for selected tab.

    Hi,
    You could try using page fragment instead of frames.
    There is a relevant topic on EA discussion.
    Topic :TabSet navigation on a page fragment
    https://feedbackprograms.sun.com/project/forum/thread.html?cap={3F4DA363-16D3-4D4C-920C-992ECB054B6D}&forid={CC6B8562-F896-4A44-ACB6-4684BDD05E19}&topid={DFA961CF-157A-4E7C-9BBC-FDB69D982E9E}
    Hope this helps.
    Thanks,
    RK.

  • How to use single JSP page for multiple users.

    Hi ,
    I am doing messenger kind of program using JSP and tomcat server.
    When i type message it is showing in the some div. If some other person request for the same page by giving my IP address and jsp page, he should able to see what i have typed on page so far.
    how can i do that one . can any one guide me .
    Thanks in advance.

    SuneelGoodatJava wrote:
    Hi ,
    I am doing messenger kind of program using JSP and tomcat server.
    When i type message it is showing in the some div. If some other person request for the same page by giving my IP address and jsp page, he should able to see what i have typed on page so far.
    how can i do that one . can any one guide me .
    Thanks in advance.HTTP is a request/response protocol. You can't do what you're suggesting without "pushing" what you type to all the other users. That's not the way HTTP works. Maybe an applet and servlet.
    %

Maybe you are looking for

  • Java.util.concurrent.ConcurrentHashMap

    All, I prefer to use the java.util.ConcurrentHashMap over a Hashtable but there are some points regarding this structure that are not very clear to me. From java.util.concurrent: Class ConcurrentHashMap: "A hash table supporting full concurrency of r

  • HT1414 how can I access my contacts from my iphone backup

    I backed up my iphone onto my imac. How can I access the contacts, or can I?

  • Question re: Bootable backup disc / preparing for Leopard Install

    Hello, I've an iMac G5 : Model: The one right before an isight camera was added CPU Type: PowerPC G5 (3.1), CPU Speed: 2 GHz, L2 Cache: 512 KB, Memory: 1.5 GB I'm trying to figure out if I can make a bootable backup of my Tiger OS before installing L

  • Adobe Illustrator 10.0.3 .

    I have Adobe Illustrator 10.0.3. Recently, it would not open. I get this error message: "Could not complete your request because of missing or invalid personalization information".

  • Can't Restore BBM Contacts Using E-Mail

    Hello, I hope someone is able to help me with this. What I'm basically trying to do is do a restore of my BBM contacts through an email address since my last device bricked, but everytime i try to do that it tells me that my gmail is not a registered