Ok, you should be using a servlet not a JSP but if you really need to… add this directive at the top of your page:
<%@ page trimDirectiveWhitespaces="true" %>
Or in the jsp-config section your web.xml
<jsp-config> <jsp-property-group> <url-pattern>*.jsp</url-pattern> <trim-directive-whitespaces>true</trim-directive-whitespaces> </jsp-property-group> </jsp-config>
Also flush
/close
the OutputStream
and return when done.
dataOutput.flush(); dataOutput.close(); return;
Related Posts:
- org.apache.jasper.JasperException: Unable to compile class for JSP:
- Spring Boot – Unable to resolve Whitelabel Error Page
- getting error HTTP Status 405 – HTTP method GET is not supported by this URL but not used `get` ever?
- What does request.getParameter return?
- Server Tomcat v9.0 Server at localhost failed to start
- Server Tomcat v9.0 Server at localhost failed to start
- java.net.SocketTimeoutException: Read timed out under Tomcat
- What is the difference between response.sendRedirect() and request.getRequestDispatcher().forward(request,response)
- How to resolve Error listenerStart when deploying web-app in Tomcat 5.5?
- org.glassfish.jersey.servlet.ServletContainer ClassNotFoundException
- java.lang.NumberFormatException: null i
- WebServlet cannot be resolved to a type
- keytool error bash: keytool: command not found
- How to solve the “failed to lazily initialize a collection of role” Hibernate exception
- hibernate properties not found
- What does this expression language ${pageContext.request.contextPath} exactly do in JSP EL?
- An established connection was aborted by the software in your host machine tomcat jackson
- how to fix Cannot call sendRedirect() after the response has been committed?
- Response has aready been committed
- What is the difference between JSF, Servlet and JSP?
- Invalid initial heap size. Could not create the Java virtual machine
- Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/JDBC_DBO]]
- build-impl.xml:1031: The module has not been deployed
- Unknown version of Tomcat was specified in Eclipse
- Static Final Long serialVersionUID = 1L
- Official reasons for “Software caused connection abort: socket write error”
- How to specify the default error page in web.xml?
- The import javax.servlet can’t be resolved
- Spring boot: Unable to start embedded Tomcat servlet container
- Http status 401 This request requires HTTP authentication (). in tomcat 6
- Problem with gif with transparent background
- Search for words with telephone numbers from 2-3-4 tree
- Difference between Inheritance and Composition
- What is the reason behind “non-static method cannot be referenced from a static context”? [duplicate]
- Java string to date conversion
- Creating a “logical exclusive or” operator in Java
- Cannot make a static reference to the non-static method fxn(int) from the type Two [duplicate]
- How can I use pointers in Java?
- JavaFX – Exception in Application start method?
- What is IllegalStateException?
- Long vs Integer, long vs int, what to use and when?
- Java Using Nodes with LinkedList
- When is the @JsonProperty property used and what is it used for?
- Why is there no SortedList in Java?
- How does a Breadth-First Search work when looking for Shortest Path?
- Java: using switch statement with enum under subclass
- Java way to check if a string is palindrome
- No String-argument constructor/factory method to deserialize from String value (”)
- Where can i get BigClip? [closed]
- What is the /= operator in Java?
- Gradle does not find tools.jar
- Constructor cannot be applied to given types?
- How to use VisibleForTesting for pure JUnit tests
- What is the easiest/best/most correct way to iterate through the characters of a string in Java?
- How can I list the available Cipher algorithms?
- ADK vs JDK vs SDK difference?
- round up to 2 decimal places in java?
- com.sun.jdi.InvocationException occurred invoking method
- How can I check whether an array is null / empty?
- How to solve javax.net.ssl.SSLHandshakeException Error?
- org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘demoRestController’
- What causes java.lang.IncompatibleClassChangeError?
- Add an object to an Array of a custom class
- What does java.lang.Thread.interrupt() do?
- Determining Day of the week using Zeller’s Congruence in Java
- IO Error: The Network Adapter could not establish the connection
- How to create a directory in Java?
- Converting from Integer, to BigInteger
- Get a resource using getResource()
- Java comparing generic types
- Simplest way to read JSON from a URL in Java
- Creating random numbers with no duplicates
- How to create a popup window in javafx
- java – How to handle array:Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: 3
- How to print the data in byte array as characters?
- Generate a random double in a range
- How to open a new tab using Selenium WebDriver in Java?
- Selenium Webdriver: Element Not Visible Exception
- Whitespace Matching Regex – Java
- Unreachable code in eclipse
- “Field can be converted to a local variable” message appearing when setting Android ActionBar colour
- Convert an integer to an array of digits
- Android Emulator: Unfortunately App has stopped
- Can we execute a java program without a main() method? [duplicate]
- How to really read text file from classpath in Java
- Java command not found on Linux
- Selenium using Java – The path to the driver executable must be set by the webdriver.gecko.driver system property
- How to break out or exit a method in Java?
- Java Exception in thread “AWT-EventQueue-0” java.lang.NullPointerException
- What’s so special about 0x7f?
- Append a single character to a string or char array in java?
- Preventing a Java class from being instantiated and inherited
- Collision Detection between two images in Java
- What does .pack() do?
- String is immutable. What exactly is the meaning?
- How do I autoindent in Netbeans?
- What is an attribute in Java?
- MessageBodyWriter not found for media type=application/json
- Conversion from Long to Double in Java
- Failed to find Java VM