You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Langas de los Langas <pu...@hotmail.com> on 2007/03/16 09:20:45 UTC

Re: Strange characters appear in my compiled JSP files - Problem solved

Thanks for your answers, and especially to Rashmi. You were right: my text 
editor (Ultra Edit) was to blame. After copying the plain text to another 
editor, the problem was solved.

>From: Rashmi Rubdi <de...@yahoo.com>
>Reply-To: "Tomcat Users List" <us...@tomcat.apache.org>
>To: Tomcat Users List <us...@tomcat.apache.org>
>Subject: Re: Strange characters appear in my compiled JSP files
>Date: Thu, 15 Mar 2007 06:33:12 -0700 (PDT)
>
>I had a similar problem with one of the JSPs,
>
>the only way I could solve it was, copy the original JSP's source code into 
>another plain-text editor like jEdit (or any editor that doesn't alter 
>text, or has unusual encoding)
>then, delete the JSP file , and re-create a new JSP with the same name and 
>re-paste the text from jEdit, perform a clean build.
>
>The problem could most likely be occuring because the editor or some other 
>application might have inserted those characters.
>
>Also have this <%@ page contentType="text/html;charset=UTF-8" 
>language="java" %>  on top of the JSP.
>
>-Rashmi
>
>----- Original Message ----
>From: Langas de los Langas <pu...@hotmail.com>
>To: users@tomcat.apache.org
>Sent: Thursday, March 15, 2007 8:29:16 AM
>Subject: Strange characters appear in my compiled JSP files
>
>
>Hello to everyone. Sorry if my English isn't perfect. I have a problem with
>Tomcat for which I have found explanation neither in the FAQ, nor searching
>the web, nor asking other programmers... So, I guess you're my only hope.
>
>I have developed a JSP application in Tomcat 5.5, and everything is OK with
>it when you use Microsoft Internet Explorer; but, in a couple of pages, 
>with
>Mozilla Firefox and Netscape, these characters appeared at the top of the
>page (and at the beginning of the source code):
>
>
>
>All the JSP files have the same structure, the Java code is virtually the
>same, with differences just in the HTML. Looking at the Java source code of
>the pages, (at "Tomcat 5.5\work\Catalina\localhost\tarific\org\apache\jsp" 
>-
>'tarific' being the name of the application) I found the cause: the pages
>that work fine include the next fragment of code:
>
>try {
>       _jspxFactory = JspFactory.getDefaultFactory();
>       response.setContentType("text/html; charset=iso-8859-1");
>       pageContext = _jspxFactory.getPageContext(this, request, response,
>                   null, true, 8192, true);
>       _jspx_page_context = pageContext;
>       application = pageContext.getServletContext();
>       config = pageContext.getServletConfig();
>       session = pageContext.getSession();
>       out = pageContext.getOut();
>       _jspx_out = out;
>
>       out.write('\r');
>       out.write('\n');
>
>But the three pages that don't work properly have this code, instead:
>
>try {
>       _jspxFactory = JspFactory.getDefaultFactory();
>       response.setContentType("text/html; charset=iso-8859-1");
>       pageContext = _jspxFactory.getPageContext(this, request, response,
>                   null, true, 8192, true);
>       _jspx_page_context = pageContext;
>       application = pageContext.getServletContext();
>       config = pageContext.getServletConfig();
>       session = pageContext.getSession();
>       out = pageContext.getOut();
>       _jspx_out = out;
>
>       out.write("\r\n");
>
>Which leads me me to my question: can anyone tell me where to find
>information about this strange behaviour of the compiler, so I can prevent
>this from happening?
>
>Thank you all for your attention.
>
>_________________________________________________________________
>Dale rienda suelta a tu tiempo libre. Mil ideas para exprimir tu ocio con
>MSN Entretenimiento. http://entretenimiento.msn.es/
>
>
>---------------------------------------------------------------------
>To start a new topic, e-mail: users@tomcat.apache.org
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
>____________________________________________________________________________________
>It's here! Your new message!
>Get new email alerts with the free Yahoo! Toolbar.
>http://tools.search.yahoo.com/toolbar/features/mail/
>
>---------------------------------------------------------------------
>To start a new topic, e-mail: users@tomcat.apache.org
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>

_________________________________________________________________
Un amor, una aventura, compañía para un viaje. Regístrate gratis en MSN Amor 
& Amistad. http://match.msn.es/match/mt.cfm?pg=channel&tcid=162349


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org