Reputation: 37167
We have a couple of utility functions declared on class level in jsp. Using <%!
.
I get the following error in the line containing only <%!
:
Invalid character constant
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%@page import="java.sql.*"%>
<%@page import="java.util.Vector"%>
<%!
String var1 = "something";
ObjectXXX var2 = null;
void initObjectXXX()
{
...
If I remove the two variables our functions start working. But they were there before and it was working correctly.
What is causing the error?
Upvotes: 3
Views: 988
Reputation: 403531
It could be a character encoding problem. Your JSP header specifies the latin charset, so perhaps someone checked the file into SVN with a different encoding, which is causing the JSP compiler to barf.
Hard to spot or confirm, since the characters look OK visually.
Upvotes: 4