返回首页
当前位置: 主页 > Import business >

ImportJava Certification: WebService to get the client IP ad

时间:2012-01-28 10:01
  

> News You are here: Home> Computer classes> java Certification> Guidance Notes> text java certification: webservice to get the client ip address http://news.bangkaow.com2010-11-18 14:53 Source: to help test network 1 Based on the development of the jax-ws webservice to get the client ip's method in the proxy class add the following code xxxdelegate]:importjavax.annotation.resource;importjavax.servlet. http.httpservletrequest;importjavax.xml.ws.webservicecontext; import javax.xml.ws.handler.messagecontext; @ resourceprivate webservicecontext wscontext; private string getclientinfo () {messagecontext mc = wscontext.getmessagecontext () ; httpservletrequest request = (httpservletrequest) (mc.get (messagecontext.servlet_request)); string rortaddress = request.getroteaddr (); return (rortaddress);} 2. based on axis webservice published methods to obtain client ip / *** get client ip address, such as caller ip, in order to check permissions * released for axis webservice * @ return * / public string getclientipaxis () {messagecontext mc = null; httpservletrequest request = null; try {mc = messagecontext. getcurrentmessagecontext (); if (mc == null) throw new exception ("Unable to get to messagecontext"); request = (httpservletrequest) mc.getproperty (httpconstants.mc_http_servletrequest); syst.out.println ("rote ip: & rdquo ; + request.getroteaddr ()); Previous 12 Next data statistics!! [Favorite] [Print] [Close] [Top] Editor: Yang Yufen More articles about "java certification java certification exam "The article and the final java class type of the local internal parameters and variables java certification exam counseling: java programming class java certification exam within: On the mixed c + + and java programming java certification exam: java certification java generic programming QuickStart: How learning java? way to learn about java java certification java multithreading novice: join method to use java certification exam counseling: java java certification life cycle of thread: java platform scripting easier way to java certification exam: you do not know java java authentication secret command mode: Gang of Four design patterns java certification: java main method to clarify the certification process issues java: java programming language in depth analysis of three ways to enter detailed comments page Comment Code: Anonymous Home × User: New User Registration Password: Forgot password? comments Wang Xiao counseling free trial promotions Course Description Financial Accounting Wang Xiao Wang Xiao Wang Xiao legal Wang Xiao exciting project recommended the use of hot java to achieve combined ranking that the scope of the parser, therefore, digit represents a single digital , alpha represents a single letter (uppercase or lowercase ),(... detailed 02-14 · java class and final type of local internal parameters and variables 02-14 · java certification exam counseling: java programming in-house classes 02-14 * java certification exam: On the mixed c + + and java programming 02-14 · java certification exam: java generic programming Quick Start 02-12 · java certification java multithreading novice: join method to use 02-12 · java certification exam counseling: java the life cycle of non-threaded relational database efficiently stores large amounts of data to any web system, are very taboo associated with multiple large table query, and complex data analysis ... more 09-01 · java Detailed Chinese character encoding problem console output 09-25 · java regular expressions to determine the phone number 09-29 · java certification: Introduction to the framework of common javaweb 08-25 · java rmi tutorial examples of a distributed network of communication theory 08-30 · java certification: java implementation authority management in two ways 08-11 · Why use high-efficiency non-relational database stores Photo Gallery Articles Chinese character encoding problem using java java achieve modular solution why should the number of non-relational bias lock java implementation principle (hot article 09-- 01 · java Chinese character encoding issues Detailed console output 09-25 · java regular expressions to determine the phone number 09-29 · java certification: Introduction to the framework of common javaweb 08-25 · java rmi tutorial examples of a distributed network of communication theory 08 -30 · java certification: java implementation of rights management in two ways 08-11 · Why use high-efficiency non-relational database storage 11-22 · java certification exam: java ee development framework for the four common sorting algorithm 09-01 · java code insertion sort sorting a variety of java 11-02 · you become master of the 25 learning points 08-13 · dsl parser using java to achieve modular design basis>

------分隔线----------------------------
最新文章