jsp的技术教程
源代码在线查看: function.inc.jsp
//时间转换函数(只取年月日)
public static String YMD(String dt)
{
try
{
return dt.substring(0,4)+"年"+dt.substring(5,7)+"月"+dt.substring(8,10)+"日";
}
catch(Exception e)
{
}
return "null";
}
%>
public static String lang(int n)
{
try
{
switch(n)
{
case 1:
return "中文";
case 2:
return "英文";
}
}
catch(Exception e)
{
}
return "null";
}
%>
public static String category(int id)
{
try
{
switch(id)
{
case 1:
return "计算机类";
//break;
case 2:
return "英语类";
//break;
default:
return "其他类";
//break;
}
}
catch(Exception e)
{
}
return "null";
}
%>
public static String commend(int n)
{
try
{
switch(n)
{
case 1:
return "好";
//break;
case 2:
return "较好";
case 3:
return "一般";
//break;
case 4:
return "较差";
case 5:
return "差";
//break;
default:
return "一般";
//break;
}
}
catch(Exception e)
{
}
return "null";
}
%>
public static String cd(boolean n)
{
try
{
if(n)
{
return "配有光盘";
}
else
{
return "没有配套光盘";
}
}
catch(Exception e)
{
}
return "null";
}
%>
public static String price(boolean n)
{
try
{
if(n)
{
return "是";
}
else
{
return "否";
}
}
catch(Exception e)
{
}
return "null";
}
%>