File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes JSP problem. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP problem." Watch "JSP problem." New topic

JSP problem.

T sandya
Ranch Hand

Joined: Aug 03, 2006
Posts: 64
In jsp , in scriptlets if we write any java code that will goes to service method of the servlet.
but if i write one method in scriptlet which will be placed in to service method of the servlet.
that means service is one method , inside of that method one more method right?

how it is possible, method inside method(this concept is not there in java).
Nilesh Patel
Ranch Hand

Joined: Feb 02, 2006
Posts: 91
you are right..

So it will not compile by aplication server...

Nilesh Patel
SCJP 1.5 - 87%
T sandya
Ranch Hand

Joined: Aug 03, 2006
Posts: 64
so how?
Christophe Verré

Joined: Nov 24, 2005
Posts: 14688

Use declaration instead

Even better : don't use java in JSP !

[My Blog]
All roads lead to JavaRanch
T sandya
Ranch Hand

Joined: Aug 03, 2006
Posts: 64
writing in scriptlet is also not wrong right?
why it is not limitation?
if we didn't write java code in jsp , what is the use of jsp then?
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63844

There are new means to effect what used to be done with scriptlets and scriptlet expressions: namely the JSTL (along with other custom actions) and the EL, in addition to proper structuring of the application such that complicated processing takes place elsewhere in the application than the JSP pages.

Scriptlets are a thing of the past.

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: JSP problem.
It's not a secret anymore!