Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

where to put my java file bean to be accessed by my jsp page in apache 4.1.18  RSS feed

 
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>
 
Mag Hoehme
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sushil,

deploy your Java classes, which are called by your JSPs in the webapps/<your project>/WEB-INF/classes folder.

Hope this helps.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!