File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes FileNotFoundException: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark " FileNotFoundException: " Watch " FileNotFoundException: " New topic
Author FileNotFoundException:

Inderveer singh

Joined: Feb 08, 2005
Posts: 15
I have to attach the input stream of the html page that is being dispalyed as an HTML.
i am doing this.

String l_servletUrl = null;
URL l_serv = null;
URLConnection l_conn = null;
InputStream in = null;

strServerName= InetAddress.getByName( req.getServerName()).getHostAddress();
strServerPort = new Integer( req.getServerPort() ).toString();
strContextPath = req.getContextPath();

l_servletUrl = "http://" + strServerName + ":" + strServerPort+strContextPath + "/letterMail.jsp" ;

l_serv = new URL(l_servletUrl);
l_conn = l_serv.openConnection();
in = l_conn.getInputStream(); // will this return html stream ?

now i want to Attach the Stream as html attachment and send mail
The requirement is we can not save this as a file on disk and attach.

Or How can i directly attach the input stream.

in line
in = l_conn.getInputStream();

i am getting an error
SystemErr R at va:595).

Can anyone help. Why this error is coming
Valentin Tanase
Ranch Hand

Joined: Feb 17, 2005
Posts: 704
Can you please make clear one thing: is this a server code (the code above runs within another servlet) or it is a client code?

I think, therefore I exist -- Rene Descartes
Inderveer singh

Joined: Feb 08, 2005
Posts: 15
The code above is the server code. It is part of my action class which is called when the user clicks on the button on the lettermail.jsp after entering some data fields.
Then i want that jsp as inputStream
I agree. Here's the link:
subject: FileNotFoundException:
jQuery in Action, 3rd edition