Problem in the jsp, jstl and java script.

Hi Friends,
I am having one jsp which allows user(Could you please refer to code which is written in my jsp) to enter his username and password i want to get the password in the same jsp and want it to be passed to the custom tag without sending request to the server.Please give me an idea.Thanks in advance.
This is the text field which allows a password.
<INPUT type="password" name="password" size="10" maxlength="29" onblur="chkpwd()" onfocus="this.autocomplete=false" >
and this is the anchor tag which refers as LOGIN BUTTON
<IMG height=19 src="images/submit1.gif" width=106 border=0>
when user clicks on LOGIN BUTTON i am calling one javascript function LOGIN(PASSWORD:) to check the validation if the validation is success then i want to get the password in the same function which is entered .
This is ok i can get the password by "document.formName.password.value" then i need to pass this value to the jstl tag which is our own tag as shown below.
<prefix:tagname value="PASSWORD which is having in the javascript variable".
Please help me .
Quick reply is thankfull.
Edited by: bharathpolanki on Apr 20, 2008 1:55 AM
Edited by: bharathpolanki on Apr 20, 2008 2:55 AM

that's correct. You can use the below code for AJAX request.
<script type="text/javascript">
var httpObject = getHTTPObject();
//create XMLHttpRequest object
function getHTTPObject() {     
     var xmlhttp;
     if (window.XMLHttpRequest) // if Mozilla, Safari etc
          xmlhttp = new XMLHttpRequest();
     else if (window.ActiveXObject){ // if IE
          try {
               xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
          catch ( e ){
               try{
                    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
               catch ( e ){}
     return xmlhttp;
//define the function to send the request
function sendRequest(){
    var currDesc = document.getElementById("description").value;
    var URL =  "manageMaintAction.do"; //action mapping in your struts-config
    var queryString = "currDesc="+escape(currDesc); //get the currDesc value in your action class like request.getParameter("currDesc")
    httpObject.open( "Post", URL, true );
    httpObject.onreadystatechange = cbFn;
    httpObject.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded");
    httpObject.send(queryString);
//callback fn
function cbFn() {
    if (httpObject.readyState == 4)
         if (httpObject.status == 200)
          var result = httpObject.responseText;
          alert(result);
</script>

Similar Messages

  • Display pop ups in the jsp by using Java script

    Hi
    can any body say ,how to display pop ups in the jsp by using Java script ?

    that's correct. You can use the below code for AJAX request.
    <script type="text/javascript">
    var httpObject = getHTTPObject();
    //create XMLHttpRequest object
    function getHTTPObject() {     
         var xmlhttp;
         if (window.XMLHttpRequest) // if Mozilla, Safari etc
              xmlhttp = new XMLHttpRequest();
         else if (window.ActiveXObject){ // if IE
              try {
                   xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
              catch ( e ){
                   try{
                        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                   catch ( e ){}
         return xmlhttp;
    //define the function to send the request
    function sendRequest(){
        var currDesc = document.getElementById("description").value;
        var URL =  "manageMaintAction.do"; //action mapping in your struts-config
        var queryString = "currDesc="+escape(currDesc); //get the currDesc value in your action class like request.getParameter("currDesc")
        httpObject.open( "Post", URL, true );
        httpObject.onreadystatechange = cbFn;
        httpObject.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded");
        httpObject.send(queryString);
    //callback fn
    function cbFn() {
        if (httpObject.readyState == 4)
             if (httpObject.status == 200)
              var result = httpObject.responseText;
              alert(result);
    </script>

  • Deploying the JSPs, Servlets and Java class files

    Hello All,
    I'm very new to the Oracle 9i AS. We are using Version 1.0.2.2.
    How do we deploy the JSPs, Servlets, and Java class files (simple class files, not EJBs)?
    plese give us the procedure and stpes how to deply or the links for the same.
    Thanks,
    Santhosh.

    Hi
    I guess u r running apache-jserv as servlet engine for your jsp and servlets. If its so, jsp files can be run without any additonal configuration by putting the jsp file under document root or any subdirectory and for running servlets u have to add classpath entries for your servlet in jserv.properties file.
    To make sure that your servlet engine is working, try
    http://servername:port/servlet/IsItWorking, if u get success msg that means servlet engine is working fine.
    Hope this will help
    Regards
    Kumaran

  • Problem with Html field naming and java script

    Java Script which references html fields uses the
    notation "document.form[0].field". JATO generates field names which
    include the page (view bean). A dot is placed between viewbean name and
    field name(viewbean.field). However "document.form[0].viewbean.field"
    doesn't work as a reference. I'm not a java script person. Am I
    missing something?

    that's correct. You can use the below code for AJAX request.
    <script type="text/javascript">
    var httpObject = getHTTPObject();
    //create XMLHttpRequest object
    function getHTTPObject() {     
         var xmlhttp;
         if (window.XMLHttpRequest) // if Mozilla, Safari etc
              xmlhttp = new XMLHttpRequest();
         else if (window.ActiveXObject){ // if IE
              try {
                   xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
              catch ( e ){
                   try{
                        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                   catch ( e ){}
         return xmlhttp;
    //define the function to send the request
    function sendRequest(){
        var currDesc = document.getElementById("description").value;
        var URL =  "manageMaintAction.do"; //action mapping in your struts-config
        var queryString = "currDesc="+escape(currDesc); //get the currDesc value in your action class like request.getParameter("currDesc")
        httpObject.open( "Post", URL, true );
        httpObject.onreadystatechange = cbFn;
        httpObject.setRequestHeader( "Content-Type", "application/x-www-form-urlencoded");
        httpObject.send(queryString);
    //callback fn
    function cbFn() {
        if (httpObject.readyState == 4)
             if (httpObject.status == 200)
              var result = httpObject.responseText;
              alert(result);
    </script>

  • IE will load my excite home page but Firefox won't after following all of the suggestions , enabled cookies, java script and cleared cache.

    Was working fine for years until virus scan today. It will pull up the site, but not allow me to access my personal home page. Running XP on one laptop and Vista on the other. Same problem with both machines after running scan. Only problem appears to be accessing my home page on excite.com. Have enabled both cookies and java script as well as clearing cache.
    Can access excite home page on both IE and Chrome.

    Thanks for the suggestion.Working my way through, but no success yet. excite.com comes up but as soon as I click on "sign in", I get the error screen even though I have enabled cookies and java script.
    '''''The browser you're using is not allowing you to sign in to Excite.
    Right now, your browser's settings are configured to disable cookies and/or javascript. In order to access your account, you must change your browser's settings to accept both cookies AND javascript. '''''

  • Where can I download the last version that allows images and java script to be turned off?

    Due to my often slow connection I must have the option to turn off "automatically download images" and Java script. Firefox 23 does not have those options. Where can I download version 22 or whatever the latest version is that allowed these options?
    Thanks

    The Quickimage add-on doesn't work well at all, it gets stuck in the image off mode and will not switch back even after rebooting Firefox. Version 23.0 of Firefox is also very slow on my computer.
    I really need to find an older version of Firefox. Any idea where to download version 22 or earlier?

  • How to use HTML and Java Script files in Portal

    Hi,
    I am trying to access a web application using iViews. My application contains JSP,HTML,Servlets,JS(java script), image files. I am using JSPDynPro to access the JSP files and I am putting servlets in the private/lib folder of the PORTAL-INF dir of Portal project. Now my problem is almost all the JSP files uses the HTML files, JS files and image files. Where can put these files in the portal project dir structure to give access to the JSP files when i am creating a iView for the JSPDynPro componenets in the irj.
    thanks,
    Ashok

    Hi,
    JSPDynpage is the controller, one JSPDynpage can call more than one jsp file according to the coding. Through the JSPDynpage's setJspName() function only you can display a jsp page.
    EX:
    public void doProcessBeforeOutput() throws PageException {
      this.setJspName("logon.jsp");
    if you put the JSPDynpage in the src.core then the JSPDynpage can be accessed only by this application.
    if you put the JSPDynpage in the src.api then other applications can access this component.
    You can put the jsp pages in the pagelet folder.
    xml file
    =========
    <?xml version="1.0" encoding="utf-8"?>
    <application>
      <application-config>
        <property name="SharingReference" value="com.sap.portal.htmlb"/>
      </application-config>
      <components>
        <component name="jspdynpage name">
          <component-config>
            <property name="ClassName" value="package name.jspdynpagename"/>
          </component-config>
          <component-profile>
            <property name="tagLib" value="/SERVICE/htmlb/taglib/htmlb.tld"/>
          </component-profile>
        </component>
      </components>
      <services/>
    </application>
    REWARD USEFUL ANSWERS

  • I need to know the right tools and java technology

    Please help,I need to know the right tools and java technology to support what I need.
    I had background programming in Assembly,C++,Visual Basic,SAP/ABAP 4.
    All I can say, programming is about logic, now we are very helped building program using objects.
    I'm very interest to SAP tech, where all screens, programs, reports are resides on tables, this is the real dynamic!
    CUrrently I'm eager to do the same technic with java. I'm new to java....
    What I know the J2EE is the core for me to start is it right? I was very interest with the Client-Server Tech. How can I impelemet this with Java?
    I'm a bit confuse with so many java solutions. There is Java Applets, Swing, Java AWT, JavaBeans, etc...
    I don't know what is the best if I want my Presentation/Client Application will run within browser (not standard html, using like windows gui). What should I do to make business logic objects, how to invoke it within the gui. how to make installation package whenever clients connect to the http server.
    if you have a pointer to do it please let me know.... I'm very appreciate all your response...
    Best regards,
    Lucky Pangemanan

    I'd say - don't get carried away with the heavyweight frameworks. Don't use EJB if Hibernate and/or Tomcat will do the job. There's a danger of winding up using a bulldozer to crack a wallnut.
    What people mean by "J2EE" varies a fair bit.
    Start with Tomcat, which has the virtue of being free. Try some JSPs and servlets.
    Use Applets to do client side presentation only if you must; Applets create an installation overhead on end-users, and some of them can't cope, while others may not have the necessary installation permissions on their office machines. They are pretty rarely needed, IMNSHO, most client-side behaviour is better handled with html and JavaScript.

  • Why did you remove The option to disable Java scripts?

    Everyone knows malware always comes through java scripts. So why did you remove the option to turn it off ? Why the false saftey excuse? (duckspeak) This makes no sense. Alot of people also get errors and have slower speed with some pages so they disable it. I understand there is plugins available to block scripts but they never work 100%. It just really really seems strange that a browser that was built on the idea of safety, security and trust has now suddenly removed a item that makes users less safe, Under the guise of safety. (doublespeak)
    I will no longer use Firefox ever again unless you put this option back.

    Also note that the option is available in...
    '''<h1>about:config</h1>'''
    # In the address bar, type "about:config" (with no quotes), and press Enter.
    # Click "I'll be careful, I promise"
    # In the search bar, search for "javascript.enabled" (with no quotes).
    # Right click the result named "javascript.enabled" and click "Toggle". JavaScript is now disabled.
    To Re-enable JavaScript, repeat these steps.
    '''<h1>Add-ons</h1>'''
    You can alternatively install an add-on that lets you disable JavaScript, such as
    *[https://addons.mozilla.org/firefox/addon/noscript/ No-Script] (to disable JavaScript on a per page basis, as required)
    *[https://addons.mozilla.org/firefox/addon/quickjava/ QuickJava] (to easily disable and enable JavaScript, automatic loading of images, and other content)
    *[https://addons.mozilla.org/firefox/addon/settingsanity/ SettingSanity] (adds back JavaScript options, including Advanced JavaScript Settings, as well as options for loading images and showing the Tab Bar)
    Im also not sure how you are a computer expert and dont even know the difference between Java and Javascript. Its pathetic that you dont know that Java is the most insecure thing, not Javascript, get your facts straight before bashing a correct answer and "Java Scripts" were not removed, but moved.

  • Need flash player 8 and java script enabled to play videos on ipad, need help please.

    need flash player 8 and java script enabled on my ipad in order to view videos.  please help.

    iPads do not directly support Flash.
    You can look for Flash Browsers in the App store for some options to try. Support is not 100%, but maybe one may work for you.  Browsers like Puffin, Skyfire, Photon etc...
    IPads do fully support JavaScript.  Just make sure its turned on under Settings->Safari->Advanced->JavaScript.
    If you require Java, which is completely different to JavaScript, again there are some browsers in the App store that support it.  Search for "Java browsers" in the store.

  • I need to apply for a job but I'm told I need to enable cookies and java script, how do I do that?  I can't find it in system preferences

    I need to apply for a job but I'm told I need to enable cookies and java script, how do I do that?  I can't find it in system preferences
    I just updated to the new operating system which i'm starting to think was a bad idea, because it reset all my settings and I don't know how to fix them.

    so when I go to safari>preferences>security>uncheck box labled enable java script  links on webpages don't work and pictures and links son't want to appear on websites.  this made it so webpages don't want to work past loading the content in text format.  I have to check enable java script to go the webpages to work right so images and links work again but when I try to apply for this job the error message pops up saying I need to enable cookies and java script.
    SO I GUESS MY QUESTION IS IF JAVA SCRIPT IS ALREADY ENABLED HOW TO I ENABLE COOKIES?

  • Sqljdbc4 driver problem with the latest version of java (java6 update9)

    Hi all, sorry for my ingles.Need help with a problem, I have to connect to sql server 2008 from Java, I had install the Java SE Development Kit 6u22, and when the upgrade to the 6u29, the driver stopped working, they let the following example:
    public static Connection getConnection(String db_connect_string,String jdbcDriver)
    Connection conn = null;
    try {
    Class.forName(jdbcDriver);
    conn = DriverManager.getConnection(db_connect_string); //when you run this line, does nothing mores, nor throws errors
    } catch (Exception e) {
    System.out.println("Error de conexion." + e.getMessage());
    return conn;
    uninstall update29, and install that before and had returned to work. Still do not know how to solve this problem with the latest version of java. Any ideas?.
    Thanks.

    You are not the only one.
    MS SQL JDBC does not work with 1.6.0_29?

  • Need flash player 8  and java script

    why i try to open a videos from mac tube why is it showing i need a flash player 8+ and java script .

    iPads do not directly support Flash.
    You can look for Flash Browsers in the App store for some options to try. Support is not 100%, but maybe one may work for you.  Browsers like Puffin, Skyfire, Photon etc...
    IPads do fully support JavaScript.  Just make sure its turned on under Settings->Safari->Advanced->JavaScript.
    If you require Java, which is completely different to JavaScript, again there are some browsers in the App store that support it.  Search for "Java browsers" in the store.

  • Hello Guys. I had problems in the Computer before and changed my HD. I saved in my all files documents in (Time Capsule). How can I put all my files, pictures documents on my new HD? Please Help. Thank You

    Hello Guys.
    I had problems in the Computer before and changed my HD. I saved in my all files documents in (Time Capsule). How can I put all my files, pictures documents on my new HD?
    Please Help.
    Thank You
    Julio Skov

    Hey
    Thank you very much for replay.
    Would you explain to me how can I do?
    I don't really understand these processes.
    Thak you very much
    Julio

  • How to get the context data using java script in interactive forms

    Hi All,
    How to get the context data using java script in interactive forms by adobe,  am using web dynpro java
    thanks.

    Hi venkat,
    Please Refer this link.
      Populating one Drop-Down list from the selection of another Drop-down list
    Thanks,
    Raju.

Maybe you are looking for

  • Error while deploying a message driven bean

    I am deployeing a MDB which is done successfully but the message is not retrieved(No message in teh queue). The following description is given in the log file. #1.5#0016E6197593004B0000000B000013040004288DE20D6CD8#1170489754872#com.sap.security.core.

  • Strange SaveAs dialog in Leopard Mail 3.6

    This is the craziest thing, I've never seen this before. Normally when I save a message or attachment in Mail, the Save As dialog rolls down and when I look at it in list view, I see two columns headings, Name and Date Modified. Starting this morning

  • Create excel hyperlink directly to PDF page in a file

    I have seen some old posts on this saying this could not be done. Wondering if anyone has developed a way to do this yet? I want my excel hyperlink to take me to a specified page within a PDF that is filed on my harddrive. I'm able to link the PDF bu

  • Event handling in global class (abap object)

    Hello friends I have 1 problem regarding events in abap object... how to handel an event in global class in se24 . Regards Reema jain. Message was edited by:         Reema Jain

  • 0TCT_MD_C_FULL_P01 installation failed

    Hi Friends, I am trying to install process chain 0TCT_MD_C_FULL_P01 from business content. After displaying all the activation messages at the bottom of the screen, it ended up with a message "Source System Does not exist". I went to log file to see