This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
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?