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 8471139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:42:51+00:00 2026-06-10T16:42:51+00:00

I need to make a struts 2 application. In the one view of this

  • 0

I need to make a struts 2 application. In the one view of this app, I have to get the view of another application through the URL provided for example (http://localhost:8080/hudson/)…

Now.
1. How to connect with the other application? (Can it be done with Apache HttpURLClient? OR any other way please guide. )

2 .If it can be done with Apache HttpURLClient, then how to render the Response object in stuts2 framework.

Please help. Many thanks in advance.

  • 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-10T16:42:53+00:00Added an answer on June 10, 2026 at 4:42 pm

    You can use java.net package to resolve the issue. Example Code :

    URL urlApi = new URL(requestUrl);
    HttpURLConnection httpURLConnection = (HttpURLConnection) urlApi.openConnection();
    httpURLConnection.setRequestMethod(<requestMethod>); // GET or POST
    httpURLConnection.setDoOutput(true);
    //in case HTTP POST method un-comment following to write request body
    //DataOutputStream ds = new DataOutputStream(httpURLConnection.getOutputStream());
    //ds.writeBytes(body);
    InputStream content = (InputStream) httpURLConnection.getInputStream();
    BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(content));
    StringBuilder stringBuilder = new StringBuilder(100);
    String line = null;
    while ((line = bufferedReader.readLine()) != null) {
        stringBuilder.append(line);
    }
    String serverResult = stringBuilder.toString();
    //now you have a string representation of the server result page
    //do what you need
    

    Hope this helps

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

Sidebar

Related Questions

I have a struts2 web application with tiles. I need to make header, sidebar
I need to make a moderate system like the one in fmylife.com. Basically the
I need to make a series (1-20) ajax calls and I need to have
I need to make a QT app to run on the startup of an
I have worked with struts 1,2 for around an year. Now I need to
I have a workflow where I need to render an exception page. But this
Hi I need to make a dynamic menu in my struts2 application, so there
I´m currently developing a Struts2 app where a user will make one of three
i have an array of structs and i need to get the size of
I have a high traffic website and I need make sure my site is

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.