File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Declaring function doesn't work

 
Sergio Andres Chicas Bastidas
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wrote a code declaring a function in the <%! %> tags but the parser gets an error saying <%! tag doesn't have a %>, that's false, I close the tag.
Idecide touse <jsp:declaration></jsp:declaration> but the result is the same. I made other changes(as let the function alone,without any other declaration) anditstill not working.
I'm using TomCat 5.0.18

I'm open to any idea or tip.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the code in question?
 
Sergio Andres Chicas Bastidas
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh sorry, I forgot it:


 
Sergio Andres Chicas Bastidas
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An here is the Error Report:


I had search for all the but I didn't find nothing about the theme.
The official reference only says <%! is usedto declare variables and function, but it has not limitants or restrictions.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64194
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why on earth would you be using JSP Document (XML) syntax?
 
Sergio Andres Chicas Bastidas
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We'll I'm using JSP XML syntax 'cause the error appears when I use <%! and %> then I inocently think by changing that maybe the problem goes off.(Don't laugh, I was desesperate)

By the moment,I'm searching the error making the code split(sorry for my bad english) that means to divide to win. I think I can isolate it.

The JSP Spec was not useful, so I'll try anything.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64194
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Sergio Andres Chicas Bastidas:
We'll I'm using JSP XML syntax 'cause the error appears when I use <%! and %> then I inocently think by changing that maybe the problem goes off.(Don't laugh, I was desesperate)
That is desperate! The JSP Document syntax is not meant for hand-coding. You'll find yourself with so many markup issues it'll make any other issues you may be having seem trivial.

Post your original code using <%! %> for us to take a look at.

And I'd be remiss for not mentioning that once you get past this you should look into bringing your pages into the modern era and ditching the use of scriptlets and scriptlet declarations entirely.
 
Sergio Andres Chicas Bastidas
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


SmaterQuestion
 
Paul Clapham
Sheriff
Pie
Posts: 20196
26
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible that the "<" buried in that code is confusing the parser?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64194
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Detailed error report please.
 
Sergio Andres Chicas Bastidas
Greenhorn
Posts: 6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well actually I can't see anything at the page(it's runnig on a remote server), I don't know if the proxy server(my proxy sometimes forgot refresh his contents and let me without can to see changes).

This page: Mobi
sends data to: Mobi


OK. Let me explain what I'm working.
My project sends data from a cellphone to a server and to other way(that's one reason the page is ugly, it's not a final one). The page in question is test one(I test somany things there until they are ready), I test several things in it,but I've never write a function in the jsp code(so I have never an error like that). Now I'm trying JSON data format(it works) and savingit at disk. I wrote a function that gives me a file name(a random one), but when I declare it in <%! %> parser error is sent.

Note: the name of page(midlet), it's only a name, don't think I don't know what is it(in fact I wrote the midlet that sends data to server and in the other way).
Note: this is not a useless page, I did an other interface to send data to server from a site(not cell phone)

Sorry if I give irrelevant information.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic