This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes JSP and the fly likes JSP compilation error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP compilation error" Watch "JSP compilation error" New topic

JSP compilation error

Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
Hi ranchers,
I posted this on the WebLogic forum some time ago, but as I haven't received any response I'll post it here as well.
I just bumbed into a weird feature of WLS 6.1's JSP compiler... I have a JSP file with mixed HTML and Java scriptlets. The problem is that for some reason, upon deployment WebLogic generates several statements in the .jsp into a single line in the .java file -- a //-style comment in front of a number of statements is not what I'd expect
In other words,


I've tried to tweak the linefeed/newline characters with different editors but with no success.
Any idea where to look for the cause of this?

Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Carl Trusiak

Joined: Jun 13, 2000
Posts: 3340
Apparently you have run into a bug for the WebLogic JSP parser. It looks to me to be an attempt to get around the limitation that exists(May be fixed in jdk 1.4 but, I'll have to look it up) That a Java file cannot exceed a certian length. In doing so, it leads to what you are seeing. Refactor this to

This should prevent the error you are seeing. Using JSP comments means that info isn't carried into the Java Source but, you should be reading the jsp file for this and not the java.
[ April 22, 2003: Message edited by: Carl Trusiak ]

I Hope This Helps
Carl Trusiak, SCJP2, SCWCD
Lasse Koskela

Joined: Jan 23, 2002
Posts: 11962
Thanks. I fixed the immediate problem by using the C-style /* */ comments. I'd like to know what's the problem, however, because
1) I like the //-comments better
2) I'm using WLS 6.1 and I can't be the first one to use //-comments in JSPs
3) I'm addicted to a drug called knowledge
subject: JSP compilation error
It's not a secret anymore!