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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T03:42:13+00:00 2026-06-14T03:42:13+00:00

I use Eclipse EE Juno running on Ubuntu 12.04 in order to test simple

  • 0

I use Eclipse EE Juno running on Ubuntu 12.04 in order to test simple servlet. Therefore I installed a web kit using following command in Eclipse

sudo apt-get install libwebkitgtk-1.0-0

When I’m running the servlet internal browser shows html tags that I used in my servlet. like this (This problem not happens in Firefox)

<h3>Hello from servlet!!!</h3>

Here is the code of servlet

package org.javaweb;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
* Servlet implementation class SimpleServlet
*/
@WebServlet("/SimpleServlet")
public class SimpleServlet extends HttpServlet {
private static final long serialVersionUID = 1L;

/**
 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
 */
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    PrintWriter printWriter = response.getWriter();
    printWriter.println("<h3>Hello from servlet!!!</h3>");
}

}

Where is the error ??
How to correct this??

Thank you!

  • 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-14T03:42:15+00:00Added an answer on June 14, 2026 at 3:42 am

    I guess you have to mention the correct response type as text/html. As in, add this to your existing code and it should work fine for you:

                response.setContentType("text/html;charset=UTF-8");
    

    Firefox or web browsers in general are intelligent enough to guess if it’s HTML content and render it correctly compared to Eclipse’s internal browser.

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

Sidebar

Related Questions

I'm using Eclipse Juno and want to test my Java web app in JBoss
I'm new to scala. I've installed the nightly build since I use eclipse juno.
Recently I have installed Ubuntu 12.04 in place of my Win7. I use Eclipse
I have Eclipse Juno and m2e installed. It is configured to use external maven
I use Eclipse Java EE IDE for Web Developers for most of my coding,
I'm using Eclipse juno and osx 10.8 . I have java 7 with eclipse
I'm using Eclipse Juno for c/c++ under Windows 7. I've created a shared library
I have installed Java x64, Eclipse Classic Juno x64 + ADT Pluggin. OS win
Environment Ubuntu 12.04 LTS Eclipse Juno 4.2 Build id: 20120614-1722 GWT SDK - 2.4.0
I’m getting started in the C language. I am using eclipse (juno) as my

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.