• Post Reply Bookmark Topic Watch Topic
  • New Topic

where to put my bean

 
sushil pandey
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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>
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With a class named CurrentTimeBean in package com.taglib.wdjsp.component, the class file should be:

 
sushil pandey
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 65524
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you are right!!! it's working now
thanks for bearing my silly question

thanks a lot
[ June 15, 2004: Message edited by: sushil pandey ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!