This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have David & Dawn Griffiths on-line!
See this thread for details.
Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

JSP is not compiling

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Bartender
Posts: 1316
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Bartender
Posts: 1316
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!!!
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Claude Moore
Bartender
Posts: 1316
39
IBM DB2 Netbeans IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic