File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes JSP is not compiling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Products » Websphere
Bookmark "JSP is not compiling" Watch "JSP is not compiling" New topic
Author

JSP is not compiling

Krishna Acharya
Ranch Hand

Joined: Jun 05, 2007
Posts: 33
My JSP used to get compiled (to Java code) whenever I made any valid changes to it before. Now when I write Java code (as simple as creating string with hard coded string value) inside that JSP page, it does not compile and as a result of that, I can't see any change reflected when I run the JSP. However when I write log statement or System.out.println(), it works. Strange thing is: System.out.println() is also Java Code. Please note that JSP file is included (with <%@ include..) inside another JSP file (Parent). When I write Java code in Parent JSP, it just works. Please rest assured that: Java code that I wrote is correct and include directive (<%@ include..) is also correct (I have not make any change to that)

If I put the following code in already compiling and running JSP (Child), JSP file does not simply compile.
String myString = "Hello bro"

If I put the following code, it just works- meaning it gets compiled and it gets reflected when I run the JSP.
System.out.println("Hello Bro");

There should be some problem with compiling Java code in inner (child) JSP.

Thanks for your help guys!
Claude Moore
Ranch Hand

Joined: Jun 24, 2005
Posts: 453
    
    1

Seems a re-publish problem or some cache-related problem, but you should tell us more about IDE and appserver you're using.
Krishna Acharya
Ranch Hand

Joined: Jun 05, 2007
Posts: 33
I forgot to mention in the above post:
I am using WebSphere application server 7 as Application Server, and IntelliJ Idea IDE (13.1.2)
Claude Moore
Ranch Hand

Joined: Jun 24, 2005
Posts: 453
    
    1

I don't know IntelliJ, but let's try... what about if you forcedly republish your project to websphere ?
Moreover, try to add to each JSP page HTML directives to prevent caching:



It's no more than a trail....
Krishna Acharya
Ranch Hand

Joined: Jun 05, 2007
Posts: 33
Thanks for the reply. Yes, I republished the project (.ear file) to websphere from websphere admin console. That's what I always do. I am less optimistic that this is cache issue because it does not compile if I put any java code and it immediately compiles if I remove the java code that I put that caused it to not compile but I will try that. Just sharing my thought. Thanks!
Krishna Acharya
Ranch Hand

Joined: Jun 05, 2007
Posts: 33
Interesting fact about my problem:
If I put java code inside that JSP page it does not compile (I already mentioned that)
If I commented that code, it still does not compile.
If I remove (instead of commenting), it compiles (works!).

In laymen's language: that JSP sounds like a country where there is no rules and regulation! STRANGE!!!
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10141
    
165

Post the relevant JSP (the actual contents) and the complete error message. Without that it's just going to be guess work which I don't think is going to help much. For example:


If I put the following code in already compiling and running JSP (Child), JSP file does not simply compile.
String myString = "Hello bro"

If I put the following code, it just works- meaning it gets compiled and it gets reflected when I run the JSP.
System.out.println("Hello Bro");


You have a missing semi colon in the first statement which will cause a compilation failure. Of course, without looking at the actual JSP, I can't say if you posted it wrong here or if the JSP itself is missing the semi colon.

[My Blog] [JavaRanch Journal]
Claude Moore
Ranch Hand

Joined: Jun 24, 2005
Posts: 453
    
    1

That's more than strange, it seems absurd..when you redeploy an ear, was should entirely replace all previous classes and artifacts -including JSPs, so i don't know your page may not reflect changes without something caching it. Is your was instance behind an http server? Moreover, try a simple experiment: in your jsp, just add some html static text and try and change it as well as java parts you modify. If even the html part is displayed unchanged, you're done: the problem is not with internal jsp compiler, simply changes aren't detected.
 
 
subject: JSP is not compiling