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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:53:12+00:00 2026-06-18T08:53:12+00:00

I need a double value from my servlet to markup in my JSP. My

  • 0

I need a double value from my servlet to markup in my JSP. My doGet() is sending back formatted HTML tables with values from an ArrayList, so after I got that working I decided to tackle this part.

Servlet:

//Code getting the tables I need

    //Send back the result, this all works good
    response.setContentType("text/html");
    response.setCharacterEncoding("UTF-8");
    response.getWriter().write(returnAsHTML.toString());

What I added to try and get the double value

    //Send back the result

    double test = 20;
    request.setAttribute("Test",test);

    response.setContentType("text/html");
    response.setCharacterEncoding("UTF-8");
    response.getWriter().write(returnAsHTML.toString());

    getServletContext().getRequestDispatcher("index.jsp").forward(request,response);

In JSP:

  <!-- This variable is unresolved -->
  <small>Test : ${Test}</small>

The forwarding seems to crash the whole party. I am new to JSP, I’m sure I am missing something small. I need to keep the response.getWriter() stuff there, it gets a lot of the information I need. Now I just don’t know how to get my double values I need as well, because they will be displayed on a whole different part of the page.

  • 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-18T08:53:13+00:00Added an answer on June 18, 2026 at 8:53 am

    You cannot write output to the servletOutputStream and redirect at the same time.

    What do you expect from the browser: to display content or to navigate to another page? If the first, don’t redirect. If the second, don’t display HTML content.

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

Sidebar

Related Questions

I'm getting a value back from the server that contains a double quote in
I need to write a Double value in a numeric cell using a specific
I need to truncate the amount of decimal places of my double value for
Need some help with DataFormatString in GridView. I have a Double value that needs
I'm making an android app, and I need to save the double value(BodySize) to
I have table which contains double values stored in mysql database ...I need to
I am reading data from text file and there is double value which i
I have a situation where I need to display a double value rounded to
I need a generic method that can return a value parsed from a string
I need to get a value from my cursor. The value needs to be

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.