Java script with jsp

hello friends,.
please help me !! May i know how to retrieve values from list box in java script to jsp and store them in database..i am doing a project Employee Management system....
please give me ideas .....

thank you very much sir.......
i have a combo box in java script having employee skills, if the employee select his skills and click on submit, the values should be stored in the database of the particular employee through JSP..
the code that i have did is...
<%
String s1=(String)session.getAttribute("eid");
String s2[]=request.getParameterValues ("menu2");
int i=0;
%>
<%
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:empl2");
PreparedStatement prep=con.prepareStatement("update skill(menu2) values(?) where eid=?");
// prep.setString(1,s2);
prep.setString(2,s1);
i=prep.executeUpdate();
con.close();
catch(Exception e)
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body >
<center><h4><u> Employee Assessment Application</u></h4></center>
<%
if(i>0)
%>
Your skills had been updated !!!!!
<%
else
%>
not updated
<%
%>
<br>Best of Luck
<h4><u>Back</h4>
</body>
</html>
But the values are not getting stored....what to do
thanx in advance

Similar Messages

  • Using java bean with jsp

    hello friends,
    i'm new to jsp. i want to create an html form that accepts username and a value from four radio buttons and display back the entered name and checked radio button's value using java bean.
    i use the <jsp:setProperty id="" property="*"> method. i don't know how to access the radio buttons value from the html.
    also when i use an additional field other than username the jsp page is showing error.
    Please give me the correct method to use java bean with jsp in this circumstance.
    thank you.

    thank you, but i have a problem left. the case is like this.
    i got the jsp and bean worked fine when i have a sinle input text field.
    but when i added a second text field i recieved the following error.
    javax.servlet.ServletException: basket.newbean.getUserPass()Ljava/lang/String;
         org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:825)
         org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:758)
         org.apache.jsp.newform.process_jsp._jspService(process_jsp.java:69)
         org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    where userPass is the new form element. I have made the subsequent chanes in my bean program and jsp file.
    pls hlp.

  • Give some refrence to learn Java Script with HTML5lo mates,

    Hello mates,
    Can anybody please prvodi me a good refrence to learn java script with HTML5. Yes, i am new to HTML5 and Java.
    Anybody have a good refrence.
    Please Share.
    Thanks

    Sorry for misspell in thread heading.

  • Java Script With XE

    hi Expert,
    Can You Tell Me how to use Java Script With XE.
    Thanks
    Manoj

    Manoj.
    By the term "Use JavaScript", do you mean how to include JavaScript functions on your page(s) or are you looking for help in what JavaScript can be used for and how to add onclick, onchange events to form elements?
    If it is the former, there are several ways to include JavaScript onto your pages:
    1. Edit your page in the APEX Builder and place the normal syntax into the HTML Header Section i.e
    <script language="JavaScript">
    function hellWorld()
    alert ("Hello World");
    </script>2. Check out this article on how to link in File System based Javascript files: http://djmein.blogspot.com/2007/01/reference-javascript-from-file-system.html
    I hope that gets you started.
    Let me know if you need any more help.
    Duncs
    http://djmein.blogspot.com
    As a courtesy, please remember to mark correct or helpful responses accordingly :)

  • Java script in Jsp Dynpage

    Hi all,
    Can any one give me a sample code for using a java script in jsp dynpage which invokes on client click. I mean i want to call a java script function on client click.

    Hi,
    Check these:
    https://wiki.sdn.sap.com/wiki/display/Snippets/JSPDynPage-Howtohideanelementonclienteventingaswellaschangethetextofthebutton+dynamically
    Search for onClientClick in above link and you will find the corresponding javascript function that is called when user clicks the button.
    Regards,
    Praveen Gudapati

  • How to do Front End Validation for JSP Forms using Java Script with 9iJD...

    How to do Front End validation using 9iJD. Any wizard is there. We need to do the val. using Java Script. If its not available, please include that in the Production Release.

    Thanks a lot. When is the Production Release is scheduled. Please tell us whether itll be available for Free Download. Bec, we couldnt buy. Bec, if its working fine with all the options without any bug only, we can ask our company to buy 9iJD by stating the advantages. Just explain us.

  • Java script with java

    sir i have seen that java 1.6 mustang version is supporrting java script
    if it is so please any one can help me on how to make my JEditorPane
    to support java script
    not only to jEditorPane but to any other swings component
    i tried in all ways please can any one give me this help

    Hello Farhan,
    The OP stated that there is no condition on the process. In this case, I believe only 'SUBMIT' will cause the process to be fired.
    "you can put anything in the string of the doSubmit."Well, you can do that, but it will have an effect only if you are using the REQUEST variable to condition a process. Otherwise, nothing will happen, and you want even receive an error message, because no error actually exist (as I believe happened with the OP case).
    Regards,
    Arie.

  • Using Java Script With Item Button

    Hi All,
    please i want to know how can i call any java script function from an item button?
    i cannot find the "Action When Button Clicked" tab which is exist in a region button.
    Thanks in advance,
    Ola

    Hi,
    i am having a strange problem with java script
    i have defined the following commandlink in an af:table
    <af:commandLink
    text="lockUser"
    disabled="#{!bindings.lockUser.enabled}"
    id="cl1"
    partialTriggers="cl1"
    action="#{searchBean.lockUser}">
    <af:clientListener method="onlock1" type="click"/>
    </af:commandLink>
    I have defined the following java script function.
    <f:facet name="metaContainer">
    <af:resource type="javascript" >
    function onlock1(){
    if(confirm("Do you want to cancel")){return true;}
    else {
    return false;}
    </af:resource>
    </f:facet>
    when i click on the link, the dialog box appears asking if i want to cancel: when i press yes still the link action is activated. Kindly suggest where i am going wrong.
    the behaviour i need is to if cliked on yes then the link action does not activate and nothing happens. if i press any other button the link functionality should be activated and it should perform the locking functionality

  • Can I use java script with iWeb?

    I am quite pleased with iWeb for my web requirements, commercial and private, but I need to insert java script and don't know how or if iWeb accepts it.

    All custom code, including JavaScript, is pasted in the HTML Snippet.
    Read this : Using the HTML Snippet
    Everything you paste there, is your responsibility.
    iWeb happily publishes your code, whether it works or not. If not, mend it.
    See examples here :
         http://www.wyodor.net/_Demo/Fancy/Dynamic_Text.html
         http://www.wyodor.net/_Demo/html5/BlowUp.html
         http://www.wyodor.net/mfi/Maaskant/How_To.html
         http://www.wyodor.net/mfi/cultureclub/Movies.html
         http://www.wyodor.net/mfi/roodhout/How_To_Do.html
    You may have to learn HTML, CSS, JavaScript, AJAX, DOM and how iWeb creates its pages. Especially that.

  • Java scripting with textarea?

    Hello,
    I am trying to read values passed by a servlet from an html form using java scripting. Here is the code:
    document.MainForm.textareaInfo.value = "<%= (String)session.getAttribute("textareaInfo") %>"
    This code works if the info entered in the textareadInfo field has one line with no carriage return.
    How can assign value to textareaInfo field contains multi-line string with carriage return?
    Thanks in advance.

    Hi,
    replace all "\r\n" (carriage return) in the string with "\\r\\n", so that it appears as "\r\n" in javascript.
    In jdk 1.4, you can use((String)session.getAttribute("textareaInfo")).replaceAll ("\r\n", "\\\\r\\\\n")

  • Java script with labview

    hi
     i want to exicute  a small java script  code in to labview, so please help me for this

    You can do this through .NET interface, it is very complicated.
    Google : .NET DLR javascript
    You can call .NET methods from labview and there is an existing DLR implementation of javascript. The least to vapour is IronJS.
    Download the libraries, force labview use the .NET 4.0 or higher and try to use it.
    Since you mentioned "small javascript", much less painfull would be to rewrite it in labview. If you are trying to mimic some javascript code online you didnt develop, you can use tools to breakpoint and probe it by tools in browsers. Firefox has firebug. I used it when I was converting a very difficult mathematic conversion between C and javascript.

  • Capture output of Perl script with jsp:include

    The company's main web site has a CGI script written in Perl that generates a header, and another one that generates a footer. I would like to deploy a JSP that incorporates the header and footer without having to re-implement the header/footer Perl code in Java.
    Can the <jsp:include> tag include the output from these Perl scripts?

    Well, I tried it. The answer seems to be no.
    I created a simple CGI hello-world thingie and tested it, works fine from a browser (I'm doing all this remotely on a friend's Gentoo box so I know it's not just cached in my browser or anything).
    Then I created a simple JSP and used a fully-qualified URL pointing to the executable CGI script. While the JSP compiles and renders (I had some text in the JSP itself too), the part where it's supposed to include the content of the Perl script doesn't even appear.
    I also tried putting the CGI script into my webapp directory and specifying a relative path to the script, and it doesn't seem to get executed either. To confirm that I'm doing everything right, I put together a simple HTML file that has the same output and changed the "page" attribute to point to that file instead. Sure enough, the output appears.
    So the answer to my question appears to be: no, the output of a Perl CGI cannot be included into a JSP with the <jsp:include> tag. But I'm going to double-check on the Tomcat-user mailing list.

  • Using java files with JSP

    Ok, so im pretty new to this JSP lark and have a question.
    I have Java Classes resting in .java files, i need to know how
    do i link these files to my .jsp page so that the classes/variable etc.
    declared with the java files are recognised when they are come
    across in the .jsp file.
    I dont know if I have explained that properly.

    Just include this statement at the top of your jsp:
    <%@page import="yourpackage.yourclass"%>
    The .java files should of course be compiled into .class files prior to using (and you don't include the extension when importing).

  • Problem in using java bean with jsp

    Hi,
    This is my code and i get this error. Not able to trace the mistake.
    bean.html
    <html>
    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <title>Fname</title>
    </head>
    <body>
    <form method="POST" action="http://localhost:8080/beanjsp.jsp">
         <p>Fname: <input type="text" name="T1" size="20"></p>
         <p>Lname: <input type="text" name="T2" size="20"></p>
         <p> </p>
         <p> </p>
         <p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"></p>
    </form>
    </body>
    </html>
    beanjsp.jsp
    <jsp:useBean id="bean" class="beans.FirstBean" scope="application" />
    <jsp:setProperty name="bean" property="fname" param="T1" />
    <jsp:setProperty name="bean" property="lname" param="T2" />
    THE FIRST NAME IS <%=bean.getFname() %>
    THE LAST NAME IS <%=bean.getLname() %>
    FirstBean.java
    //CREATING A BEAN
    package beans;
    import java.io.*;
    public class FirstBean
         private String fname;
         private String lname;
         FirstBean()
              fname="";
              lname="";
         public void setFname(String fn)
              fname=fn;
         public void setLname(String ln)
              lname=ln;
         public String getFname()
              return fname;
    public String getLname()
              return lname;
    error report
    org.apache.jasper.JasperException: /beanjsp.jsp(2,0) The value for the useBean class attribute beans.FirstBean is invalid.
         org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
         org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
         org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:146)
         org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1223)
         org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1116)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
         org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
         org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
         org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
         org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
         org.apache.jasper.compiler.Generator.generate(Generator.java:3270)
         org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:189)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)
         org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)
         org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)
         org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)
         org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
         org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:802)I have placed the beans package folder containing FirstBean.class inside classes folder of ROOT directory.
    I don't know what s wrong with my code :( ... Plz help asap.
    Thanks,
    Akshatha

    I have placed the beans package folder containing FirstBean.class >inside classes folder of ROOT directory.Place it in the WEB-INF/classes folder
    ram.

  • Java script and jsp

    Hello all
    I want to call javascript function without any event from a jsp code, like following
    <script>
    function add(a,b,c){ alert("hello");}
    </script>
    jdbc connection code
    while(rs.next()
    a=rs.getInt("id");
    b=rs.getInt("id2");
    c=rs.getInt("id3");
    %>
    <script> add(<%=a %>,<%=b %>,<%=c %>);</script>
    can i do like this in jsp
    please help.

    Hi,
    You can do this in case if you put the data in request attribute.
    Regards,
    Sudheer Varma.

Maybe you are looking for

  • No way to definitely delete an iphone app in itunes tab

    I have a very long list of unused app in the left column of the app itunes tab... And no way to delete them. I have looked everywhere in the web, some people say that, when deleting an app, there should be a pop-up window asking me if a want to only

  • Learning Stage Help

    Dear All, I am 10 day old for this kind of new era. I got InDesign CS4 plugin development request. I have only heared about InDesign, but I have never done any development work on it. But yes I have developed some xtensions for Quark. I have gone thr

  • Server Size Need Help !!!!

    Hi Experts, Our current BW database structure is like below: DB Size - 180,803 MB Size Used - 180,627 MB Free - 176 MB Logical Files used by SQL server are, DATA1 - Size (66,417) - Used (66,256) - Free Disk (15,014) DATA2 - Size (55,289) - Used (55,2

  • REALLY long files names shortened by Bridge's Image Processor

    I have images from a PHPBB forum website that during creation of a post to the forum have been auto renamed by scripts and then inserted into the database. The images are huge in file size and have used up the webserver disk space meaning no more ima

  • WIFI is still connected but isn't working?***?

    My WIFI icon on my MacBook Pro is black but safari isn't working. If I turn the wifi off and then immediately back on it works again. When it goes out, my phone and iPad still work. Any ideas?