无线&移动互联网技术研发

换位思考·····
posts - 19, comments - 53, trackbacks - 0, articles - 283
  BlogJava :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理


        ServletContext servletContext 
=  ActionContext.getServletContext();
        HttpServletRequest request 
=  ActionContext.getRequest();

        
if  (servletContext  ==   null {
            System.out.println(
" servletContext is null " );
        }

        
if  (request  ==   null {
            System.out.println(
" request is null " );
        }

        System.out.println(
" servletContext.getContextPath()= "   +  servletContext.getContextPath());
        System.out.println(
" servletContext.getRealPath(\ " / \ " )= "   +  servletContext.getRealPath( " / " ));
        System.out.println(
" servletContext.getRealPath(\ " \ " )= "   +  servletContext.getRealPath( "" ));
        System.out.println(
" servletContext.getContextPath()= "   +  servletContext.getContextPath());
        System.out.println(
" servletContext.getServerInfo()= "   +  servletContext.getServerInfo());

        
try   {
            System.out.println(
" servletContext.getResource(\ " / \ " )= "   +  servletContext.getResource( " / " ));
        }

        
catch  (MalformedURLException e)  {
            e.printStackTrace();
        }

        
//  request
        System.out.println( " request.getContextPath()= "   +  request.getContextPath());
        System.out.println(
" request.getLocalAddr()= "   +  request.getLocalAddr());
        System.out.println(
" request.getLocalName()= "   +  request.getLocalName());
        System.out.println(
" request.getLocalPort()= "   +  request.getLocalPort());
        System.out.println(
" request.getPathInfo()= "   +  request.getPathInfo());
        System.out.println(
" request.getPathTranslated()= "   +  request.getPathTranslated());
        System.out.println(
" request.getProtocol()= "   +  request.getProtocol());
        System.out.println(
" request.getQueryString()= "   +  request.getQueryString());
        System.out.println(
" request.getRealPath(\ " \ " )已过时= "   +  request.getRealPath( "" ));
        System.out.println(
" request.getRemoteAddr()= "   +  request.getRemoteAddr());
        System.out.println(
" request.getRemoteHost()= "   +  request.getRemoteHost());
        System.out.println(
" request.getRemotePort()= "   +  request.getRemotePort());
        System.out.println(
" request.getRemoteUser()= "   +  request.getRemoteUser());
        System.out.println(
" request.getRequestURI()= "   +  request.getRequestURI());
        System.out.println(
" request.getRequestURL()= "   +  request.getRequestURL());
        System.out.println(
" request.getScheme()= "   +  request.getScheme());
        System.out.println(
" request.getServerName()= "   +  request.getServerName());
        System.out.println(
" request.getServerPort()= "   +  request.getServerPort());
        System.out.println(
" request.getServletPath()= "   +  request.getServletPath());
        System.out.println(
" request.getUserPrincipal()= "   +  request.getUserPrincipal());


        servletContext.getContextPath()
=
        servletContext.getRealPath(
" / " ) = F:\ess - branch\web\
        servletContext.getRealPath(
"" ) = F:\ess - branch\web
        servletContext.getContextPath()
=
        servletContext.getServerInfo()
= Apache Tomcat / 6.0 . 18
        servletContext.getResource(
" / " ) = jndi: / localhost /

        request.getContextPath()
=
        request.getLocalAddr()
= 127.0 . 0.1
        request.getLocalName()
= localhost
        request.getLocalPort()
= 8090
        request.getPathInfo()
= null
        request.getPathTranslated()
= null
        request.getProtocol()
= HTTP / 1.1
        request.getQueryString()
= null
        request.getRealPath(
"" )已过时 = F:\ess - branch\web
        request.getRemoteAddr()
= 127.0 . 0.1
        request.getRemoteHost()
= 127.0 . 0.1
        request.getRemotePort()
= 3288
        request.getRemoteUser()
= null
        request.getRequestURI()
=/ support / indexinfo / uploadPicture.htm
        request.getRequestURL()
= http: // localhost:8090/support/indexinfo/uploadPicture.htm
        request.getScheme() = http
        request.getServerName()
= localhost
        request.getServerPort()
= 8090
        request.getServletPath()
=/ support / indexinfo / uploadPicture.htm
        request.getUserPrincipal()
= null

只有注册用户登录后才能发表评论。


网站导航: