• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Scriptlet getting ignored by Tomcat 5.0

 
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ranchers,
I have written 1 JSP with a System.out.println() statement in the scriptlet . However it has been observed that the scriptlet code gets ignored by the tomcat and rest of the stuff is getting rendered properly. I am using tomcat 5.0 (exicutable version) and also I checked it out that in web.xml there is no entry for <scripting-invalid> tag .
I deployed this jsp inside web-app/ MyProject/test.jsp where Myproject is my project .
I am using IE 7 . Can anybody please tell me the cause behind this.
Here is the code for jsp which I want to deploy .

 
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
the output of System.out.println ("Scriptlet found"); is printing in to the stdout.log file which is inside log folder. you can check this inside that file. if you want to print to browser then use out.println("message").

[ October 28, 2007: Message edited by: Jagadabi Vinay Kumar ]
[ October 29, 2007: Message edited by: Jagadabi Vinay Kumar ]
 
Ranch Hand
Posts: 1585
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Actually it's not being ignored. Your output is going to the console!

If you want your output statements get rendered on your browser, then use:


Instead of:


And the reason for this is that System.out is the standard output stream, whereas out is of type JspWriter.

I hope i made myself clear ...

Best of luck ...
 
samir ware
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ranchers,
Thanks for the reply. But I have checked on the output consol . its not there. As well I tried using out.println("something") . As far as my understanding goes it should be inside scriplet like
<%
out.println("something")
%>
But that is also not getting rendered . Can anybody please tell me the reason behind the same.
Thanks in advance
Samir
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Debugging step #1: What is in the HTML that is sent to the browser?
 
samir ware
Ranch Hand
Posts: 192
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In the above example only "This is a test JSP " should be send to the browser and that is getting rendered properly on the browser (In case of IE) .
And if I try to run the same example in mozilla then output is

This is a test JSP
followed by <%System.out.println("This is a test JSP"); %>
thats the code in the scriptlet gets rendered on the browser if I use mozilla.
Why this is happening ???
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By "what is the HTML that is sent to the browser", Bear means "what code is sent to the browser", not "what do you see in the browser?".

To determine this, right click on the page and select "view html source".
See if your printed statement is in there. If it is, but it isn't showing up in the rendered page, there is probably an error in your HTML.
 
It's just a flesh wound! Or a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic