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 <[EMAIL PROTECTED]>
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


 
____________________________________________________________________________________
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to