Invoke servlet with javascript

Hello.
I need to invoke a servlet with javascript when the user clicks a button.
Is there a way to invoke the servlet without submitting the page ?
Thanks in advance.

onchange="location.replace('ServletName');"

Similar Messages

  • Invoking servlet from mDB

    Hi all;
    this is the process.
    1. Servlet received / creates msg.
    2. Servlet Enqueues Msg on JMS queue.
    3. MDB dequeues.
    -- processes against DB
    -- composes respoonse.
    4. mdb invokes servlet with response.
    servlet need not maintain state.
    State information can be passed in Msg (Query and Response)
    I was just wanting to find out if this possible in oc4j.
    apparently, there is a process in weblogic 6.1 to support this.
    Any help is appreciated.
    thanks.
    jayant

    I would assume that you would need to do a "createSipApplicationSession" on your sip factory and then get the ID from there.
    Then create a request from your session and send it.
    Wouldn't you want each outgoing call to be associated with a different sip app session?

  • How to configure IIS webserver with weblogic so that I can invoke servlets without the .wlforward extension

    How to configure IIS webserver with weblogic so that I can
    invoke servlets without the .wlforward extension
    As per the documentation iisforward.dll is registered as a filter and .wlforward
    has also been
    included as a special file type. However this requires me to key-in ".wlforward"
    after my servlet name.
    What I want is something like this
    http://iis/MyServlet
    Please help me find a solution to this
    Thanks,
    Rishi

    I am able to invoke the servlet without the wlforward extension now.
    However, now I am required to add /weblogic before the servlet
    name otherwise it does not execute the pathtrim property.
    I have tried with the pathprepend thing also.
    Can we get rid of the /weblogic part also. I just want to execute
    my servlet as http://iis/myServlet.
    Your help in this regard is greatly appreciated...
    Thanks..
    "Rishi" <[email protected]> wrote:
    >
    Thanks for the reply Kumar.
    I did follow the instructions as given in the Weblogic documentation
    The documentation said to add iisforward.dll as a filter service
    and register .wlforward as a special
    file type to be handled by iisproxy.dll. For this,
    while configuring the IIS server in the Home Directory tab
    I added an extension ".wlforward" and the executable as
    iisproxy.dll. Is this the way it should have been done...
    I also modified the iisproxy.ini file as per the documentation.
    I have added the WLForwardPath property and set it to /weblogic.
    My server works fine when I give the url as
    http://iis/myServlet.wlforward
    but it does not work for
    http://iis/myServlet and this is the way i'd want it to work.
    Please tell me if I am missing something on the configuration part
    and if there is something special that needs to be done. I shall
    be grateful to you.
    Kumar Allamraju <[email protected]> wrote:
    http://e-docs.bea.com/wls/docs61/adminguide/isapi.html#101184
    Rishi wrote:
    How to configure IIS webserver with weblogic so that I can
    invoke servlets without the .wlforward extension
    As per the documentation iisforward.dll is registered as a filter
    and
    .wlforward
    has also been
    included as a special file type. However this requires me to key-in".wlforward"
    after my servlet name.
    What I want is something like this
    http://iis/MyServlet
    Please help me find a solution to this
    Thanks,
    Rishi

  • Invoke-WebRequest with JSP forms

    Hi everyone,
    I am a newbie with PowerShell struggling to write a script that posts information to a JSP Web application.
    My script should be divided in two parts : 
    ########### The first should authenticate to the admin page (the form bellow)
    <form name="loginoath" id="loginoath" action="../servlet/UserRequestServlet" method="post" autocomplete="off">
    <input type="hidden" name="action"
        value="auth">
    <input type="hidden" name="authtype" id="authtype"
        value="oath">
    <input type="hidden" name="authformat"
        value="pwd">
    <input type="hidden" name="opensess"
        value="true">
    <input type="hidden" name="version"
        value="3.0">
    <input type="hidden" name="forwardtype"
        value="relativeurl">
    <input type="hidden" name="successurl" value="/adminportal/index.jsp">
    <input type="hidden" name="errorurl" value="/adminportal/login_oath.jsp">
        <tr valign="middle" class="display_row" id='authoption'>
            <td class="form_label">
                <span class="help_spot" onMouseOver="loadHelp('Select\x20\x3Cb\x3EPassword\x3C\x2Fb\x3E\x20to\x20log\x20in\x20with\x20your\x20user\x20ID\x20and\x20password\x20only.\x3Cbr\x3E\x3Cbr\x3ESelect\x20\x3Cb\x3EOTP\x3C\x2Fb\x3E\x20to\x20log\x20in\x20with\x20your\x20user\x20ID,\x20password,\x20and\x20a\x20one\x2Dtime\x20password\x20\x28OTP\x29\x20generated\x20from\x20your\x20device.')">
                    Authenticate by:
                </span>
            </td>
            <td class="form_field_cell">
                <input type="radio" name="authByOTP" id="authByOTP" value="yes" checked onclick="onChangeAuth()"> OTP&nbsp;
                <input type="radio" name="authByOTP" id="authByOTP" value="no"  onclick="onChangeAuth()" > Password&nbsp;
            </td>
        </tr>
        <tr valign="middle">
            <td class="form_label">
            <span class="help_spot" onMouseOver="loadHelp('Enter\x20the\x20user\x20ID\x20that\x20you\x20want\x20to\x20log\x20in\x20with.\x3Cbr\x3E\x3Cbr\x3EThe\x20user\x20ID\x20is\x20a\x20unique\x20alphanumeric\x20string\x20that\x20identifies\x20a\x20user.\x20It\x20is\x20assigned\x20when\x20the\x20user\x20record\x20is\x20created.')">
            User ID:</span>
            </td>
            <td>
                <input type="text" name="j_username" id="j_username" size="20" maxlength="50" tabindex="1" class="form_field">
            </td>
        </tr>
        <tr valign="middle">
            <td class="form_label">
            <span class="help_spot" onMouseOver="loadHelp('Enter\x20the\x20password\x20for\x20your\x20login\x20user\x20ID.\x3Cbr\x3E\x3Cbr\x3EThe\x20password\x20is\x20a\x20private\x20character\x20string\x20that\x20verifies\x20the\x20user\x20ID.\x20After\x20login,\x20this\x20password\x20can\x20be\x20changed.')">
            Password:</span>
            </td>
            <td>
                <input type="password" name="j_pin" id="j_pin" size="20" maxlength="50" tabindex="2" class="form_field">
            </td>
        </tr>
        <tr valign="middle" id="otp_section">
            <td class="form_label">
            <span class="help_spot" onMouseOver="loadHelp('Generate\x20a\x20one\x2Dtime\x20password\x20\x28OTP\x29\x20with\x20the\x20device\x20you\x20are\x20using\x20for\x20login,\x20and\x20enter\x20the\x20value\x20in\x20the\x20field.\x20Connected\x20devices\x20generate\x20and\x20enter\x20the\x20OTP\x20value\x20automatically\x20when\x20you\x20click\x20\x3Cb\x3EGet\x20OTP\x3C\x2Fb\x3E.\x3Cbr\x3E\x3Cbr\x3EConsult\x20your\x20device\x20documentation\x20for\x20instructions\x20on\x20how\x20to\x20generate\x20an\x20OTP.')">
            OTP:</span>
            </td>
            <td>
                <input type="text" name="j_password" id="j_password" size="20" maxlength="50" tabindex="3" class="form_field">
                <a href="javascript:gemalto.otpplugin.getOTPsAndPANForCustomButton();" class="form_button" onMouseOver="loadHelp('Click\x20this\x20button\x20to\x20generate\x20and\x20enter\x20the\x20one\x2Dtime\x20password\x20\x28OTP\x29\x20value\x20automatically\x20with\x20your\x20connected\x20device.\x3Cbr\x3E\x3Cbr\x3EBe\x20sure\x20that\x20your\x20device\x20is\x20plugged\x20in\x20and\x20connected\x20to\x20your\x20computer\x20before\x20trying\x20to\x20generate\x20the\x20OTP.')"/>Get
    OTP</a>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <div class="form_separator"><img src="../img/spacer.gif"
                width="1" height="1"></div>
            </td>
        </tr>
        <tr valign="middle">
            <td colspan="2" align="center">
            <input type="submit" tabindex="4" id="login_button" name="submit" value="LOGIN" class="form_button" onMouseOver="loadHelp('When\x20you\x20have\x20entered\x20information\x20in\x20all\x20fields,\x20click\x20this\x20button\x20to\x20authenticate\x20your\x20user\x20ID\x20and\x20log\x20in\x20to\x20the\x20Customer\x20Care\x20Portal.')"
    onClick="return checkFields();">
            </td>
        </tr>
      </form>
    ########### The second should fill the form with new information and validate them (the form bellow)
    <form name="userform" action="user_migrate.jsp" method="POST" autocomplete="off">
        <tr>
            <td colspan="2" class="form_text" align="left">
                Fields marked with an asterisk <font color='red'><big>*</big></font> are required.
            </td>
        </tr>
        <tr valign="middle">
            <td class="form_label"><font color="red"><big>*</big></font>
            <span class="help_spot" onMouseOver="loadHelp('User\x20ID\x20field.\x20The\x20User\x20ID\x20is\x20a\x20unique\x20alphanumeric\x20string\x20chosen\x20to\x20identify\x20a\x20user.')">
            User ID:</span>
            </td>
            <td>
                <input type="text" name="userid" value="" size="26" class="form_field">
            </td>
        </tr>
           <tr id="pwdguideline">
                <td class="form_label"> &nbsp;</td>
            <td class="form_text" align="left">
                A valid password is case-sensitive and must: <br>&nbsp;-&nbsp; consists of 6 characters or more<br>&nbsp;-&nbsp; include at least 1 alphabetic character<br>&nbsp;-&nbsp;
    include at least 1 numeric character<br>&nbsp;-&nbsp; not include white space<br>
            </td>
        </tr>
            <input type="hidden" name="password" value=""/>
        <tr>
            <td class="form_label"><font color="red"><big>*</big></font>
            <span class="help_spot" onMouseOver="loadHelp('First\x20security\x20answer\x20field.\x20The\x20security\x20answers\x20are\x20answers\x20to\x20personal\x20questions\x20used\x20to\x20validate\x20a\x20user\x5C\x27s\x20identity\x20in\x20case\x20the\x20user\x20loses\x20his\x20or\x20her\x20password.')">
            What is your mother's maiden name?:</span>
            </td>
             <td>
                <input type="text" name="answer1" value="" size="26" class="form_field">
            </td>        
        </tr>
        <tr>
        <td class="form_label"><font color="red"><big>*</big></font>
            <span class="help_spot" onMouseOver="loadHelp('Second\x20security\x20answer\x20field.\x20The\x20security\x20answers\x20are\x20answers\x20to\x20personal\x20questions\x20used\x20to\x20validate\x20a\x20user\x5C\x27s\x20identity\x20in\x20case\x20the\x20user\x20loses\x20his\x20or\x20her\x20password.')">
            What is your date of birth?:<br>(yyyy-mm-dd)</span>
            </td>
             <td>
                <input type="text" name="answer2" value="" size="26" class="form_field">
            </td>  
        </tr>   
        <tr>
        <td class="form_label"><font color="red"><big>*</big></font>
            <span class="help_spot" onMouseOver="loadHelp('Role\x20field.\x20Refers\x20to\x20the\x20role\x20associated\x20with\x20the\x20user.\x20A\x20role\x20is\x20identified\x20by\x20its\x20unique\x20role\x20name\x20and\x20defines\x20what\x20functions\x20are\x20available\x20to\x20its\x20associated\x20users.')">
            Role:</span>
            </td>
              <td class="form_text">
                <select name="rolename" class="form_select" single>
                   <option value="Admin" >Admin</option>
                   <option value="Agent" >Agent</option>
                   <option value="Default" selected>Default</option>
                   <option value="Support" >Support</option>
                 </select>
                </td>
             </tr>
        <tr>
            <td class="form_label">
            <span class="help_spot"
                  onMouseOver="loadHelp('Sends\x20the\x20user\x20an\x20email\x20with\x20a\x20link\x20to\x20download\x20the\x20selected\x20application.\x20Email\x20must\x20be\x20filled\x20and\x20a\x20separate\x20mail\x20will\x20be\x20sent\x20per\x20application\x20selected.')">
            Initiate Token registration:</span>
            </td>
            <td class="form_field_cell">
                &nbsp;&nbsp;
                <input type="checkbox" name="initMobileapptokenReg" value="true" class="form_field_cell" >
                IDProve 300 Mobile
                &nbsp;&nbsp;
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <div class="form_separator"><img src="../img/spacer.gif"
                width="1" height="1"></div>
            </td>
        </tr>
        <tr valign="middle">
            <td colspan="2" align="center">
            <input type="submit" name="submituserform" value="MIGRATE" class="form_button" onMouseOver="loadHelp('Create\x20a\x20new\x20record.')" onClick="return validateForm()"
    >
            <input type="Reset" name="resetuserform" value="START OVER" class="form_button" onMouseOver="loadHelp('Reset\x20the\x20form.')">   
            </td>
        </tr>
        <input type="hidden" name="posting" value="true">
    </form>
    ############ Here is my Powershell Script
    [System.Net.ServicePointManager]::CheckCertificateRevocationList = $false;
    [System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $true; };
    Add-Type @"
      using System.Net;
      using System.Security.Cryptography.X509Certificates;
      public class TrustAllCertsPolicy : ICertificatePolicy {
         public bool CheckValidationResult(
          ServicePoint srvPoint, X509Certificate certificate,
          WebRequest request, int certificateProblem) {
          return true;
    [System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
    [System.Net.ServicePointManager]::CheckCertificateRevocationList = $false;
    [System.Net.ServicePointManager]::ServerCertificateValidationCallback = { $true; };
    # Authentication
    $url1 = 'https://localhost/login.jsp'
    $param1 = @{ authByOTP='no'; j_username='test'; j_pin='test' }
    Invoke-WebRequest -Uri $url1 -SessionVariable CurrentSession -Method Post -Body $param1 -ContentType "text/xml"
    # Registration
    $AccountName ="test2"
    $Reponse1 ="replyOne"
    $Reponse2 = "replyTwo"
    $Role ="Default"
    $IDProve ="False"
    $Post = "MIGRATE"
    $url2 = 'https://localhost/registration.jsp'
    $parametre2 = @{ userid=$AccountName; answer1=$Reponse1; answer2=$Reponse2; rolename=$Role;               'initMobileapptokenReg'=$IDProve; submituserform=$Post; }
    Invoke-WebRequest -Uri $url2 -SessionVariable CurrentSession -Method Post -Body $parametre2 -ContentType "text/xml"
    When I run it, I get this status
    StatusCode        : 200
    StatusDescription : OK
    Content           :
    But nothing happens when I check the result.
    I will be grateful if someone can help. Thanks in advance.
    Regards,
    Louban.

    Hi Louban,
    To run the cmdlet "Invoke-WebRequest" with .jsp file, the script is for your reference:
    # variables for the script
    $YellowLevel = 14
    $RedLevel = 7
    $SleepHours = 1
    # change window title
    $Host.UI.RawUI.WindowTitle = "QAS DB Expiry Checker"
    # loop indefinitely
    while($true){
    #get web page
    $Page = (Invoke-WebRequest "http://qaswebserver.rcmtech.co.uk:8080/proweb/test.jsp").Content # look for text on web page using regular expression
    if($Page -match "[0-9]+ days"){
    # get matching text string from full web page text
    $FullText = (Select-String -InputObject $Page -Pattern "[0-9]+ days").Matches.Value
    Write-Host (get-date),"QAS remaining: $FullText - " -NoNewline
    # get just the number of days
    $DaysString = (Select-String -InputObject $FullText -Pattern "[0-9]+").Matches.Value
    # convert number of days to integer to allow numeric matching operations, e.g. "greater than"
    $DaysInteger = [convert]::ToInt16($DaysString)
    # interrogate the number of days and set status based on what its value is
    switch($DaysInteger){
    {$_ -gt $YellowLevel} {
    Write-Host "Green" -ForegroundColor Green
    {($_ -le $YellowLevel) -and ($_ -gt $RedLevel)} {
    Write-Host "Yellow" -ForegroundColor Yellow
    {$_ -le $RedLevel} {
    Write-Host "Red" -ForegroundColor Red
    } else {
    # page did not contain expected text
    Write-Host "Error with page" -ForegroundColor Yellow
    # wait for specified time
    Start-Sleep -Seconds ($SleepHours * 60 * 60)
    Refer to:
    PowerShell: QuickAddress Pro data expiry checker
    If there is anything else regarding this matter, please feel free to post back.
    Best Regards,
    Anna Wang

  • ERROR RENDERING PDF IN SERVLET WITH FORM method="post"

    Hello,
    we are trying to render a dinamic PDF document in a servlet building with XSL:FO apache or itext.
    The problem ocurs when we sending a Form data with method post, the output of the servlet is a blank page instead of the pdf document. Also if we send the form data with method "get" we can view the pdf document corretly.
    But we need to send amount information, and can?t use method get.
    Thank

    You can always use GET to send information by generating a dynamic URL in the query string (after the '?'). Granted, you don't want to send file data that way, but it will work for small numbers of arguments where privacy is not a concern.
    As to why you see the PDF in one instance and not another, I'm not sure. There is no difference from an HTTP standpoint. You sent a request, you are getting a response. The browser should treat the response the same, regardless of GET vs POST.
    Are you setting the content-type to application/pdf? Are you doing something fishy with Javascript? Do you have conditional logic in your code that fires on a POST but not on a GET that actually has a bug in it (since GET works but it was designed for POST)?
    - Saish
    "My karma ran over your dogma." - Anon

  • Servlet with HTML using JDBC lookup

              Dear Friends
              How are you?
              I am designing a servlet with two drop down lists one on top and the other below.
              I implemented drop down lists using dynamic embedded HTML and SELECT tags.
              I want the user to make a selection in the first drop down list, and the second
              drop down list should display a list based on the selection made in the first
              drop down list.
              Please comment in detail on the most efficient way of achieving this.
              Thanking you
              Very truly yours
              Sriram (Ram) Peddibhotla, PhD
              

    For this I'd probably load all the values for both drop down list and use
              javascript.
              Tinou Bao
              www.tinou.com
              "Sriram (Ram) Peddibhotla" <[email protected]> wrote in message
              news:3b181cd0$[email protected]..
              >
              > Dear Friends
              >
              > How are you?
              >
              > I am designing a servlet with two drop down lists one on top and the other
              below.
              > I implemented drop down lists using dynamic embedded HTML and SELECT tags.
              >
              > I want the user to make a selection in the first drop down list, and the
              second
              > drop down list should display a list based on the selection made in the
              first
              > drop down list.
              >
              > Please comment in detail on the most efficient way of achieving this.
              >
              > Thanking you
              > Very truly yours
              > Sriram (Ram) Peddibhotla, PhD
              

  • Calling servlet with out entry in web.xml

    Hi
    I want to know whether can a servlet be invoked with out having an entry in web.xml.Because to my knowledge when ever an entry is made in teh web.xml the <url-pattern> and the class file will be stored as key value combination it is only then when ever a request is made the server gets the class taht is to be invoked from the <url-pattern> that is passed from the client side.
    Is ther any way by whihc we can call the servlet directly with out an entry in web.xml
    Thanks in advance
    Ajithkumar.S

    Interesting that it is possible on Tomcat anyway.
    What's the real benefit of not having a Servlet
    definied in web.xml?
    The only benefit I see is that
    you don't need to understand/read/change XML when
    adding or removing a servlet. That isn't worth that
    imho. What are the other benefits?The only thing I can think of is , to be able to quickly access a Servlet that you've just written, because it takes additional steps to define it in the web.xml.
    I think it would be a security concern (of some sort) , if the Servlet's class is known, that's why it is better to access a Servlet with a mapping from web.xml

  • Passing parameter from Servlet to javascript in JSP. Very Urgent - 5 jukes!

    Well my servlet will retrieve questions from database.
    Then the player will answer the question in the JSP and submit the answer to the servlet to process.
    Each time an answer is submitted, or a "Next Question" button is clicked, the countdown time will restart.
    And will reload the page with a new question.
    So how can i do that?
    This is my servlet, JSP, javascript
    =====================================================================
    * Interacts with the player depending on his types of selection and output them
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    public class GameQuestionServlet extends HttpServlet
         String sSQL = null;
         String sCategory = null;
         String paramName = null;
         User userObject = null;
         Questions gameQsObj = new Questions();
         HttpSession session;
         int cnt = -1;
         int score = 0;
         boolean connected = false;
         public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              session = request.getSession(false);
              //System.out.println("Testing Score:" + score);
              if(connected == true)
                   Questions object = (Questions)gameQsObj.getQsList().elementAt(cnt);
                   System.out.println("\n" + object.sAns1);
                   System.out.println(object.sAns2);
                   System.out.println(object.sAns3 + "\n");
                   Enumeration enum = request.getParameterNames();
                   while(enum.hasMoreElements())
                        paramName = (String)enum.nextElement();
                        if(paramName.equals("mcq"))
                             System.out.println(request.getParameter("mcq"));
                             score = Integer.parseInt(userObject.score.trim());
                             System.out.println("Player old score: " + score);
                             //Check to see if the selected answer matches the correct answer
                             if((object.sCorrect).equals(request.getParameter("mcq")))
                                  score = score + 10;
                             else
                                  if((object.sCorrect).equals(request.getParameter("mcq")))
                                       score = score + 10;     
                                  else
                                       if((object.sCorrect).equals(request.getParameter("mcq")))
                                            score = score + 10;     
                                       else
                                            score = score - 10;     
              System.out.println("Player current score: " + score);
              else     //will only go into this once
                   userObject = (User)session.getAttribute("user");
                   System.out.println("\n"+userObject.nric);
                   System.out.println(userObject.name);
                   System.out.println(userObject.password);
                   System.out.println(userObject.email);
                   System.out.println(userObject.score+"\n");
                   //depending on user selection
                   sCategory = request.getParameter("qsCategory");
                   sSQL = "SELECT * FROM " + sCategory;
                   gameQsObj.getQuestions(sSQL, sCategory);
                   score = Integer.parseInt(userObject.score);
                   connected = true;
              System.out.println("Connected:" + connected);
              System.out.println("Before:" + userObject.score);
              cnt = cnt + 1; //increment to retrieve next question
              userObject.score = Integer.toString(score);     
              System.out.println("After:" + userObject.score);
              if(cnt < 3) //setting for the number of questions per game.
                   //request.setAttribute("qsCnt", cnt); //count of the question number
                   request.setAttribute("aQs", gameQsObj.getQsList().elementAt(cnt));
                   System.out.println(request.getAttribute("aQs"));
                   System.out.println("This is question number: "+ cnt);
                   getServletConfig().getServletContext().getRequestDispatcher("/JSP/PlayGame.jsp").forward(request, response);
              else
                   //forward to the result page     
         public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              doPost(request, response);
    <%@ page import="Questions" %>
    <HTML>
         <HEAD>
              <TITLE>Play Game</TITLE>
              <SCRIPT LANGUAGE="JavaScript">
                   var refreshinterval=10
                   var displaycountdown="yes"
                   var starttime
                   var nowtime
                   var reloadseconds=0
                   var secondssinceloaded=0
                   function starttime() {
                        starttime=new Date()
                        starttime=starttime.getTime()
                        countdown()
                   function countdown() {
                        nowtime= new Date()
                        nowtime=nowtime.getTime()
                        secondssinceloaded=(nowtime-starttime)/1000
                        reloadseconds=Math.round(refreshinterval-secondssinceloaded)
                        if (refreshinterval>=secondssinceloaded) {
                   var timer=setTimeout("countdown()",1000)
                             if (displaycountdown=="yes") {
                                  window.status="You have "+reloadseconds+ " second before timeout"
                   else {
                        hide();
                   clearTimeout(timer)
                             //window.location.reload(true)
                   function hide() {
                        //hidelayer
                        if(gameLayers.style.visibility == "visible"){
                             gameLayers.style.visibility = "hidden"
                             oops.style.visibility = "show"
                   window.onload=starttime
              </SCRIPT>
         </HEAD>
         <BODY>
              <FORM METHOD="post" ACTION="http://localhost:8080/Java_Assignment2/servlet/GameQuestionServlet">
                   <DIV ID="oops" STYLE="position:absolute; left:300px; top:30px; width:120px; height:150px; z-index:2; visibility:hidden">
                        Oops! 30 seconds time up!!! <BR><BR>
                        <INPUT TYPE="submit" VALUE="Next Question">
                        <INPUT TYPE="hidden" NAME="nextQs" VALUE="Next Question">
                   </DIV>
                   <DIV ID="gameLayers" STYLE="position:absolute; left:300px; top:30px; width:120px; height:150px; z-index:3; visibility:show">
                   <TABLE BORDER="0">
                        <TR>
                             <TH><BIG>Questions:</BIG></TH>
                        </TR>
    <%
                        Questions aQsObj = (Questions)request.getAttribute("aQs");
                        String aQsBody = aQsObj.sQs;
                        String aQsAns1 = aQsObj.sAns1;
                        String aQsAns2 = aQsObj.sAns2;
                        String aQsAns3 = aQsObj.sAns3;
    %>
                        <TR>
                             <TD><B><%= aQsBody%></B></TD>
                        </TR>
                        <TR>
                             <TD>
                                  <SELECT SIZE="3" NAME="mcq">
                                       <OPTION SELECTED><%= aQsAns1 %></OPTION>
                                       <OPTION><%= aQsAns2 %></OPTION>
                                       <OPTION><%= aQsAns3 %></OPTION>
                                  </SELECT><BR><BR>
                             </TD>
                        </TR>
                        <TR>
                             <TD>
                                  <INPUT TYPE="submit" VALUE="Submit Your Answer">
                                  <INPUT TYPE="hidden" NAME="submitAns" VALUE="Submit Your Answer">
                             </TD>
                        </TR>
                   </TABLE>
                   </DIV>
              </FORM>
         </BODY>
    </HTML>
    This must be answered before 28th of september.
    Please help. It is indeed very urgent.

    this is just a skeleton code.. alot of stuff is not here..
    <FORM name = "form1" action="../servlet/wateverSevlet>
    <input type="text" name="searchStr" size="40">
    <INPUT type="hidden" id=answer name=answer size=7>
    <input type="button" name="button" value="Submit Answer" onClick="javascript:submitCheck(document.form1.searchStr.value);">
    <input type="button" name="button" value="Skip Question" onClick="javascript:submitCheck('skip');">
    </form>
    <SCRIPT LANGUAGE="JavaScript">
    function submitCheck(str)
      form1.answer.value = str
      form1.submit()
    </script>i assuming you are submitting it to the same servlet regardless of whether the user clicks the skip question or the submit question button.

  • Re: How do I invoke Servlets...continued

    Hi Howard,
              Could you show us web.xml?
              Regards,
              Slava Imeshev
              "Howard Hyde" <[email protected]> wrote in message
              news:3ccedf8a$[email protected]..
              > My posting appears to have been truncated, so here is the remainder:
              > (continued)
              > 'Pilot' is a servlet defined and mapped in my web.xml file. But when I
              attempt
              > to invoke the servlet in the app with any of the following:
              > http://localhost:7001/pilots/Pilot
              > http://localhost:7001/pilots/pilot
              > http://localhost:7001/pilots/servlet/Pilot
              > http://localhost:7001/pilots/servlet/pilot
              >
              > ... I get a 404 error.
              >
              > However, the following JSP, which is part of the same web application
              component
              > of the Enterprise app, works:
              > http://localhost:7001/pilots/Rating.jsp
              >
              > So the question of the day once again, is:
              >
              > How do I invoke servlets in an enterprise application?
              >
              > Best regards,
              >
              > Howard
              > 818-366-2686
              

    and to add to matt's post:
              in the servlet init() method trace out some debug to ensure that new
              versions of your servlet are actually being deployed:
              ..init() {
              System.out.println( getServletName() + " was deployed at " + " new
              Date(System.currentTimeMillis()) );
              "Matt Krevs" <[email protected]> wrote in message
              news:[email protected]...
              > 1. What stack trace do you receive, if any, when your call to your servlet
              > doesnt work
              >
              > 2. Is your servlet in a package? If it is then you need to specify the
              > package in the servlet-class element
              >
              > 3. Is it possible that your servlet-name and/or servlet-class elements in
              > web.xml have some spaces in them? Maybe you should remove the line feeds
              > etc. and specify your servlet elements as you have your servlet-mapping
              > elements
              >
              > eg like this
              >
              > <servlet>
              > <servlet-name>Pilot</servlet-name>
              > <servlet-class>FrmPilot2</servlet-class>
              > <load-on-startup>0</load-on-startup>
              > </servlet>
              >
              > 4. Do you get any deployment errors when weblogic starts up?
              >
              > 5. Try setting the load-on-startup parameter to a positive number. You may
              > receive a helpful? stacktrace when weblogic starts up
              >
              >
              > "Howard Hyde" <[email protected]> wrote in message
              > news:[email protected]...
              > > The following are EXCERPTS from the web.xml file:
              > >
              > > <web-app>
              > > <servlet>
              > > <servlet-name>
              > > Pilot
              > > </servlet-name>
              > > <servlet-class>
              > > FrmPilot2
              > > </servlet-class>
              > > <load-on-startup>
              > > 0
              > > </load-on-startup>
              > > </servlet>
              > > <servlet-mapping>
              > > <servlet-name>Pilot</servlet-name>
              > > <url-pattern>/Pilot</url-pattern>
              > > </servlet-mapping>
              > >
              > > </web-app>
              > >
              > >
              >
              >
              

  • How do I invoke Servlets...continued

    My posting appears to have been truncated, so here is the remainder:
              (continued)
              'Pilot' is a servlet defined and mapped in my web.xml file. But when I attempt
              to invoke the servlet in the app with any of the following:
              http://localhost:7001/pilots/Pilot
              http://localhost:7001/pilots/pilot
              http://localhost:7001/pilots/servlet/Pilot
              http://localhost:7001/pilots/servlet/pilot
              ... I get a 404 error.
              However, the following JSP, which is part of the same web application component
              of the Enterprise app, works:
              http://localhost:7001/pilots/Rating.jsp
              So the question of the day once again, is:
              How do I invoke servlets in an enterprise application?
              Best regards,
              Howard
              818-366-2686
              

    My posting appears to have been truncated, so here is the remainder:
              (continued)
              'Pilot' is a servlet defined and mapped in my web.xml file. But when I attempt
              to invoke the servlet in the app with any of the following:
              http://localhost:7001/pilots/Pilot
              http://localhost:7001/pilots/pilot
              http://localhost:7001/pilots/servlet/Pilot
              http://localhost:7001/pilots/servlet/pilot
              ... I get a 404 error.
              However, the following JSP, which is part of the same web application component
              of the Enterprise app, works:
              http://localhost:7001/pilots/Rating.jsp
              So the question of the day once again, is:
              How do I invoke servlets in an enterprise application?
              Best regards,
              Howard
              818-366-2686
              

  • Invoker servlet

    Hi,
    I am interested in knowing why we should avoid invoker servlets?
    what are short comings of invoker servlet?
    ( Yes for invoker servlets completer path up to servlet is to be given)
    Thanks

    The Invoker servlet is a built int servlet mapped such that allows you to invoke any servlet by using the URL: /servletPackage/servletClassName. While this is good to get started and to know, you should never use it in a production environment.
    If you give password protected access to a folder, say Employees and map a servlet to /Employees/MyServlet, the servlet is also protected. Only people with the authorized username/password combinations can run the servlet. But if you allow the default mapping with the Invoker servlet, then the same servlet will also be accessible to everyone as /servlet/MyServlet in which case your authorization fails and everyone has access to your servlet's functionality, potentially modifying data etc.
    This is only the authorization aspect. Other than this, the Invoker servlet makes it hard for you to hide your actual package/ classnames. Other features like init parameters and filters are also not possible in this case.
    This is why you should NOT use the Invoker servlet. Even the Tomcat FAQ says you should not.
    Read more here:
    [1] http://faq.javaranch.com/view?InvokerServlet
    [2] http://jakarta.apache.org/tomcat/faq/misc.html#evil
    P.S. a_joseph also had a valid point and he gave you the same link also.
    People on the forum help others voluntarily, it's not their job.
    Help them help you.
    Learn how to ask questions first: http://www.catb.org/~esr/faqs/smart-questions.html
    ----------------------------------------------------------------

  • Got RuntimeException when using with Javascript

    I am trying to configure Portal to use DHTMLX Grid Javascript. I configured Render Dependencies as per http://download.oracle.com/docs/cd/E13218_01/wlp/docs102//clientdev/setup.html#wp1020281 guideline.
    My path to the javascript is WebContent | dhtmlx | codebase | javascrpit.js files here
    The portal and portlet are at WebContent root folder.
    My .dependencies file looks like this:
    <render-dependencies>
    <html>
    <links>
    <search-path>
    <path-element>../dhtmlx</path-element>
    </search-path>
    <link href="dhtmlxgrid.css" type="text/css" rel="stylesheet"/>
    </links>
    <scripts>
    <search-path>
    <path-element>../dhtmlx</path-element>
    </search-path>
    <script type="text/javascript" src="codebase/dhtmlxcommon.js"></script>
                   <script type="text/javascript" src="codebase/dhtmlxgrid.js"></script>
                   <script type="text/javascript" src="codebase/dhtmlxgridcell.js"></script>
    </scripts>
    </html>
    </render-dependencies>
    And the error I got is:
    com.bea.netuix.servlets.controls.application.laf.LookAndFeelIOException: Exception while initiating window .dependencies file from path [jsfPortlet.dependencies]
         at com.bea.netuix.servlets.controls.application.laf.ConfigurationTools.loadWindowSkinConfiguration(ConfigurationTools.java:933)
         at com.bea.netuix.servlets.controls.application.laf.ConfigurationTools.loadWindowConfiguration(ConfigurationTools.java:270)
         at com.bea.netuix.servlets.controls.application.LookAndFeel.renderSetup(LookAndFeel.java:995)
         at com.bea.netuix.nf.ControlTreeWalker.walk(ControlTreeWalker.java:199)
         at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:395)
         at com.bea.netuix.nf.Lifecycle.processLifecycles(Lifecycle.java:361)
         at com.bea.netuix.nf.Lifecycle.runOutbound(Lifecycle.java:208)
         at com.bea.netuix.nf.Lifecycle.run(Lifecycle.java:168)
         at com.bea.netuix.servlets.manager.UIServlet.runLifecycle(UIServlet.java:388)
         at com.bea.netuix.servlets.manager.UIServlet.doPost(UIServlet.java:258)
         at com.bea.netuix.servlets.manager.UIServlet.doGet(UIServlet.java:211)
         at com.bea.netuix.servlets.manager.UIServlet.service(UIServlet.java:196)
         at com.bea.netuix.servlets.manager.SingleFileServlet.service(SingleFileServlet.java:251)
         at com.bea.netuix.servlets.manager.PortalServlet.service(PortalServlet.java:686)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at com.bea.portal.tools.servlet.http.HttpContextFilter.doFilter(HttpContextFilter.java:60)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at com.bea.p13n.servlets.PortalServletFilter.doFilter(PortalServletFilter.java:336)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
         at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3502)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2186)
         at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2092)
         at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Caused by: java.io.IOException
         at com.bea.netuix.servlets.util.WebAppResourceLoader$DefaultWebAppResourceLoader.getResource(WebAppResourceLoader.java:422)
         at com.bea.netuix.servlets.controls.application.laf.ConfigurationTools.loadWindowSkinConfiguration(ConfigurationTools.java:904)
         ... 33 more
    Caused by: java.lang.RuntimeException: The paths [] and [../dhtmlx\] could not be combined.
         at com.bea.netuix.servlets.controls.util.ConfigUtil.getCombinedPaths(ConfigUtil.java:144)
         at com.bea.netuix.servlets.controls.util.ConfigUtil.combinePaths(ConfigUtil.java:54)
         at com.bea.netuix.servlets.controls.util.ConfigUtil.combinePaths(ConfigUtil.java:49)
         at com.bea.netuix.servlets.controls.application.laf.ConfigurationTools.qualifySearchPath(ConfigurationTools.java:1054)
         at com.bea.netuix.servlets.controls.application.laf.DependenciesConfiguration.readLinks(DependenciesConfiguration.java:193)
         at com.bea.netuix.servlets.controls.application.laf.DependenciesConfiguration.readHtml(DependenciesConfiguration.java:162)
         at com.bea.netuix.servlets.controls.application.laf.DependenciesConfiguration.readRenderDependencies(DependenciesConfiguration.java:138)
         at com.bea.netuix.servlets.controls.application.laf.DependenciesConfiguration.load(DependenciesConfiguration.java:68)
         at com.bea.netuix.servlets.controls.application.laf.WindowConfiguration.read(WindowConfiguration.java:90)
         at com.bea.netuix.servlets.controls.application.laf.WindowConfiguration.load(WindowConfiguration.java:78)
         at com.bea.netuix.servlets.controls.application.laf.ConfigurationTools$WindowStreamProcessor.process(ConfigurationTools.java:1372)
         at com.bea.netuix.servlets.controls.application.laf.ConfigurationTools$WindowStreamProcessor.process(ConfigurationTools.java:1321)
         at com.bea.netuix.servlets.util.WebAppResourceLoader$DefaultWebAppResourceLoader$Generator.generateValue(WebAppResourceLoader.java:537)
         at com.bea.netuix.servlets.util.ConcurrentCache.get(ConcurrentCache.java:214)
         at com.bea.netuix.servlets.util.WebAppResourceLoader$DefaultWebAppResourceLoader.getResource(WebAppResourceLoader.java:413)
         ... 34 more
    *Caused by: java.lang.RuntimeException: The paths [] and [../dhtmlx\] could not be combined.*
    The guideline state that "The <path-element> must be a relative reference from the render dependencies file to the directory that contains the script sources referenced by the <script> tags."
    What did I do wrong here?
    Edited by: user5767041 on Sep 25, 2009 1:50 PM
    Edited by: user5767041 on Sep 25, 2009 1:51 PM
    Edited by: user5767041 on Sep 25, 2009 1:52 PM
    Edited by: user5767041 on Sep 25, 2009 1:52 PM

    HI,
    what version of javascript your are using.
    Try to use latest version of javascript where its can support for xhtml.
    But looking at the error I dont think it would be issue with javascript it say some thing different.
    can you be more brief so that it could be more clear for us.
    Regards,
    Kal.

  • Open and Close Popup With Javascript

    Using Apex 3.2
    I have probably done this loads of times in my old job, but do not have access to the code and today I just can't get it to work properly.
    I have opened a pop up window with javascript
    Now I need to close it and refresh the calling page, but only if it passes the validation on the popup.
    I have a hidden item on my pop up called P7_FLAG.
    I have a page process after validation that sets P7_FLAG to (only set to 1, if passes validation).
    I also have a SUBMIT button.
    So once I click my SUBMIT button the page should look at the validations, if ok, set P7_FLAG to 1, then close the popup and refresh the calling page.
    My current javascript look like this
    <script type="text/javascript">
    function saveChanges(){
    doSubmit('SUBMIT');
    var test = $x('P7_FLAG').value;
    if(test == '1')
    window.close();
    window.opener.doSubmit('REFRESH');
    </script>On my button
    javascript:saveChanges();The problem is that I need to click the SUBMIT button twice.
    First time it sets P7_FLAG
    Second time it closes page and refreshes.
    I have probably made some basic error, but today I cannot see it.
    Cheers
    Gus
    Edited by: Gus C on May 10, 2012 12:48 AM

    <script type="text/javascript">
    function saveChanges(){
    doSubmit('SUBMIT');
    var test = $x('P7_FLAG').value;
    if(test == '1')
    window.close();
    window.opener.doSubmit('REFRESH');
    </script>javascript does not wait for the current action to complete and then perform the next line.
    means in your function call
    doSubmit('SUBMIT');is triggered and it carry on's to next line that is
    $x('P7_FLAG').value;this will not be set because you are setting the value of P7_FLAG to 1 in plsql and trying to check in javascript, which will not work.
    what you need to do is amend your js function like below
    <script type="text/javascript">
    function saveChanges(){
    doSubmit('SUBMIT');
    </script>create a page branch to procedure and make it conditional to when P7_FLAG = 1
    and set the branch source to below
    htp.p('window.close();');
    htp.p('window.opener.doSubmit(''REFRESH'');');

  • Links that open a new window with javascript:void(null); do not work in 3.1

    I've been noticing that any site I go to that opens content in a new window with "javascript:void(null);" will be ignored by Safari 3.1. The links work in Firefox and used to work in Safari as well. Any suggestions?

    General rule of thumb in the Mac universe...
    When Safari is updated most if not all third party add-ons break. That's because most don't play by the rules. The developer thinks they know how to do it better than Apple so they just do it their way. So the first rule of survival is to KNOW what you have installed on your machine at all times. Use something like textedit to create a document listing all of the third party stuff you have installed and religiously update the list. Second rule is to wait a few days before applying an update. Third rule is to visit your third party developers' sites and make sure their little gadget is compatible with the new Safari update.
    Being aware of things will make life much easier for you in the long run.

  • How to get real value from selectOneChoice with javascript?

    Hi,
    How to get real value from selectOneChoice with javascript? The event.getNewValue() only gets me the index of the selected item, not the value/title.
    JSF page:
    <af:resource type="javascript">
    function parseAddress(event)
    alert("new value: " + event.getNewValue());
    </af:resource>
    <af:selectOneChoice label="Location:" value="" id="soc4">
    <af:clientListener type="valueChange" method="parseAddress" />
    <f:selectItems value="#{Person.locations}" id="si7"/>
    </af:selectOneChoice>
    HTML :
    <option title="225 Broadway, New York, NY-10007" selected="" value="0">225 Broadway (Central Office)</option>
    <option title="90 Mark St., New York, NY-10007" value="1">90 Mark St. (Central Office)</option>
    Thanks a lot.

    Something I was missing ,
    You need to add valuePassThru="true" in your <af:selectOneChoice component. I have personally tested it and got the actual value in alert box. I hope this time you got the real solution. You can also test the following code by your end.
    <?xml version='1.0' encoding='UTF-8'?>
    <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.1"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:af="http://xmlns.oracle.com/adf/faces/rich">
    <jsp:directive.page contentType="text/html;charset=UTF-8"/>
    <f:view>
    <af:document id="d1">
    <af:form id="f1">
    <af:panelBox text="PanelBox1" id="pb1">
    <af:selectOneChoice label="Set Log Level" id="soc1"
    value="#{SelectManagedBean.loggerDefault}"
    valuePassThru="true">
    <af:selectItem label="select one" value="First" id="s6"/>
    <af:selectItem label="select two" value="Second" id="s56"/>
    <af:clientListener method="setLogLevel" type="valueChange"/>
    </af:selectOneChoice>
    <af:resource type="javascript">
    function setLogLevel(evt) {
    var selectOneChoice = evt.getSource();
    var logLevel = selectOneChoice.getSubmittedValue();
    // var logLevelObject = AdfLogger.NONE;
    alert("new value is : " + logLevel);
    //alert(evt.getSelection);
    //alert(logLevelObject);
    evt.cancel();
    </af:resource>
    </af:panelBox>
    </af:form>
    </af:document>
    </f:view>
    </jsp:root>

Maybe you are looking for

  • ACR Raw images wont copy to Jpeg or Tiff; as it fails with "Cannot Create File"

    Requesting immediate help if anyone available currently I've been using Photoshop CS6 for several years, never a problem at all. As soon as I bought Creative Cloud, I see many issues that cannot be resolved or are recurring. Again today as I go to co

  • Text in Tag doesn't match what's Visible on the screen (Acrobat 8 Pro)

    I have been exporting PDFs from InDesign CS3 as tagged Acrobat 8 compatible PDFs. When bookmarking the PDF, I generally highlight the heading I want to bookmark and do a ctrl-B to bookmark it which copies the text and applies it as the bookmark text.

  • Xpybutil - A python library that makes X programming easier

    This library is built on top of xpyb which uses XCB. It basically makes quite a few nasty things a bit less nasty. One big example is easy access to ICCCM and EWMH properties on the root and client windows. As a trivial example, say you want to get t

  • Bootcamp on Macbook, W7, NO INTERNET

    SPECS: Macbook 09, Lion, Airport Express, Bootcamp installed at Apple store 7-8-12. I ONLY wanted the bootcamp to run my genealogy program (Mac built genealogy programs are inadequate for advanced researchers). The program is installed, but I can not

  • May the HDMI adapter be the cause of freezing on the TV?

    I have my iPad 4 connected to the TV by using a lightning to HDMI adapter and noticed that sometimes the content being displayed on the TV freezes for a few seconds while the iPad is displaying it normally, so they all of a sudden get desynchronized