Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Jochen
Sunday, August 6th, 2006 at 6:55:37am MDT 

  1. package servlet;
  2.  
  3. import java.io.*;
  4. import java.net.*;
  5. import java.util.*;
  6. import java.text.*;
  7. import java.rmi.*;
  8. import javax.rmi.*;
  9. import javax.naming.*;
  10. import javax.servlet.*;
  11. import javax.servlet.http.*;
  12. import vfmcontroller.*;
  13.  
  14.  
  15. public class Test extends HttpServlet {
  16.    
  17.  
  18.     protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  19.         response.setContentType("text/plain;charset=UTF-8");
  20.         PrintWriter out = response.getWriter();
  21.         DateFormat df   = new SimpleDateFormat( "dd.MM.yyyy HH:mm:ss.SSS" );
  22.         out.println( "SESSION_ID : " + request.getSession().getId() );
  23.         out.println( "TIME       : " + df.format(new Date()) );
  24.         out.println( "" );
  25.        
  26.         try {
  27.             Context ctx              = new InitialContext();
  28.             Object obj_ref           = ctx.lookup( "vfmcontroller/VFMController" );
  29.             VFMControllerHome home   = (VFMControllerHome)PortableRemoteObject.narrow( obj_ref, VFMControllerHome.class );
  30.             VFMController controller = home.create();
  31.             String time              = controller.getTime();
  32.             out.println( "TIME = " + time );
  33.         } catch (Throwable error) {
  34.             out.println( "ERROR:" );
  35.             error.printStackTrace( out );
  36.             Throwable cause = error.getCause();
  37.             if (cause != null) cause.printStackTrace( out );
  38.         }
  39.         out.close();
  40.     }
  41.    
  42.  
  43.    
  44.     protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  45.         processRequest(request, response);
  46.     }
  47.     protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
  48.         processRequest(request, response);
  49.     }
  50.     public String getServletInfo() {
  51.         return "Short description";
  52.     }
  53. }

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

worth-right
fantasy-obligation