Hi Nic,

Just a question or two relating to the example you kindly provided
(below)

In my application, I want to deliver an HTML report as the result of
calling
the servlet.  In the example I can't see anything being output following
the

        >   String checkUrl = request.getServletPath();
        >   out.println("<html><body><a href='" + checkUrl + "'>");
        >   out.println("Check the call here");
        >   out.println("</a></body></html>");
        >   // The client sees a completed page from here
        >   out.close();

I assume the results are seen at "checkUrl" - which is the servlet
itself.  

This being the case, I guess there would be some conditional code that
inspects
the session variable to check for completion before your results are
formatted
and output.


Something along the lines of 

        if( session.statusVar == completed )
        {
                format results and output with out.println()
        }
        else
        {
                still working, out the same "busy" page
        }

I suppose this would live in the goGet() method.

If I wanted to avoid the user have to keep clicking, I suppose could put

an auto-refresh header thingy in the busy page HTML. (Good or bad idea?)


Lastly, is there something more generic I could do using Filters?
Ideally I'd like to set up a "BusyFilter" that maps to the URL
pattern 

        /servlet/apps/*

Ideally this would display a busy page for any /servlet/apps... request
and require coding only in one place.

Thanks again,
Chris




> 
> 
> So here's an almost complete example of a servlet's doPost:
> 
> public void doPost (...)
> {
>   PrintWriter out = response.getWriter();
>   response.setContentType("text/html");
>   String caller = request.getParameter("caller");
>   String problem = request.getParameter("problem");
>   String priority = request.getParameter("priority");
> 
>   HttpSession session = request.getSession();
>   Hashtable callDetails = new Hashtable();
>   session.setAttribute("caller", callDetails);
> 
>   String checkUrl = request.getServletPath();
>   out.println("<html><body><a href='" + checkUrl + "'>");
>   out.println("Check the call here");
>   out.println("</a></body></html>");
>   // The client sees a completed page from here
>   out.close();
> 
>   try {
>     Connection con = conPool.getConnection();
>     CallableStatement create
>       = con.prepareCall("{ ? = call call_make ( ?, ? ) }");
>     create.setString(2, caller);
>     create.setString(3, problem);
>     create.execute();
>     String callId = create.getString(1);
> 
>     // Update the record
>     callDetails.put(callId, "");
> 
>     CallableStatement create
>       = con.prepareCall("{ call call_set_pri ( ?, ? ) }");
>     create.setString(1, callId);
>     create.setString(2, priority);
>     create.execute();
> 
>     callDetails.put(callId, priority);
>   }
>   catch (SQLException e) {
>      throw new AghException(e);
>   }
>   finally {
>     conPool.returnConnection(con);
>   }
> }
> 

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to