Q
questionmarc420
hi,
for some reason i can't add a method within jsp tags?
it says : Illegal start of expression.
Here's the code:
<%
.....
------THE ERROR IS HERE THE METHOD DECLARATION IS THE ILLEGAL START OF
EXPRESSION
public void preserveTag(int i){
if(i==0){
data_body.replaceFirst("\\*T","<pre>");
}else
data_body.replaceFirst("\\*T","</pre>");
}
StringTokenizer x = new StringTokenizer(data_body);
int order = 0;
while(x.hasMoreTokens()){
// out.println(x.nextToken());
if(x.nextToken().equals("*T")){
out.println("FOUND *T");
if(order==0){
out.println("OPEN TAG");
preserveTag(order);
//data_body.replaceFirst("\\*T","<pre>");
order = 1;
}else {
out.println("CLOSE TAG");
//data_body.replaceFirst("\\*T","</pre>");
preserveTag(order);
order = 0;
}
}
}
.....
%>
Now im sure hte asnwer is really simple but for some reason i can't
find out anywhere? If someone knows my problem please help
thanks
-morc
for some reason i can't add a method within jsp tags?
it says : Illegal start of expression.
Here's the code:
<%
.....
------THE ERROR IS HERE THE METHOD DECLARATION IS THE ILLEGAL START OF
EXPRESSION
public void preserveTag(int i){
if(i==0){
data_body.replaceFirst("\\*T","<pre>");
}else
data_body.replaceFirst("\\*T","</pre>");
}
StringTokenizer x = new StringTokenizer(data_body);
int order = 0;
while(x.hasMoreTokens()){
// out.println(x.nextToken());
if(x.nextToken().equals("*T")){
out.println("FOUND *T");
if(order==0){
out.println("OPEN TAG");
preserveTag(order);
//data_body.replaceFirst("\\*T","<pre>");
order = 1;
}else {
out.println("CLOSE TAG");
//data_body.replaceFirst("\\*T","</pre>");
preserveTag(order);
order = 0;
}
}
}
.....
%>
Now im sure hte asnwer is really simple but for some reason i can't
find out anywhere? If someone knows my problem please help
thanks
-morc