aspose file tools*
The moose likes JSP and the fly likes Declaring function doesn't work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Declaring function doesn Watch "Declaring function doesn New topic
Author

Declaring function doesn't work

Sergio Andres Chicas Bastidas
Greenhorn

Joined: Sep 07, 2007
Posts: 6
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

Joined: Dec 11, 2004
Posts: 13410

Can you post the code in question?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Sergio Andres Chicas Bastidas
Greenhorn

Joined: Sep 07, 2007
Posts: 6
Oh sorry, I forgot it:


Sergio Andres Chicas Bastidas
Greenhorn

Joined: Sep 07, 2007
Posts: 6
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

Joined: Jan 10, 2002
Posts: 61241
    
  66

Why on earth would you be using JSP Document (XML) syntax?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Sergio Andres Chicas Bastidas
Greenhorn

Joined: Sep 07, 2007
Posts: 6
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

Joined: Jan 10, 2002
Posts: 61241
    
  66

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

Joined: Sep 07, 2007
Posts: 6


SmaterQuestion
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

Is it possible that the "<" buried in that code is confusing the parser?
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61241
    
  66

Detailed error report please.
Sergio Andres Chicas Bastidas
Greenhorn

Joined: Sep 07, 2007
Posts: 6
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
 
subject: Declaring function doesn't work