首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

问2个有关问题,散分

2011-12-18 
问2个问题,散分jsp怎么实现多国语转换。.net我会多国语转换,jsp不会~~还有就是jsp可以用asp的探针吗?把asp

问2个问题,散分
jsp怎么实现多国语转换。.net我会多国语转换,jsp不会~~

还有就是jsp可以用asp的探针吗?
把asp的探针代码放到jsp页面中能够用吗?

因为这个都是我用.net做出来的,所以想在面试java的时候也说这个项目,所以不知道java中是怎么实现。只要说出大概思路就行,因为这个是我要在面试的时候要讲的,所以只要思想....

[解决办法]
jsp有控制验证的功能吗?
有很多方法可以实现,我一般都是用Filter 来实现
可以看看这个http://blog.csdn.net/gnemy/archive/2007/02/04/1501973.aspx


[解决办法]
<%@ page contentType= "text/html;charset=gb2312 " %>
<%@ page import= "java.util.*,java.io.*,javax.servlet.*,javax.servlet.http.*,java.lang.* " %>
<%
/********************************************************************
*Title: JspEnv v
*Description : JSP环境探针
*CopyRight:(c)2005 www.soho.net.ru
*@author:若影
*@version:1.0
*@Data:2005-1-1 12:00:00
*********************************************************************/

long timePageStart = System.currentTimeMillis();
%>
<%
class EnvServlet
{
public long timeUse=0;
public Hashtable htParam=new Hashtable();
private Hashtable htShowMsg=new Hashtable();
public void setHashtable()
{
Properties me=System.getProperties();
Enumeration em=me.propertyNames();
while(em.hasMoreElements())
{
String strKey=(String)em.nextElement();
String strValue=me.getProperty(strKey);
htParam.put(strKey,strValue);
}
}
public void getHashtable(String strQuery)
{
Enumeration em=htParam.keys();
while(em.hasMoreElements())
{
String strKey=(String)em.nextElement();
String strValue=new String();
if(strKey.indexOf(strQuery,0)> =0)
{
strValue=(String)htParam.get(strKey);
htShowMsg.put(strKey,strValue);
}
}
}
public String queryHashtable(String strKey)
{
strKey=(String)htParam.get(strKey);
return strKey;
}
public long test_int()
{
long timeStart = System.currentTimeMillis();
int i=0;
while(i <3000000)i++;
long timeEnd = System.currentTimeMillis();
long timeUse=timeEnd-timeStart;
return timeUse;
}
public long test_sqrt()
{
long timeStart = System.currentTimeMillis();
int i=0;
double db=(double)new Random().nextInt(1000);
while(i <200000){db=Math.sqrt(db);i++;}
long timeEnd = System.currentTimeMillis();
long timeUse=timeEnd-timeStart;
return timeUse;
}
}
%>
<%
EnvServlet env=new EnvServlet();
env.setHashtable();
String action=new String( " ");
String act=new String( "action ");
if(request.getQueryString()!=null&&request.getQueryString().indexOf(act,0)> =0)action=request.getParameter(act);
%>
<html>
<head>
<title> JSP 探针 </title>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 ">
<style>
A { COLOR: #000000; TEXT-DECORATION: none}
A:hover { COLOR: #f58200}
body,td,span { font-size: 9pt}
.input { BACKGROUND-COLOR: #ffffff;BORDER:#f58200 1px solid;FONT-SIZE: 9pt}
.backc { BACKGROUND-COLOR: #f58200;BORDER:#f58200 1px solid;FONT-SIZE: 9pt;color:white}
.PicBar { background-color: #f58200; border: 1px solid #000000; height: 12px;}
.tableBorder {BORDER-RIGHT: #183789 1px solid; BORDER-TOP: #183789 1px solid; BORDER-LEFT: #183789 1px solid; BORDER-BOTTOM: #183789 1px solid; BACKGROUND-COLOR: #ffffff; WIDTH: 760;}
.divcenter {
position:absolute;


height:30px;
z-index:1000;
left: 101px;
top: 993px;
}
</STYLE>
<script language= "javascript ">
function showsubmenu(sid)
{
whichEl = eval( "submenu " + sid);
if (whichEl.style.display == "none ")
{
eval( "submenu " + sid + ".style.display=\ "\ "; ");
eval( "txt " + sid + ".innerHTML=\ " <a href= '# ' title= '关闭此项 '> <font face= 'Wingdings ' color=#FFFFFF> x </font> </a> \ "; ");
}
else
{
eval( "submenu " + sid + ".style.display=\ "none\ "; ");
eval( "txt " + sid + ".innerHTML=\ " <a href= '# ' title= '打开此项 '> <font face= 'Wingdings ' color=#FFFFFF> y </font> </a> \ "; ");
}
}
</SCRIPT>
</head>
[解决办法]
</td>
</tr>
</table>
</form>
<a name= "ServerAbility " id= "ServerAbility "> </a>
<table border= "0 " cellpadding= "0 " cellspacing= "1 " class= "tableBorder ">
<tr>
<td height= "22 " align= "center " bgcolor= "#f58200 " onclick= "showsubmenu(3) "> <font color=#FFFFFF> <strong> 服务器运算能力 </strong> </font>
<a href= "#top " title= "返回顶部 "> <font face= 'Webdings ' color=#FFFFFF> 5 </font> </a>
<span id=txt3 name=txt3> <a href= '# ' title= '关闭此项 '> <font face= 'Wingdings ' color=#FFFFFF> x </font> </a> </span>
</td>
</tr>
<tr>
<td style= "display " id= 'submenu3 '> <table border=0 width=100% cellspacing=1 cellpadding=3 bgcolor= "#f58200 ">
<tr bgcolor= "#fcc79b " height= "22 ">
<td colspan= "3 "> &nbsp;&nbsp; <font face= 'Webdings '> 4 </font> 让服务器执行300万次加法( <font color= "#000000 "> 整数运算 </font> )和20万次开方(浮点运算),记录其所使用的时间。
</td>
</tr>
<tr height= "22 "bgcolor= "#FFFFFF " >
<td align=center bgcolor= "#FFFFFF "> <font color= "#000000 "> 可 供 参 考 的
服 务 器 列 表 </font> </td>
<td align= "center "> 整数运算 </td>
<td align= "center "> 浮点运算 </td>
</tr>
<tr bgcolor= "#FFFFFF " height= "22 ">
<td align=left> &nbsp;公司的电脑&nbsp;(CPU:Celeron 1G&nbsp; 内存:256M) </td>
<td align= "center "> 60 毫秒 </td>
<td align= "center "> 70 毫秒 </td>
</tr>
<tr bgcolor= "#FFFFFF " height= "22 ">
<td align=left> &nbsp;家里的电脑&nbsp;(CPU:Duron 1G&nbsp; 内存:384M) </td>
<td align= "center "> 20 毫秒 </td>
<td align= "center "> 10 毫秒 </td>
</tr>
<tr bgcolor= "#FFFFFF " height= "22 ">
<td align=left> &nbsp; <a href= "http://free3.e-168.cn/cnforum/jspenv.jsp " target= "_blank "> 中国网聚服务器&nbsp;


(CPU:Intel Pentium III 1G 内存:768M) </a> </td>
<td align= "center "> 20 毫秒 </td>
<td align= "center "> 3 毫秒 </td>
</tr>
<tr bgcolor= "#FFFFFF " height= "22 ">
<td align=left> &nbsp; <a href= "http://ibmclub.hust.edu.cn/myweb/ggyy/jspenv.jsp " target= "_blank "> IBM俱乐部&nbsp;
(CPU:IIntel(R) Celeron(R) CPU 1.70G 内存:256M) </a> </td>
<td align= "center "> 3 毫秒 </td>
<td align= "center "> 7 毫秒 </td>
</tr>
<tr bgcolor= "#FFFFFF " height=25>
<td align=left> &nbsp; <font color=red> 您正在使用的这台服务器 </font> &nbsp; <INPUT name= "button2 " type= "button " class=backc onclick= "javascript:location.reload() " value= "重新测试 ">
</td>
<td align= "center "> <font color=red> <%=env.test_int()%> 毫秒 </font> </td>
<td align= "center "> <font color=red> <%=env.test_sqrt()%> 毫秒 </font> </td>
</tr>
</table> </td>
</tr>
</table>
<a name= "ISpeedTest " id= "ISpeedTest "> </a> <br>
<%
if(action.equals( "SpeedTest "))
{
%>
<div id= "testspeed " align= "center ">
<table width= "200 " border= "0 " cellspacing= "0 " cellpadding= "0 " class= "divcenter ">
<tr>
<td height= "30 " align=center> <p> <font color= "#000000 "> <span id=txt5> 网速测试中,请稍候... </span> </font> </p> </td>
</tr>
</table>
</div>
<%}%>
[解决办法]
网上搜索就行

热点排行