Do you need to alter your JRE security file in any way to get a Servlet
to print?

I have a bit of an odd situation that I am hoping somebody can give me a
clue about.

I have a servlet that retrieves large multipage strings from a database
and then sends those strings to an applet.

The servlet also sends this string to a printer.

The servlet is sitting on a server running NT server 4.0 and Servlet
Exec 2.0.2.

The servlet uses an accessory class I made called
"PrintSummaryStatements".   This class reads from a file, writes to
file, and sends the string to the printer.

The reading and writing functions of this class work.    The printing
function worked when I tested it outside of the servlet.

However, when the servlet calls this printing funciton NOTHING
happens.    A java exception gets thrown that says "Access Denied".  The
accessory class is in the same directory as the servlet.

My  boss is a networking guru.  I had him check the server the servlet
is sitting on and he says all of the persmissions are wide open.

I guess I am stuck as to what the way out is.

You can download the java files for the servlet and its accessory class
"PrintSummaryStatements" at:
http://softdev.nimh.nih.gov/Projects/Temp/question.html


The printing function in question is fairly short.   Here it is:

public void printAsText( String sSummaryStatement )
{
        String sFormattedSummaryStatement;
        sFormattedSummaryStatement = format(sSummaryStatement);

        try
        {
            FileOutputStream fos = new
FileOutputStream("\\\\softdev\\nimhsdhp5port");
            PrintStream ps = new PrintStream(fos);
            ps.print("\r");
            ps.print(sFormattedSummaryStatement);
            ps.print("\f");
            ps.close();
        }
        catch ( Exception e )
        {
            System.err.println("Summary Statement Did Not Print: " + e);
        }
  }// end function printAsText()

The  function called "format" is another function in the accessory class
that this function also belongs to.  It works.  The path to the printer
has the right amount of slashes.

Any help would be greatly appreciated

Thanks in adavance


--
Steve
[EMAIL PROTECTED]

The Java Resource Dump:
http://www.geocities.com/RainForest/Canopy/4774/Java/

___________________________________________________________________________
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