| Author |
where to put my bean
|
sushil pandey
Greenhorn
Joined: Jun 14, 2004
Posts: 7
|
|
hi i m using apache server 4.1.18 and my problem is that i've created a bean(java file) which i want to call in a jsp page now i dont know where to put that java file ,i've tried using packege but i dont now where that java file goes my java file is as follows package com.taglib.wdjsp.component; import java.util.*; public class CurrentTimeBean { private int hours; private int minutes; public CurrentTimeBean() { Calendar now = Calendar.getInstance(); this.hours=now.get(Calendar.HOUR_OF_DAY); this.minutes=now.get(Calendar.MINUTE); } public int getHours() { return hours; } public int getMinutes() { return minutes; } } where to put this file to be accessed by my jsp file as shown <jsp:useBean id="time" class="CurrentTimeBean"/> <html> <body> It is now <jsp:getProperty name="time" property="minutes"/> minutes past the hour. </body> </html>
|
YOU CAN'T LEAVE UR HABIT!!!<br />AS WHEN U REMOVE H,A BIT REMAINS<br />WHEN U REMOVE A,BIT STILL REMAINS<br />WHEN U REMOVE B,IT STILL REMAINS
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56153
|
|
With a class named CurrentTimeBean in package com.taglib.wdjsp.component, the class file should be:
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
sushil pandey
Greenhorn
Joined: Jun 14, 2004
Posts: 7
|
|
actully i've tried to to put my files in the directory path u said but there are a 15 WEB-INF folder in the apache group folder which one should i use i'm using windows 2000
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56153
|
|
|
The one for the web application that you want this to be part of. If you don't know which is which, you need to take some time to get your folders (and your thoughts) organized to know how your web apps are laid out and configured on disk.
|
 |
sushil pandey
Greenhorn
Joined: Jun 14, 2004
Posts: 7
|
|
you are right!!! it's working now thanks for bearing my silly question thanks a lot  [ June 15, 2004: Message edited by: sushil pandey ]
|
 |
 |
|
|
subject: where to put my bean
|
|
|