aspose file tools*
The moose likes JSP and the fly likes init of servlets and jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "init of servlets and jsp" Watch "init of servlets and jsp" New topic
Author

init of servlets and jsp

vara prasad
Ranch Hand

Joined: Dec 21, 2004
Posts: 47
where can we provide the infomation of servlet's init() method in jsp
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
you can't.

You shouldn't need to anyway. JSP aren't meant to hold business logic, only display logic.
If you think you need to put any computation or data manipulation code in a JSP you need to instead rethink your application design.


42
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by Jeroen Wenting:
you can't.

You shouldn't need to anyway. JSP aren't meant to hold business logic, only display logic.
If you think you need to put any computation or data manipulation code in a JSP you need to instead rethink your application design.


You have got the best suggestion, Vara.
Dan Novik
Ranch Hand

Joined: Jan 26, 2005
Posts: 39
>you can't.

Why? Your jsp page may extends your own class and you can have your own
jspInit, jspDestroy

I am not discussing is it good or not, but technically it is possible and it is described in the spec.
ramprasad madathil
Ranch Hand

Joined: Jan 24, 2005
Posts: 489

>I am not discussing is it good or not, but technically it is possible

correct, its technically possible.
You have to override _jspInit() in a <%!......%> (declarative tag).

ram.
James Carman
Ranch Hand

Joined: Feb 20, 2001
Posts: 580
Originally posted by vara prasad:
where can we provide the infomation of servlet's init() method in jsp


You can declare your JSP page as a servlet in your web.xml file and provide intialization parameters just like you would any other servlet. Then, in your JSP page, you can access the implicit config object (a ServletConfig instance) to access the servlet-specific information related to your JSP page.

Is that what you were asking about?


James Carman, President<br />Carman Consulting, Inc.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: init of servlets and jsp