aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes out.println( Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "out.println("") is not working in between declaration tags?" Watch "out.println("") is not working in between declaration tags?" New topic
Author

out.println("") is not working in between declaration tags?

yamini nadella
Ranch Hand

Joined: Apr 13, 2004
Posts: 257
<HTML><BODY>
Hello 1 <B>
<%!
int i=10;
public void a()
{
i = i+10;
out.println("inside ");
}

%> </B>
Hello 1
<B><%
a();
out.print("first line "+i+6);
%></B>

</BODY></HTML>
---
above script is giving HTTP status 500 error at first out.println, why?
is it means in between <%! and %> can't we use implicit objects?.

In between declaration tags it is allowing to declare methods and call them self. But why it is not allowing to print.
Sumitro Palit
Ranch Hand

Joined: Dec 13, 2003
Posts: 37
You are right.
The implicit objects are declared inside the generated _jspService method.
You cannot use the implicit objects outside of the _jspservice scope (scriptlets.)

- ortimuS
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: out.println("") is not working in between declaration tags?
 
Similar Threads
declaration section variable is not getting reset for each refresh operation?
question about session?
Servlet Invocation
difference between out.println() and System.out.println() in JSP?
Need to split up servlet