?? .#responderservlet.java.1.2
字號:
/* * Created on Apr 14, 2004 * * To change the template for this generated file go to * Window>Preferences>Java>Code Generation>Code and Comments */package gov.nist.applet.phone.webapp.phone;import java.io.IOException;import java.io.PrintWriter;import java.net.InetAddress;import javax.servlet.ServletContext;import javax.servlet.ServletException;import javax.servlet.http.HttpServlet;import javax.servlet.http.HttpServletRequest;import javax.servlet.http.HttpServletResponse;/** * @author root * * To change the template for this generated type comment go to * Window>Preferences>Java>Code Generation>Code and Comments */public class ResponderServlet extends HttpServlet { public void doGet (HttpServletRequest request,HttpServletResponse repsonse) throws ServletException,IOException{ //use of the responder ServletContext applicationContext=this.getServletContext(); if(applicationContext.getAttribute("users")==null) applicationContext.setAttribute("users",new Integer(0)); int users=((Integer)applicationContext.getAttribute("users")).intValue()+1; applicationContext.setAttribute("users",new Integer(users)); String serverIpAddress=InetAddress.getByName(request.getServerName()).getHostAddress(); PrintWriter out=repsonse.getWriter(); out.println( "<HTML>" +
" <HEAD>" +
" <TITLE>>Jain Sip Applet Phone</TITLE>" +
" </HEAD>" +
" <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"> " +
" <tr>" +
" <td width=\"554\" ><img src=\"nisthome_banner.jpg\" ></td>" +
" <td background=\"nisthome-bg.jpg\"> </td>" +
" </tr>" +
" <tr>" +
" <td width=\"554\" > <img src=\"main-image.jpg\" ></td>" +
" <td background=\"main-bg.jpg\"> </td>" +
" </tr>" +
" <tr>" +
" <td width=\"554\" > <img src=\"bottom-bar.jpg\" border=\"0\" ></td>" +
" <td background=\"bottom-bg.jpg\"> </td>" +
" </tr>" +
" </table>" +
"<BODY bgcolor=\"#333333\" text=\"#FFFFFF\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\"" +
"link=\"white\" alink=\"white\" vlink=\"red\">" +
" <center>" +
" <p>If you're experiencing some problems viewing the applet,check your java plug-in control panel :<br>" +
" - In the Proxies tab, uncheck the \"Use browser Settings\" box <br>" +
" - In the Cache tab, uncheck the \"Enable Caching\" box<br>" +
" <br><br>" +
" <APPLET NAME=\"SipResponder\"" +
" CODE=\"gov/nist/applet/phone/ua/gui/NISTMessengerApplet.class\"" +
" ARCHIVE=\"applet-phone.jar\"" +
" WIDTH=320 HEIGHT=520 MAYSCRIPT=\"true\">" +
" <param name=\"PROXYADDRESS\" value=\""+serverIpAddress+"\">" +
" <param name=\"PROXYPORT\" value=\"4000\">" +
" <param name=\"SIGNALINGTRANSPORT\" value=\"tcp\">" +
" <param name=\"MYADDRESS\" value=\""+request.getRemoteAddr()+"\">" +
" <param name=\"SERVERADDR\" value=\""+serverIpAddress+"\">" +
" <param name=\"SERVERPORT\" value=\""+request.getServerPort()+"\">" +
" <param name=\"RESPONDER\" value=\"true\">" +
" <param name=\"MEDIATRANSPORT\" value=\"tcp\">" +
" <param name=\"USERURI\" value=\"user"+users+"@nist.gov\">" +
" Your browser is completely ignoring the <APPLET> tag!" +
" </APPLET>" +
" </center>" +
"</BODY>" +
"</HTML>"); } public void doPost(HttpServletRequest request,HttpServletResponse repsonse) throws ServletException,IOException{ //use of the responder ServletContext applicationContext=this.getServletContext(); if(applicationContext.getAttribute("users")==null) applicationContext.setAttribute("users",new Integer(0)); int users=((Integer)applicationContext.getAttribute("users")).intValue()+1; applicationContext.setAttribute("users",new Integer(users)); String serverIpAddress=new String(InetAddress.getByName(request.getServerName()).getAddress()); PrintWriter out=repsonse.getWriter(); out.println( "<HTML>" + " <HEAD>" + " <TITLE>>Jain Sip Applet Phone</TITLE>" + " </HEAD>" + " <table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\"> " + " <tr>" + " <td width=\"554\" ><img src=\"nisthome_banner.jpg\" ></td>" + " <td background=\"nisthome-bg.jpg\"> </td>" + " </tr>" + " <tr>" + " <td width=\"554\" > <img src=\"main-image.jpg\" ></td>" + " <td background=\"main-bg.jpg\"> </td>" + " </tr>" + " <tr>" + " <td width=\"554\" > <img src=\"bottom-bar.jpg\" border=\"0\" ></td>" + " <td background=\"bottom-bg.jpg\"> </td>" + " </tr>" + " </table>" + "<BODY bgcolor=\"#333333\" text=\"#FFFFFF\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\"" + "link=\"white\" alink=\"white\" vlink=\"red\">" + " <center>" + " <p>To try the responder, just double click on the responder@nist.gov contact and" +
" on the chat frame window click on audio, then record your voice...<br><br> "+ " <p>If you're experiencing some problems viewing the applet,check your java plug-in control panel :<br>" + " - In the Proxies tab, uncheck the \"Use browser Settings\" box <br>" + " - In the Cache tab, uncheck the \"Enable Caching\" box<br>" + " <br><br>" + " <APPLET NAME=\"SipResponder\"" + " CODE=\"gov/nist/applet/phone/ua/gui/NISTMessengerApplet.class\"" + " ARCHIVE=\"applet-phone.jar\"" + " WIDTH=320 HEIGHT=520 MAYSCRIPT=\"true\">" + " <param name=\"PROXYADDRESS\" value=\""+serverIpAddress+"\">" + " <param name=\"PROXYPORT\" value=\"4000\">" + " <param name=\"SIGNALINGTRANSPORT\" value=\"tcp\">" + " <param name=\"MYADDRESS\" value=\""+request.getRemoteAddr()+"\">" + " <param name=\"SERVERADDR\" value=\""+serverIpAddress+"\">" + " <param name=\"SERVERPORT\" value=\""+request.getServerPort()+"\">" + " <param name=\"RESPONDER\" value=\"true\">" + " <param name=\"MEDIATRANSPORT\" value=\"tcp\">" + " <param name=\"USERURI\" value=\"user"+users+"@nist.gov\">" + " Your browser is completely ignoring the <APPLET> tag!" + " </APPLET>" + " </center>" + "</BODY>" + "</HTML>"); }}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -