Excel MySQL - To set the action attribute in a  form

Hi All
I am working on an application that requires to read data from Excel and update the table in MySQL. My java code works well and does the required. For the user to select an excel file, i have designed a form using JSP. This JSP form gets loaded through Tomcat..When the user browses and selects the required file, he then will click on the update button and the java code then should be executed.
How can i set the action attribute in form tag to execute java code.
Following is my code.
<%@page
language="java"
import="javax.servlet.*,javax.servlet.http.*,java.io.*,java.util.*,java.sql.*"
info="BulkUpdate"
session="true"
%>
<html>
<head></head>
<title>Bulk Update Page</title>
<body bgcolor="#FFcc00">
<p style="margin-top: 0; margin-bottom: 0">
<u><b><font color="#800000" size="4"><center>Update Data from Excel Sheet to Database</center></font></b></u></p><br>
<p style="margin-top: 0; margin-bottom: 0">
<font face="arial" color="#000080" align="left"><b>Bulk Update on :</b>
<%
java.util.Date date = new java.util.Date();
%></font>
<%
    out.print( date );
%>
<br><br>
<b><font size="2" face="Arial" color="#000080">This page is used to Select the
data and configuration file in the browser and update MYSQL database
</font></b></p>
<form action="http:\\localhost:8080\itasm\ExcelTest3.java" method="post" enctype="multipart/form-data">
  <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="98%" id="AutoNumber1">
    <tr>
      <td width="34%" bgcolor="#800000"><b>
  <font face="Arial" color="#FFFF00" size="2">Select the Excel File to update </font>
      </b></td>
      <td width="53%" bgcolor="#800000">
      <p align="left"><input size="34" type="file" name="spreadsheet" /></td>
      <td width="17%" bgcolor="#800000"><input type="submit" value="Update File" /></td>
    </tr><br>
<tr>
<td width="34%" bgcolor="#800000"><b>
<font face="Arial" color="#FFFF00" size="2">Select the corresponding Configuration File</td>
<td width="17%" bgcolor="#800000"><input size="34" type="file" name="configfile" /></td>
<td width="53%" bgcolor="#800000"></td>
</tr></font>
  </table>
</form>
<p style="margin-top: 0; margin-bottom: 0">
</p>
</body>
</html>When i execute the above code rather than executing the code, it just displays it in the browser.
Please help.
Regards

Hi Andy!
I just started to set the tabindex on each item... it wasn't working.. I copied the example you gave.. ha.. you had taxindex --- TAX and I too didn't notice it.. so just want to mention it incase anyone does what I did.. copies without thinking..
As you said in the previous post it is TABINDEX="n"
Ha.. its a Monday.. Bill

Similar Messages

  • How can I write the action attribute of a form dynamically using JSP

    I would like to do something like this:
    If the 'Accept-Language' of the http request is 'en', write out this in JSP:
    <form name='myform action="http://127.0.0.1/myservlet/en/>
    else if
    the 'accept-language' is 'es', write out this instead:
    <form name='myform action="http://127.0.0.1/myservlet/es/>
    else if no match
    <form name='myform action="http://127.0.0.1/myservlet/default/>
    How can I do that in JSP? I think this is simple enough so that I don' t need to use any of the Java Web framework/Java Beans.
    Thank you for any help.

    you can use a simple javascript for this:
    function setAction(lang){
       if(lang=="en"){
         document.forms[0].action="putYourservletUrlhere";
       }else if(lang=="es"){
         document.forms[0].action="putYourservletUrlhere";
       }else{
         document.forms[0].action="putYourservletUrlhere";
    }

  • Jdev11G XMLMenuModel : Setting the "destination" attribute for the itemNode

    Hi,
    I am trying to set the "destination" attribute for the itemNode in the metadata.xml.This is the URI to which the user must be taken on clicking that node. But it is unable to pick the URI set for the destination attribute and hence there is no navigation that happens.Using the "action" attribute works fine. But I need to use the "destination" attribute.
    Here are some of the files:
    The metadata.xml (root_menu.xml):
    <?xml version="1.0" encoding="windows-1252" ?>
    <menu xmlns="http://myfaces.apache.org/trinidad/menu">
    <groupNode id="groupNode1" idref="itemNode1" label="Merchant">
    <itemNode id="itemNode1" label="Sites" action="site_action" rendered="#{testBean.test}"
    focusViewId="/common/site/Site.jspx">
    </itemNode>
    <groupNode id="groupNode2" idref="itemNode2" label="Settings">
    <itemNode id="itemNode2" label="Page Template" action="template_action"
    focusViewId="/common/template/TemplateRules.jspx">
    </itemNode>
    <itemNode id="itemNode3" label="Configuration Parameters" destination="http://www.google.com"
    action="config_action" focusViewId="/common/others/ConfigurationParameters.jspx">
    </itemNode>
    </groupNode>
    <groupNode id="groupNode3" idref="itemNode4" label="System Admin">
    <itemNode id="itemNode4" label="Cache Invalidation" destination="/faces/common/others/CacheInvalidation.jspx"
    focusViewId="/common/others/CacheInvalidation.jspx">
    </itemNode>
    </groupNode>
    </groupNode>
    </menu>
    The faces_config.xml:
    <?xml version="1.0" encoding="windows-1252"?>
    <faces-config version="1.2" xmlns="http://java.sun.com/xml/ns/javaee">
    <application>
    <default-render-kit-id>oracle.adf.rich</default-render-kit-id>
    </application>
    <navigation-rule>
    <navigation-case>
    <from-outcome>site_action</from-outcome>
    <to-view-id>/common/site/Site.jspx</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>template_action</from-outcome>
    <to-view-id>/common/template/TemplateRules.jspx</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>config_action</from-outcome>
    <to-view-id>/common/others/ConfigurationParameters.jspx</to-view-id>
    </navigation-case>
    <navigation-case>
    <from-outcome>cache_action</from-outcome>
    <to-view-id>/common/others/CacheInvalidation.jspx</to-view-id>
    </navigation-case>
    </navigation-rule>
    <managed-bean>
    <managed-bean-name>root_menu</managed-bean-name>
    <managed-bean-class>org.apache.myfaces.trinidad.model.XMLMenuModel</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    <managed-property>
    <property-name>createHiddenNodes</property-name>
    <value>false</value>
    </managed-property>
    <managed-property>
    <property-name>source</property-name>
    <property-class>java.lang.String</property-class>
    <value>/WEB-INF/root_menu.xml</value>
    </managed-property>
    </managed-bean>
    <managed-bean>
    <managed-bean-name>testBean</managed-bean-name>
    <managed-bean-class>testBean</managed-bean-class>
    <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>
    </faces-config>
    Can you please tell me what else has to be set for the "destination" attribute to work?
    Thanks,
    Swapna

    The code you sent is not clear, could you send your jspx page.
    Thanks

  • How to access and set the object attributes in a task flow?

    I have created a web service data control which has an operation having input as payload object. This payload object has two attributes min and max. I am calling a task flow in a dynamic region in which I want to display result of this operation for which i have to set the values for min and max. I want to set these values when I click the taskflow link. How to achieve this? I am new to adf.

    Hi Arun,
    Thanks for your reply.
    I have tried passing parameter to a task flow, but i cannot set the action to a task flow call because it already has action for a method in a dynamic region which renders the task flow at runtime. How do i set action to task flow call link? Also once i get the parameters into the page flow scope variables, i want to pass those to one of my data control operation which displays the result in that taskflow.(i dont want to create parameter form for this operation).

  • Setting the logonHours attribute for a user in Active Directory

    Hi Anyone,
    I'm a brasilian guy and I need your help. How can I set the logonHours attribute on my Active Directory?
    I have this code but it doesn't works good:
        public void setLogonHours(boolean[] logonHoursBits){
            int i;
            int j;
            int k;
            int index21 = 0;
            int index24 = 0;
            byte[] byteLogonHour = new byte[21];
            byte byte8Hours = 0;
            for(i=0; i <= 6; i++){
                for(j=1; j <= 3; j++){
                    for(k=7; k >= 0; k--){
                        if (i < 6){
                            if (logonHoursBits[i] == (boolean)(index24 == 0) ? true : false){
                                byte8Hours += (byte)Math.pow(2,k);
                        else{
                            if (logonHoursBits[0] == (boolean)(index24 == 0) ? true : false){                           
                                byte8Hours += (byte)Math.pow(2,k);
                        index24++;
                    byteLogonHour[index21] = byte8Hours;
                    index21++;
                index24 = 0;
            try{
                String nome = "CN=Dryelle,OU=Pesquisa,DC=cifya,DC=com,DC=br";
                ctx = new InitialLdapContext(env,null);
                ModificationItem logonHours[] = new ModificationItem[1];
                logonHours[0]= new ModificationItem(DirContext.REPLACE_ATTRIBUTE, new BasicAttribute("logonHours",byteLogonHour));
                ctx.modifyAttributes(name,logonHours);
                System.out.println("Atributo logonHours alterado com sucesso.");
            catch (NamingException e) {
               System.err.println("Problema na altera??o " + e);
        }the code set the attribute but wrong. Can anyone help-me? It's making me crazy.
    Sorry about my poor english.
    Tks.
    Edited by: th_slopes on Aug 15, 2008 5:50 PM

    DirContext ctx = new InitialDirContext(pr);
              BasicAttributes entry = new BasicAttributes(true);
              String entryDN = "cn=CharbelHad,ou=test users,dc=test,dc=dev";
              Attribute cn = new BasicAttribute("cn", "ChHad");
              Attribute street = (new BasicAttribute("streetAddress", "Ach"));
              Attribute loginPreW2k = (new BasicAttribute("sAMAccountName", "[email protected]"));
              Attribute login = (new BasicAttribute("userPrincipalName", "[email protected]"));
              Attribute sn = (new BasicAttribute("sn", "Chl"));
              Attribute pwd = new BasicAttribute("unicodePwd", "\"Ch@341\"".getBytes("UTF-8"));
    Attribute userAccountControl = new BasicAttribute("userAccountControl", "512");
              Attribute oc = new BasicAttribute("objectClass");
              oc.add("top");
              oc.add("person");
              oc.add("organizationalPerson");
              oc.add("user");
              // build the entry
              entry.put(cn);
              entry.put(street);
              entry.put(sn);
              entry.put(userAccountControl);
              entry.put(pwd);
              entry.put(login);
              entry.put(loginPreW2k);
              entry.put(oc);
              ctx.createSubcontext(entryDN, entry);

  • How to set the DFF Attribute Programmatically?

    hi
    how to set the DFF Attribute Programmatically in Process Request of CO
    thanx

    Hi
    Do u want to set the value in DFF Programmatically ?
    u can capture the VO used for DFF and set the the value in controller.
    Thanks

  • BC4J, row tag, dynamically setting the action

    I have created a DataPage in my BC4J app. It is an Edit Form which creates for me two JSP pages - SitesView_Edit.jsp and SitesView_EditSubmit.jsp. I have modified the Edit page to send through a parameter holding a calue of either "Update" or "Delete" depending on the action chosen by the user.
    The Row data tag in the Submit page looks something like this:
    <jbo:Row id="myrow" datasource="ds" rowkeyparam="MyRowKey" action="Update" >
    I want to change it to use the parameter passed in as the action attribute. Following the example in the help file, I define a local variable in Java as dbAction, put the parameter value inside it and change the row tag as follows:
    <jbo:Row id="myrow" datasource="ds" rowkeyparam="MyRowKey" action="<%=dbAction%>" >
    Unfortunately, this won't even compile!! It gives me a NullPointerException at compile time. Very strange. Any ideas, anyone??? Is this a bug?
    As a workaround I have simply created an if statement and branch to either a hardcoded Update row tag or a hardcoded Delete row tag depending on the parameter value.
    Thanks,
    Simon Cullen
    Western Australia

    Since you cant pass in the action as a parameter, you can use a scritplet to decide which statement to execute or use two jsp pages, one for each action.

  • Error deploying EJB on weblogic: Unable to set the transaction attribute

    Hi,
    I'm trying to deploy an application in WL10.3.2 and an error occurred during activation of changes.
    Here is the error message from the log file:
    <Jun 6, 2011 1:28:27 PM MDT> <Error> <Deployer> <BEA-149205> <Failed to initialize the application 'serverEAR-2' due to error weblogic.application.ModuleException: Exception preparing module: EJBModule(serverEJB-2.8.0.jar)
    Unable to deploy EJB: C:\oracle\Middleware\user_projects\domains\base_domain\servers\Server_3\tmp\_WL_user\serverEAR-2\1zw7ao\serverEJB-2.8.0.jar from serverEJB-2.8.0.jar:
    Unable to set the transaction attribute for method 'saveActionGroup(EditableActionGroup)' on EJB 'ViewBean'. No matching method could be found. Please verify the method signature specified in the ejb-jar.xml file matches that of your Remote interface for this EJB.
    weblogic.application.ModuleException: Exception preparing module: EJBModule(serverEJB-2.8.0.jar)
    Unable to deploy EJB: C:\oracle\Middleware\user_projects\domains\base_domain\servers\Server_3\tmp\_WL_user\serverEAR-2\1zw7ao\serverEJB-2.8.0.jar from serverEJB-2.8.0.jar:
    Unable to set the transaction attribute for method 'saveActionGroup(EditableActionGroup)' on EJB 'ViewBean'. No matching method could be found. Please verify the method signature specified in the ejb-jar.xml file matches that of your Remote interface for this EJB.
         at weblogic.ejb.container.deployer.EJBModule.prepare(EJBModule.java:454)
         at weblogic.application.internal.flow.ModuleListenerInvoker.prepare(ModuleListenerInvoker.java:199)
         at weblogic.application.internal.flow.DeploymentCallbackFlow$1.next(DeploymentCallbackFlow.java:391)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:83)
         at weblogic.application.internal.flow.DeploymentCallbackFlow.prepare(DeploymentCallbackFlow.java:59)
         Truncated. see log file for complete stacktrace
    Caused By: weblogic.ejb.container.deployer.DeploymentDescriptorException: Unable to set the transaction attribute for method 'saveActionGroup(EditableActionGroup)' on EJB 'ViewBean'. No matching method could be found. Please verify the method signature specified in the ejb-jar.xml file matches that of your Remote interface for this EJB.
         at weblogic.ejb.container.deployer.MBeanDeploymentInfoImpl.processCTs(MBeanDeploymentInfoImpl.java:1502)
         at weblogic.ejb.container.deployer.MBeanDeploymentInfoImpl.processSpecificMethodCTs(MBeanDeploymentInfoImpl.java:1472)
         at weblogic.ejb.container.deployer.MBeanDeploymentInfoImpl.initializeTransactionAttribute(MBeanDeploymentInfoImpl.java:773)
         at weblogic.ejb.container.deployer.MBeanDeploymentInfoImpl.<init>(MBeanDeploymentInfoImpl.java:259)
         at weblogic.ejb.container.deployer.EJBDeployer.prepare(EJBDeployer.java:1190)
         Truncated. see log file for complete stacktrace
    Please help me...Thanks.

    In your ejb-jar.xml you are referring to a method saveActionGroup(EditableActionGroup) which is not defined in your remote interface.
    Maybe you have made some typo in the configuration. Check your transaction section, i.e.,
    <container-transaction>
                <method>
                    <ejb-name>ViewBean</ejb-name>
                    <method-name>saveActionGroup</method-name>
                    <method-params>
                        <method-param>package.EditableActionGroup</method-param>
                    </method-params>
                </method>
                <trans-attribute>Required</trans-attribute>
    </container-transaction>or something similar. See if the defined methods are corresponding to the methods defined in the remote interface.

  • Trying to set the entity attributes in before commit and get the following

    i get the following error when i try to set the entity attributes before commit.
    JBO-28202: Entities invalidated in beforeCommit(). Need to re-validate and post.
    can somebody let me know, how to re-validate and post.

    I Suggest you set its Attribute on EOImpl, override doDML, and before call super.doDML set your Attribute. There is a special reason to set Attribute on beforeCommit?
    Best Regards

  • Dynamically setting the vo attribute Update property

    Hi All,
    Can we set the vo attribute update property dynamically.if so please let me know how can we achieve this.
    I have a read only view..But in my process request i need to set the value for that attribute based on some condition.
    How can i achieve this.I cant set at bean level.only row level i need to set.
    Its a dynamically created seeded vo.
    Please help.
    Thanks
    Bharat

    Hi,
    Capture the VO row and then set the value on the view attribute.
    OAViewObject vo = (OAViewObject)am.findViewObject("viewinstance");
    If(vo!=null)
    Row row = (Row)vo.first();
    row.setAttribute("Attribute Name", "Value");
    Thanks,
    Gaurav

  • Can not set the value attribute of a ContextNode

    Hi,
       I am trying to set the value Attribute in a value Node it is a simple way but it gives me java.lang.NullPointerException error on the given line:
    wdcontext.current(ValueNodeName)Element.set(AttributeValueName)
    Thanks in advance
    Best Regards
    Beata

    Like all above suggested do this:
    wdContext.node(ValueNodeName).add(
               wdContext.node(ValueNodeName).create(ValueNode)Element()
    wdContext.node(ValueNodeName).moveLast();
    wdContext.current(ValueNode)Element().setATTR(..);

  • How define the action of a h:form?

    Hi, I have a page that is accessed with http that contains a form which needs to be posted to a https action. As there is no way to define the action attribute for a h:form tag, how can I implement this using the h:form tag? Is there a way to make the commandButton tag action attribute point to a url?

    With JSP+Servlets in Tomcat I would do something like this
       <form action="https://${pageContext.request.serverName}:8443${pageContext.servletContext.contextPath}/Login?action=login" method="post">
             <label for="username"><fmt:message key="user_username"/>:</label><input type="text" name="username" id="username" value="${username}"/>
             <br/>
             <label for="password"><fmt:message key="user_password"/>:</label><input type="password" name="password" id="password" value=""/>
             <br/>
             <input type="submit" value="<fmt:message key="login"/>"/>     
       </form>how I do something similar using JSF html tags?

  • How can I set the tab order in a form?

    How can I set the tab order in a form?

    Sorry. I don't mean page tabs, but the order in which form fields are selected by the tab key. In simple html there is a value called tabindex and I was just wondering if there is a way to assign this order within a portal form. I have basically recreated the form with a custom layout and adjusted the table structure to force the order I was looking for, but it would be a nice add for future versions.

  • Anyway to set the TAB order in a form?

    Hi all,
    Is there anyway to set the TAB order in a form where it can skip from tabbiong to the labels... and also when to form regions are side by side to direct the tabbing to go down the first form then up to the top of the second and down the second...???
    Some languages allow to assign tab order... 10,20,30,40..etc.
    Thank you, Bill

    Hi Andy!
    I just started to set the tabindex on each item... it wasn't working.. I copied the example you gave.. ha.. you had taxindex --- TAX and I too didn't notice it.. so just want to mention it incase anyone does what I did.. copies without thinking..
    As you said in the previous post it is TABINDEX="n"
    Ha.. its a Monday.. Bill

  • How do I set the mailhost attribute in Messaging Server 3.5?

    <B>Intent of the hostname aliases feature: </B><BR>
    In Messaging Server 3.5, the hostname aliases feature is designed to facilitate migrating and co-hosting. For
    instance, if you set up all of your sales and marketing users on one Messaging Server, but suspect that you'll
    want to split those groups in the future, you can give the sales users the mailhost value sales.company.com and
    the marketing users the mailhost value mktg.company.com. This feature can also be used for fast failover if
    you want to be able to move a group of users quickly from one Messaging Server to another.
    <P>
    <B>How to use hostname aliases and how to set mailhost and MessageHostName settings: </B><BR>
    Each user's mailhost attribute can have only one value. All users on a single Messaging Server do not need to
    have the same mailhost value in the LDAP directory. The user's mailhost value should match one of the
    MessageHostName attribute values in netscape.mail.conf. (On Unix, the path to this file is
    /etc/netscape.mail.conf. Windows NT users must use Notepad to create this file in
    server-root\bin\mail\Server\etc, where server-root is the base directory where your SuiteSpot servers are
    installed.)
    <P>
    With Messaging Server 3.5 and later, MessageHostName can have multiple values. Think of hostnames as
    colors. Each mail account in the LDAP server has a single color. Each Messaging Server has one or more
    colors. A Messaging Server will check an LDAP account's color (mailhost) against its own color(s)
    (MessageHostName), and if they match, the server considers the account to be local. <P>
    For example: <BR>
    MessageHostName=red.company.com,green.company.com,blue.company.com
    <BR>where original-host-name is the machine's real name. This entry must come first as the server uses the first
    entry to generate machine specific postmaster forms. The subsequent host names can be any values that you
    wish separated by commas that are inside the brackets. Do not place spaces anywhere on the line.
    <P>
    In this example, if the mailhost setting for the user is set for either red.company.com or green.company.com, or
    blue.company.com, the server will consider the user to be local. (Hostname aliases must also be configured in
    DNS. Please see the DNS section at the end of this technote.) No other Messaging Server should list either
    red.company.com or green.company.com or blue.company.com in the MessageHostName field. Mail could
    not be delivered properly if either red.company.com or green.company.com or blue.company.com were listed
    in any other server's MessageHostName field. A user with a mailhost setting of violet.company.com would not
    be considered local to this machine.
    <P>
    Although it is possible with Messaging Server 3.52 to list more than 16 different host names in the
    MessageHostName field, it is not recommended because increasing the number of hostnames in this field beyond
    16 will have a negative impact on performance. This feature is intended to provide fast failover and/or
    migration of users. If users need to be divided up into many smaller groups, the use of some other LDAP
    attribute is recommended.
    <P>
    In Messaging Server 3.0, you can associate a server with only one host name. Consequently, all mail accounts
    on a given server must have the same mailhost value in the LDAP directory. This should be the name of the
    server, i.e. host.company.com
    <P>
    </A>A note about DNS
    Hostname aliases must be configured in DNS. This is done with a CNAME record. For example:
    A 128.101.101.101
    CNAME
    <P>
    Additional MX records are not required to use hostname aliases.
    <P>
    If you aren't sure about how to configure your DNS records, consult the book <I>DNS and Bind </I> by Paul Albitz and
    Cricket Liu.

    You can find the connection settings in Tools > Options > Advanced : Network : Connection
    See "Firefox connection settings":
    *[[Firefox cannot load websites but other programs can]]

Maybe you are looking for

  • Error Code-50 when trying to copy or delete files on external hard drive

    Hi, I am in process of backing up large HD video files from one external hard drive to another using Carbon Copy Cloner software.  I get this error message:  "This file or folder is sitting on a bad section of hard disk media and is unrecoverable. De

  • Xsun (high CPU utilization) on Solaris 10 Sparc

    hi i have sun blade 1500 and am running solaris 10 on it. the machine is a 2 CPU (750Mhz) 4GB Sparc with the lastest cluster patch. The Xsun process is alway at 50% util and the windowmaker (wmaker) is at 27%. The Xsun is alway using all available CP

  • HT1338 upgrade to mac os 10.7.5

    Hi, I am trying to update my Macbook pro software to Mac OS X 10.7.5. I did software update and it tells me that my mac is uptodate. The reason that I want to do this is because My iPhoto update from app store is not downloading because my mac is not

  • Actions- Incorrect Entry Date and Corrected Entry Date

    i am going by the link below http://help.sap.com/saphelp_erp60_sp/helpdata/en/48/35c5a94abf11d18a0f0000e816ae6e/frameset.htm But I am not able to find "Incorrect Entry Date" and "Corrected Entry Date" Actions anywhere. Not even the drop down of Actio

  • Move DP and DS (7) from Solaris to Linux

    Hi, I'd like to move my running DP and a couple of DS from a Solaris i386 to a Linux machine. a) Would a simple tar/cp from source to destination work (for same arch)? b) Would dpadm backup/restore as well dsadm/dsconf backup/restore work? best regar