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

  • SEARCH
  • Home
  • 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 8742531
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:31:13+00:00 2026-06-13T11:31:13+00:00

I need to read data from an xml file that is under the WAR

  • 0

I need to read data from an xml file that is under the WAR directory.
I’m using RequestBuilder for creating the GET request.
It looks like this:

   RequestBuilder requestBuilder = new RequestBuilder(RequestBuilder.GET,"customerRecord.xml");  
   try {  
        requestBuilder.sendRequest(null, new RequestCallback() {  
            public void onError(Request request, Throwable exception) {  
                requestFailed(exception);  
            }  
            public void onResponseReceived(Request request,Response   response) {  
                renderXML(response.getText());  
            }  
        });  
    } catch (RequestException ex) {  
        requestFailed(ex);  
    }   

Now, the thing is that I don’t want to load all of the data. I want to send a parameter that tells the server which part to bring, (let’s say – how many lines of data) and then override the doGet method of the servlet and deal with the parameter.
I have 2 questions:
1) how do I declare the path of the servlet? where is the connection between the servlet and the request??
2) What do I write in the url of the RequestBuilder (instead of “customerRecord.xml”)? do I need to refer to the servlet there or I can keep it like

  • 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-13T11:31:14+00:00Added an answer on June 13, 2026 at 11:31 am

    May be You mean GWT Service?

    You need to create 2 interfaces – Service and ServiceAsync and implementation of Service in server package (on same level as client package). Then You define implementation as servlet (in my JBoss 7.1 it just annotation. in older version servlet mapping):

    @WebServlet(name="YourService", urlPatterns={"/%module%/YourService"})
    public class YourServiceImpl extends RemoteServiceServlet implements YourService 
    

    in Your modeule.xml write:

    <servlet path="/YourService" class="org.name.YourServiceImpl"/>
    

    and in the end You can call this service from Your code

    YourService.App.getInstance().getSomething(new AsyncCallback<Collection<Something>>() {
            @Override
            public void onFailure(Throwable caught) {
                new MessagePopup("Error: " + caught.getMessage()).center();
            }
    
            @Override
            public void onSuccess(Collection<Something> result) {
    
            }
        });
    

    Interfaces You can create from Your beloved IDE. It’s much simpler)

    One think which still bothering me – I cannot specify path for servlet in another module.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to read data from XML to a List<>. The XML file contains
I need to read the data from a file that can be either comma
I'm trying to get data from a webpage that serves a XML file periodically
I need to read data from a legacy database file produced by Visual Basic
As part of an assignment, I need to read data from a binary file
I need to read some data from an input file and plot a graph
I need to read small sequences of data from a 3.7 GB file. The
I'm using the following xml file to read the contents of a file that
Example: I read data from an XML file. This data has unique id elements.
So I want to read data from an xml file, I am now at

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.