Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8256529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:53:06+00:00 2026-06-08T01:53:06+00:00

Hi all i am using dwr to handle ajax calls in java-servlet, this is

  • 0

Hi all i am using dwr to handle ajax calls in java-servlet,

this is what is my dwr.xml,

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dwr PUBLIC
"-//GetAhead Limited//DTD Direct Web Remoting 2.0//EN"
"http://getahead.org/dwr/dwr20.dtd">
<dwr>
    <allow>
        <create creator="new" javascript="TempCardServlet">
            <param name="class" value="com.slingmeadia.notifier.servlet.TempCardServlet"/>
        </create>
    </allow>
</dwr>

and this what is my servlet file and in that i call the

package com.slingmeadia.notifier.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.LinkedHashMap;
import java.util.Map;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;


public class TempCardServlet extends HttpServlet {
 @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {


        String funtionType="";
        if(request.getParameter("functiontype")!=null){
            funtionType = (String)request.getParameter("functiontype");
        }
        if(funtionType.equals("logout")){
            processLogout(request, response);
        }else{

        }

    }
@Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        processLogout(request, response);
    }
    public Map sampleFill(int empid,String functiontype){
      System.out.println("functiontype : "+functiontype);
        Map employeeData = new LinkedHashMap();
        if(functiontype.equals("add")){
            employeeData.put("name", "Antony");
        }else{
            employeeData.put("name", "Antony");
            employeeData.put("cardnumber", "87896857852");
            employeeData.put("issuedate", "17/01/2012");
        }
        return employeeData;
    }


}

and this is how i call the method from jsp file :

<script src='dwr/engine.js'></script>
        <script src='dwr/util.js'></script>
        <script src='dwr/interface/TempCardServlet.js'></script>

        <script>
            function getValues(id) {
                var empid = id.value;
                var optionValue = document.getElementById("selectedOption").value;
                TempCardServlet.sampleFill(empid,optionValue,{callback:setValues,async:false});
            }
            function setValues(tempcardMap) {
                if(tempcardMap !=null){
                    document.getElementById("empname").value=tempcardMap.name;
                    document.getElementById("tempcardnumber").value=tempcardMap.cardnumber;
                    document.getElementById("dateofissue").value=tempcardMap.issuedate;
                }
            }
</script>

and this how i make a call to javascript method :

<td width="55%"><input class="inputBoxes" type="text" name="empid" id="empid" onblur="getValues(this)" /></td>

it seems all are good arranged and no issues but it is not working and do not give any excetpion also.

i tried to like this also

in url i typed http://localhost:8080/acct/dwr/index.html

it gives me the list of Classes known to DWR: and my class file also is there, when i tried to open the class file from browser and gave some sample input but it is not giving any error also no output.

Please help me to resolve this.

Regards.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T01:53:08+00:00Added an answer on June 8, 2026 at 1:53 am

    1.check the dwr path

    if you are going to have the view files inside WEB-INF than

    <script src='dwr/engine.js'></script>         
    <script src='dwr/util.js'></script>         
    <script src='dwr/interface/TempCardServlet.js'></script> 
    

    Refering this way will work.if not you have to give proper path like the below

    <script src='../dwr/engine.js'></script> 
    <script src='../dwr/util.js'></script> 
    <script src='../dwr/interface/TempCardServlet.js'></script> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Some background: I setup six blogs this week, all using Wordpress 2.92, installed with
im using extjs4 with dwr3 to upload a file this is all i have
I did a module in Java in college but we did it all using
I am currently using Lightbox 2 (http://lokeshdhakar.com/projects/lightbox2/) and this is all working fine, however
Once I run search all using Ctrl + Shift + F then my search
I need a way to remove ALL using statements from code and fully qualify
Possible Duplicate: Should Usings be inside or outside the namespace sa1200 All using directives
We have a large number of programmers on different platforms all using CVS. We
I'm on a team of 6 developers and we are all using Eclipse Indigo
Hi all im using a sqlite helper class, but i have a little problem

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.