Re: Send a file back for saving and give it a name??

2000-11-30 Thread Joakim Olsson

Hi,

you can use

response.setHeader("Content-Disposition", "attachment;
filename=\"MyFile.txt\"")

Regards
Joakim


> -Original Message-
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Duffey, Kevin
> Sent: den 30 november 2000 04:37
> To: [EMAIL PROTECTED]
> Subject: [JSP-INTEREST] Send a file back for saving and give it a name??
>
>
> Hi there,
>
> We have on our site the ability for users to select a document id and it
> will return a file for them to save (and later reuse). The document is
> created dynamically in memory on the server, and we set the contentType to
> application which DOES pop up the "Save As" dialog box on the clients
> machine. They can save the text file. The problem is, the filename that is
> in the dialog is the path used to call the servlet. In our case, we are
> using an MVC framework with .do mapped to a controller servlet. We have a
> /download.do and every time..no matter what file we send back, the dialog
> that pops up saves it as dialog.do. Is there any way at all to change the
> name of the file that appears in the dialog box?
>
> Thank you very much.
>
> ==
> =
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set
> JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



JSP FAQ & Resource Information

2000-11-30 Thread Anil K. Vijendran

This is a weekly informative posting to the jsp-interest list.



Before asking questions of a general nature, please check out the
resources available online to see if your question already has an
answer. The best place to start is our web site:

http://java.sun.com/products/jsp

Some FAQs that may help you

http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

The archives of this list are available at:

http://archives.java.sun.com/archives/jsp-interest.html

Tomcat is the reference implementation for the latest JSP and Servlet
specs. You can download Tomcat from the Jakarta project's website:
http://jakarta.apache.org.

For feedback and discussion on Tomcat, please use the mailing list
[EMAIL PROTECTED]


A few notes about the use of this list. We at Sun enjoy hosting this
list to give everyone a forum to discuss JSP, servlets and related
technology. There are a few things that we ask of you, the list
members:

Please don't engage in advertising. We like to hear when new
products are announced and a link for all the
information. What we don't like are lengthy press releases,
advertisements, and other material which falls under the
umbrella term "marketing". There is no problem in stating how
your product compares to another, but remember, this isn't run
by Sun to be an advertising forum -- but as a technical forum.

Please don't post attachments to the list. The use of VCards
and S/MIME is not really needed on a list like this and is
annoying to some whose readers don't support them. More
serious is the posting of .zip files and other larger
items. You might get flamed a little bit for S/MIME or posting
in HTML. You will be removed from the list for posting a .zip
or other archive file.

If you need technical support from a vendor, please contact
that vendor directly.



Now, back to regularly scheduled programming.

Anil Vijendran
for the JSP/Tomcat team

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: a doubt on sessions

2000-11-30 Thread G.Nagarajan

There is always a default session expiry time. This can be overridden by the
servlet. There is no way by which the session can be invalidated if the
browser
is closed. This is not possible using html and servlets alone.

If you want to continuously monitor the user, you have to use an applet
which
"pings" the server at regular intervals or some complex JavaScript and
frames.

The best solution is the simplest solution (for us programmers!). Put as
much
resources as possible into the server and don't worry about session expiry
etc.

or maybe you can implement your own session handling logic using cookies and
a database like oracle. In this case, you can dedicate a set of boxes for
session management alone and can be isolated from the web server.

Is there any third party tool which takes care of these? It would be great
and
save lots of time and effort.

Regards,
Nagaraj.

-Original Message-
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Ying Sun
Sent: Wednesday, November 29, 2000 6:58 PM
To: [EMAIL PROTECTED]
Subject: Re: a doubt on sessions


If the servlet doesn't set the session time,when the user close the
browser,the
session will automatically expired.But if the servlet set the session time
say 30
minutes,and user close the brower only in 15 minutes,how to invalidate the
session?which  method to invoke when the user close the browser?

Thanks in advance,
chris

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Java mailing list?

2000-11-30 Thread Alan KF LAU

I wish I'd not get flame asking naive question.

Is there an active java forum/mailing/IRC channel I can lure?

Alan.

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: downloading files over HTTPS

2000-11-30 Thread Satyaki Ghosh Dastidar

there's a utility bean at www.jspSmart.com .one of our friends over here
referred about that in this forum..See if it works for u

- Original Message -
From: Mr. chen <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 30, 2000 10:55 AM
Subject: downloading files over HTTPS


> Hi ,every one:
> how can I download files over HTTP?
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: problem of passing the request parameters

2000-11-30 Thread Shuja Nawaz

Yep there is a problem of multipart formdata.
- Original Message -
From: "Muhammad Asim Ajmal" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 30, 2000 12:37 PM
Subject: problem of passing the request parameters


> Hi all.
>
> Currently I'm facing the problem of passing the request parameters
> to the next form. When I use encrypt multipart/formdata in the form tag
> the images are properly uploaded but the request parameters are not
> passed to the next page by submitting the data.
>
> Thank you in anticipation for sparing your time.
>
> From
>  : Shuwaz.
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



sending a mail from JSP with JavaMail

2000-11-30 Thread Monica Minaya

Hi,

We're using JavaMail for sending mail messages from a jsp page and we're
having some problems
with the received subject.
When the subject contains written accent characters (for example: ó) the

received mail has a bad formatted subject.

Any ideas?

Thanks.

Mónica.

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Multipart Encryption Problem.

2000-11-30 Thread Shuja Nawaz

I hava an upload servlet which works fine by using
FORM name= "thisForm" action="Review.jsp"  method=post
enctype="multipart/form-data"
The image is properly uploaded but the rest of the request parameters on the
form  are not posted
to next form (Review.jsp) . This problem  occurs only when I use
enctype="multipart/form-data".

Thank you in anticipation for the suggestion and help.
Thanx.

From
   Shuwaz

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Opening a word document file through a JSP/servlet

2000-11-30 Thread Sanjay Gomes

 Hi guys
 Could someone help me in finding a solution for this
I have a Word document file on Server. I want to open this file in a JSP

Could this be done if yes so how

TIA
Sanjay

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Off the Topic

2000-11-30 Thread yogesh kumar bajaj

Hi
 Sorry to ask this off the topic question, Does any body knows of Java
library to convert TIFF files to PDF files and vice versa.

Regards
Bajaj

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



javax.servlet not found in import

2000-11-30 Thread maurice coyle

Hello,
Whenever i compile a servlet that has an
import javax.servlet.http.*;  in it, i get a "javax.servlet.http.* not
found in import" error message.  Is this something to do with my Servlet
API, or my WebServer?

sorry if this is considered off-topic.

Maurice

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Is possible to access an HttpSession with its ID from anothersession ?

2000-11-30 Thread Peter Pilgrim

Yep

Have a look at the SessionListServlet? in the "Instant Java Servlets" book
(unfortunately the Servlets are 2.0 and the JSP is 1.0 but it's still a good
book with loads of code).
It maintains a list of session in separate hashtable class, and uses
the HttpSessionBindingListerner etc.

--
Peter Pilgrim
G.O.A.T
"the Greatest Of All Time"


 Message History 



From: "Craig R. McClanahan" <[EMAIL PROTECTED]>@java.sun.com> on 29/11/2000 
16:40 PST

Please respond to A mailing list about Java Server Pages specification and reference 
<[EMAIL PROTECTED]>

DELEGATED - Sent by: A mailing list about Java Server Pages specification and 
[EMAIL PROTECTED]>


To:   [EMAIL PROTECTED]
cc:
Subject:  Re: Is possible to access an HttpSession with its ID from anothersession ?


"Duffey, Kevin" wrote:

> Not any more. Servlet 2.1 deprecated that ability. I don't know if Servlet
> 2.2 removed it..but due to security risks, they removed the ability
> (deprecated it) so that one session couldn't gain access to another.

It is still deprecated, but not removed so that binary compatibility doesn't get
broken.

> Its too
> bad because it would be nice to have the ability to search through all
> active sessions, display them, etc..like an Admin page where we can see
> where a person is on the site, how many people are active, logged in, etc.
>

All of those things can be accomplished with some appropriate coding (such as the
previous suggestion on this thread to maintain a collection in application scope
that is keyed by session id so you can access shared information).





--

This e-mail may contain confidential and/or privileged information. If you are not the 
intended recipient (or have received this e-mail in error) please notify the sender 
immediately and destroy this e-mail. Any unauthorised copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Opening a word document file through a JSP/servlet

2000-11-30 Thread Thompson Willard

For Excel:

<%@ page contentType="application/vnd.ms-excel" %>

So for Word I believe its:

<%@ page contentType="application/msword" %>

But you'll need to do a little more to open an already made word doc.


-Original Message-
From: Sanjay Gomes [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 30, 2000 4:03 AM
To: [EMAIL PROTECTED]
Subject: Opening a word document file through a JSP/servlet


 Hi guys
 Could someone help me in finding a solution for this
I have a Word document file on Server. I want to open this file in a JSP

Could this be done if yes so how

TIA
Sanjay

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: javax.servlet not found in import

2000-11-30 Thread Krishna Kant

set ur classpath to point to the servlet.jar of ur webserver

-kk

maurice coyle wrote:

> Hello,
> Whenever i compile a servlet that has an
> import javax.servlet.http.*;  in it, i get a "javax.servlet.http.* not
> found in import" error message.  Is this something to do with my Servlet
> API, or my WebServer?
>
> sorry if this is considered off-topic.
>
> Maurice
>
> ===
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: javax.servlet not found in import

2000-11-30 Thread Raghu Movva

include the following in the classpath
d:\javawebserver2.0\lib\servlet.jar;
where javawebserver2.0 is the roor where u install javawebserver

- Original Message -
From: maurice coyle <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 30, 2000 4:08 PM
Subject: javax.servlet not found in import


> Hello,
> Whenever i compile a servlet that has an
> import javax.servlet.http.*;  in it, i get a "javax.servlet.http.* not
> found in import" error message.  Is this something to do with my Servlet
> API, or my WebServer?
>
> sorry if this is considered off-topic.
>
> Maurice
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Opening a word document file through a JSP/servlet

2000-11-30 Thread Sanjay Gomes

But is it possible to read a .doc file
bcoz I tried to read the file thro a BufferedReader
and it reads the file in chars which in effect gets the wrong data
So when the document opens up it has some illegible characters
I tried the same with a txt file and it was able to read the txt perfectly

The solution could be to read the file in terms of bytes and output the same
to
the client so that the file gets sent to the Word Application uninterpreted
by Java

My Servlet is as

  import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class CVUpload extends HttpServlet
{
 public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
 {
 String str="";
 res.setContentType("application/vnd.ms-excel");
  //PrintWriter out=res.getWriter();
  BufferedReader in= new BufferedReader(new FileReader("c:/Test.txt"));

  while((str=in.readLine())!=null)
  {
  out.print(str);

   }

  }
}

TIA
Sanjay



-Original Message-
From: Thompson Willard [mailto:[EMAIL PROTECTED]]
Sent: 30 November 2000 12:37
To: [EMAIL PROTECTED]
Subject: Re: Opening a word document file through a JSP/servlet


For Excel:

<%@ page contentType="application/vnd.ms-excel" %>

So for Word I believe its:

<%@ page contentType="application/msword" %>

But you'll need to do a little more to open an already made word doc.


-Original Message-
From: Sanjay Gomes [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 30, 2000 4:03 AM
To: [EMAIL PROTECTED]
Subject: Opening a word document file through a JSP/servlet


 Hi guys
 Could someone help me in finding a solution for this
I have a Word document file on Server. I want to open this file in a JSP

Could this be done if yes so how

TIA
Sanjay

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



IllegalStateException

2000-11-30 Thread Berger, Richard

Hi,
I am getting an 'IllegalStateException : reset() failed - data has already
been sent to client' from my servlet. It is caused generally when a user
hits a menu option multiple times without waiting for any response. Is there
any way avoiding this occurring or stopping multiple identical requests from
being processed ?

Any help would be appreciated.

Thanks

Richard

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: finally, something interesting!

2000-11-30 Thread Antonio W. Lagnada

Hi Everyone,

Instead of creating a public function.  It may help to employ "polymorphism"
as it was designed to be.  Instantiate the base class and assign it to
the object in use and call the method.


Here's an example code.  The output of this code is:
I am the toplevel class.
I am class A
I am class B

// PolyTest.java
// Test polymorphism in java

class Top {
   protected void doShow() {
  System.out.println("I am the toplevel class.");
   }
}
class A extends Top {
   public void doShow() {
  System.out.println("I am class A");
   }
}
class B extends Top {
   public void doShow() {
  System.out.println("I am class B");
   }
}
public class PolyTest {

 public static void main( String[] args ) {
   Top t = new Top();

   A a = new A();
   B b = new B();

   t.doShow();

   t = a;
   t.doShow();

   t = b;
   t.doShow();
 }

}



--
Antonio W. Lagnada
Ecommerce Consultant
[EMAIL PROTECTED]

This email address is specifically
for JSP-Interest email list.
Remove _NOSPAM for the actual email.



 Shawn Zhu <[EMAIL PROTECTED]> wrote:
> Yep Namratha, you got 2 of the 3 ways I know.
> in summary,
> I can sort of achieve what I asked in the following:
> 1. interface
> 2. class inheritance
> 3. use of "InstanceOf"
>
> I've also thought about using Class and Method classes
> Like Venkatesh had mentioned, however, that does not
> work out.  Because we'll be looking for a method doShow()
> when we passed in Object which does not have such an method.
> It fails at compile time as well.
>
> After the above said, now lets say if you were only give
> Class A, B, And C, i.e. those class all have been created, like
> those prepackaged classes, you can't change their implementations.
> Now is it still possible to have a ShowAll method?
>
> > -Original Message-
> > From: Namratha Reddy [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, November 22, 2000 1:54 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: finally, something interesting!
> >
> >
> > You could accomplish this in one of many ways:
> > 1. Create an interface with the signature of the 'doShow'
> > method and make the
> > classes A, B, and C implement this interface.
> >
> > 2. Use inheritance: Create a class X and have classes A, B,
> > and C extend that
> > class.
> > and the doShow methods are defined as follows:
> >   in A:
> >   doShow()
> >   {
> > System.out.println("Doshow method in Class A");
> >   }
> >
> >   in B:
> >   doShow()
> >   {
> > System.out.println("Doshow method in Class B");
> >   }
> >
> >   in C:
> >   doShow()
> >   {
> > System.out.println("Doshow method in Class C");
> >   }
> >
> > Then in the show method:
> >   public void show(X var)
> >   {
> > var.doShow();
> >   }
> >
> > and in the calling method if you have the following:
> >   A var1 = new A();
> >   B var2 = new B();
> >   C var3 = new C();
> >
> >   show(var1);
> >   show(var2);
> >   show(var3);
> >
> > The output will be as follows:
> >   Doshow method in Class A
> >   Doshow method in Class B
> >   Doshow method in Class C
> >
> > Hope this helps.
> > > Scope: Java
> > > Q:
> > > if you have three class A, B, and C all have the same
> > method doShow();
> > > We only know that all inherit from Class Object (like all
> > other classes do).
> > >
> > > Is it possible to have a public function that takes in an
> > Class Object that
> > > may belong
> > > to A, B, or C, and call doShow()?
> > >
> > > Something conception like:
> > >
> > > public void show(Object o) {
> > > o.doShow();
> > > }
> > >
> > > Of course the above code won't compile.  One way to hack it
> > is to use
> > > "InstanceOf" (one of the answer) but it's a unclean hack.
> > >
> > > Anyone has any better ideas?  I thought about going from
> > Object.getClass(),
> > > but it does
> > > not seem to be the way.
> > >
> > >
> > ==
> > =
> > > To unsubscribe: mailto [EMAIL PROTECTED] with body:
> > "signoff JSP-
> > INTEREST".
> > > For digest: mailto [EMAIL PROTECTED] with body: "set
> > JSP-INTEREST DIGEST".
> > > Some relevant FAQs on JSP/Servlets can be found at:
> > >
> > >  http://java.sun.com/products/jsp/faq.html
> > >  http://www.esperanto.org.nz/jsp/jspfaq.html
> > >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> > >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
> > Namratha Reddy
> > Staff Consultant
> > High Gear Inc.
> >
> > Phone: (262)814-1660 ext.522
> > E-Mail: [EMAIL PROTECTED]
> > www.high-gear.com
> >
> > ==
> > =
> > To unsubscribe: mailto [EMAIL PROTECTED] with body:
> > "signoff JSP-INTEREST".
> > For digest: mailto [EMAIL PROTECTED] with body: "set
> > JSP-INTEREST DIGEST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name

Re: sending a mail from JSP with JavaMail

2000-11-30 Thread Wilhelm Colln

Can I see your code ?

W


Monica Minaya wrote:

> Hi,
>
> We're using JavaMail for sending mail messages from a jsp page and we're
> having some problems
> with the received subject.
> When the subject contains written accent characters (for example: ó) the
>
> received mail has a bad formatted subject.
>
> Any ideas?
>
> Thanks.
>
> Mónica.
>
> ===
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Debugging JAVA/JSP using Sun's Forte for JAVA

2000-11-30 Thread Richard John

Hi,

I'm doing some simple development using SUNs free Forte for Java Community
Edition.  Quite impressed with it so far.  My application uses a very thin
JSP and uses JAVA classes / Beans on the server for database connections,
error handling and as much as possible really.

My question is:  Can I invoke the debugger to debug my JAVA classes by
executing the JSP file?  Or am I just better off writing stub classes to
execute my server side classes?


If this is not possible, can anyone convert an Exception.printStacktrace to
a String for me?  :)

Thanks for your help.




  Richard John


Caplin Systems - Introducing the Real Time Web
http://www.caplin.com/

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Urgent.. servlet with images

2000-11-30 Thread Richard John

check this out, the author has kindly left all the source code for us to
view his photo collection.

http://www.magiccookie.com/

-Original Message-
From: Christian Hamann Linares [mailto:[EMAIL PROTECTED]]
Sent: 26 November 2000 22:34
To: [EMAIL PROTECTED]
Subject: Urgent.. servlet with images


Hi all
I have a several problem...
i have to use images... i have Oracle database, but i dont know what kind of
type i have to use for storing my image in. Besides, i have to query my Bd
and with ResultSet ask a image...
Can you help me What kind of type i have to use in my DataBase to My
Java program can ask the image and how can i do that. any example
please...
so... what type i have to use in my BD to store the image and how can obtain
this image by Java

atte


Christian Hamann Linares
Area de Desarrollo de Aplicaciones
FICS-DATA USMP
e-mail: [EMAIL PROTECTED]

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Opening a word document file through a JSP/servlet

2000-11-30 Thread Thompson Willard

I don't think you have to transfer data from word document (that resides on
the server or back end) to word document (for the client) but you might, I'm
not completely sure.  I'm sure JSP provides a way to grab the file instead,
perhaps.

What I was working on earlier was generating data (not from another
document) and present it in word in the browser for the client.  What you're
trying to do I believe is different.

-Original Message-
From: Sanjay Gomes [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 30, 2000 6:53 AM
To: [EMAIL PROTECTED]
Subject: Re: Opening a word document file through a JSP/servlet


But is it possible to read a .doc file
bcoz I tried to read the file thro a BufferedReader
and it reads the file in chars which in effect gets the wrong data
So when the document opens up it has some illegible characters
I tried the same with a txt file and it was able to read the txt perfectly

The solution could be to read the file in terms of bytes and output the same
to
the client so that the file gets sent to the Word Application uninterpreted
by Java

My Servlet is as

  import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class CVUpload extends HttpServlet
{
 public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
 {
 String str="";
 res.setContentType("application/vnd.ms-excel");
  //PrintWriter out=res.getWriter();
  BufferedReader in= new BufferedReader(new FileReader("c:/Test.txt"));

  while((str=in.readLine())!=null)
  {
  out.print(str);

   }

  }
}

TIA
Sanjay



-Original Message-
From: Thompson Willard [mailto:[EMAIL PROTECTED]]
Sent: 30 November 2000 12:37
To: [EMAIL PROTECTED]
Subject: Re: Opening a word document file through a JSP/servlet


For Excel:

<%@ page contentType="application/vnd.ms-excel" %>

So for Word I believe its:

<%@ page contentType="application/msword" %>

But you'll need to do a little more to open an already made word doc.


-Original Message-
From: Sanjay Gomes [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 30, 2000 4:03 AM
To: [EMAIL PROTECTED]
Subject: Opening a word document file through a JSP/servlet


 Hi guys
 Could someone help me in finding a solution for this
I have a Word document file on Server. I want to open this file in a JSP

Could this be done if yes so how

TIA
Sanjay

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Question on Imaging

2000-11-30 Thread Mukka, Srikanth

Hi All,

Any ideas on how to scan a image using JSP, this jsp has to talk to some
methods.

2) How to save the image which is there in the frame, may be this has some
thing to do with applets.

Waiting for your response

Bye
Srikanth

-Original Message-
From: Mircea Moisei [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 29, 2000 5:23 PM
To: [EMAIL PROTECTED]
Subject: Re: How to call EJBean from JSP?


This is working when both are on the same machine what about when the jsp is
running on a web tier and the ejb itself is deployed on different machine.
How do I connect my jsp with the ejb.
I've try using j2ee server but is not working.
Regards,
Mircea

- Original Message -
From: "Zaki Abu-Bakar" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, July 13, 2000 6:22 AM
Subject: Re: How to call EJBean from JSP?


> Here is the code. I hope that it will be understandable for you.
>
>
> 
> 
> Bonus Calculation
> 
> <%-- Comment
> Scriptlet for import statements
> <%@ indicates a jsp directive --%>
> <%@ page import="javax.naming.*" %>
> <%@ page import="javax.rmi.PortableRemoteObject" %>
> <%@ page import="Beans.*" %>
> <%-- Comment
> Scriptlet to get the parameters,
> convert string to Integer to int for bonus
> calculation, and declare/initialize bonus
> variable. <% indicates a jsp scriptlet --%>
> <%! String strMult, socsec; %>
> <%! Integer integerMult; %>
> <%! int multiplier; %>
> <%! double bonus; %>
> <%
> strMult = request.getParameter("MULTIPLIER");
> socsec = request.getParameter("SOCSEC");
> integerMult = new Integer(strMult);
> multiplier = integerMult.intValue();
> bonus = 100.00;
> %>
> <%-- Comment
> Scriptlet to look up session Bean --%>
> <%
> InitialContext ctx = new InitialContext();
> Object objref = ctx.lookup("calcs");
> CalcHome homecalc = (CalcHome)
> PortableRemoteObject.narrow(
> objref, CalcHome.class);
> %>.MARCH 20, 2000 59
> <%-- Comment
> Scriptlet to create session Bean,
> call calcBonus method, and retrieve a database
> record by the social security number
> (primary key) --%>
> <%
> try {
> Calc theCalculation = homecalc.create();
> Bonus theBonus = theCalculation.calcBonus(
> multiplier,
> bonus,
> socsec);
> Bonus record = theCalculation.getRecord(socsec);
> %>
> <%-- Comment
> HTML code to display retrieved data
> on returned HTML page. --%>
> Bonus Calculation
> Social security number retrieved:
> <%= record.getSocSec() %>
> 
> Bonus Amount retrieved: <%= record.getBonus() %>
> 
> <%-- Comment
> Scriptlet to catch DuplicateKeyException --%>
> <%
> } catch (javax.ejb.DuplicateKeyException e) {
> String message = e.getMessage();
> %>
> <%-- Comment
> HTML code to display original data passed to JSP
> on returned HTML page --%>
> Social security number passed in: <%= socsec %>
> 
> Multiplier passed in: <%= strMult %>
> 
> Error: <%= message %>
> <%-- Comment
> Scriptlet to close try and catch block --%>
> <%
> }
> %>
> <%-- Comment
> HTML code to close HTML body and page --%>
> 
> 
>
>
>
>
>
>
> Diwakar Killamsetty <[EMAIL PROTECTED]> on 07/13/2000 06:16:50 AM
>
> Please respond to A mailing list about Java Server Pages specification and
>   reference <[EMAIL PROTECTED]>
>
> To:   [EMAIL PROTECTED]
> cc:(bcc: Abubakar Zaki/Internal/Softworks)
>
> Subject:  How to call EJBean from JSP?
>
>
>
>
> Hi,
>
> I am novice to these technologies.
> I have an EJBean on one machine and JSPs on other, now if I want to use
the
> services of EJBean, I need to make a JNDI call. Can any one please let me
> know the procedure? And also how to write a deployment discriptor. Are
they
> any tutorials on web to explain all these things?
> Please help me.
>
> Thanks in advance.
>
> regards,
> Diwakar
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>
===
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.co

Re: Question on Imaging

2000-11-30 Thread Robert Chartier

Interesting.. This conversation came up a couple of days ago on an ASP
mailing list.

Basically, why would you want too?  Remember that the JSP file exists on
the SERVER, thus the scanning hardware will most likely also have to exist
on the server..And if this is the case, why would you need that?

You could develop a work around with the client software and some API that
you could hook into, but that would be a strict client side
situation.   Saving the image to the server could easily be done through
some Basic file uploader.




At 10:24 AM 11/30/00, you wrote:
>Hi All,
>
>Any ideas on how to scan a image using JSP, this jsp has to talk to some
>methods.
>
>2) How to save the image which is there in the frame, may be this has some
>thing to do with applets.
>
>Waiting for your response
>
>Bye
>Srikanth

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Opening a word document file through a JSP/servlet

2000-11-30 Thread Walker, Chris

If you just want to send the Word document to Word on the client then the
simplest way is to redirect to the .doc file.  You could also try setting
the MIME type of the response to "application/msword" and sending the
document as a stream of data.

If, on the other hand, you want to extract data from the Word document on
the server, you will have to find a way to use the Word COM or ActiveX
interface from Java.  I think it's supposed to be possible with M$ VJ++.

This is all theoretical - I've never done it myself.

Chris Walker
Brainbench MVP for ASP
http://www.brainbench.com



> -Original Message-
> From: Thompson Willard [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, November 30, 2000 3:03 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Opening a word document file through a JSP/servlet
>
>
> I don't think you have to transfer data from word document
> (that resides on
> the server or back end) to word document (for the client) but
> you might, I'm
> not completely sure.  I'm sure JSP provides a way to grab the
> file instead,
> perhaps.
>
> What I was working on earlier was generating data (not
> from another
> document) and present it in word in the browser for the
> client.  What you're
> trying to do I believe is different.
>
> -Original Message-
> From: Sanjay Gomes [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, November 30, 2000 6:53 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Opening a word document file through a JSP/servlet
>
>
> But is it possible to read a .doc file
> bcoz I tried to read the file thro a BufferedReader
> and it reads the file in chars which in effect gets the wrong data
> So when the document opens up it has some illegible characters
> I tried the same with a txt file and it was able to read the
> txt perfectly
>
> The solution could be to read the file in terms of bytes and
> output the same
> to
> the client so that the file gets sent to the Word Application
> uninterpreted
> by Java
>
> My Servlet is as
>
>   import java.io.*;
> import javax.servlet.*;
> import javax.servlet.http.*;
>
> public class CVUpload extends HttpServlet
> {
>  public void doGet(HttpServletRequest req, HttpServletResponse res)
> throws ServletException, IOException
>  {
>  String str="";
>  res.setContentType("application/vnd.ms-excel");
>   //PrintWriter out=res.getWriter();
>   BufferedReader in= new BufferedReader(new
> FileReader("c:/Test.txt"));
>
>   while((str=in.readLine())!=null)
>   {
>   out.print(str);
>
>}
>
>   }
> }
>
> TIA
> Sanjay
>
>
>
> -Original Message-
> From: Thompson Willard [mailto:[EMAIL PROTECTED]]
> Sent: 30 November 2000 12:37
> To: [EMAIL PROTECTED]
> Subject: Re: Opening a word document file through a JSP/servlet
>
>
> For Excel:
>
> <%@ page contentType="application/vnd.ms-excel" %>
>
> So for Word I believe its:
>
> <%@ page contentType="application/msword" %>
>
> But you'll need to do a little more to open an already made word doc.
>
>
> -Original Message-
> From: Sanjay Gomes [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, November 30, 2000 4:03 AM
> To: [EMAIL PROTECTED]
> Subject: Opening a word document file through a JSP/servlet
>
>
>  Hi guys
>  Could someone help me in finding a solution for this
> I have a Word document file on Server. I want to open this
> file in a JSP
>
> Could this be done if yes so how
>
> TIA
> Sanjay
>
> ==
> =
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
> ==
> =
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
> ==
> =
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
> ==
> =
> To unsubscribe: mailto 

Re: Opening a word document file through a JSP/servlet

2000-11-30 Thread Sanjay Gomes

Hi Thomson,
Well What I want to do is display a document on  the server .But I dont want
the URL to be displayed for security purposes, that is why I want it to be
gone thro a servlet. Oherwise it is very easy since If I do a simple
redirect to the file thro a JSP,it opens up the word and solves ur problem,
but displays the URL.
My problem can be solved if I am able in any way to read the file in a
continuous stream format
and in turn stream it to the clients browser then that should th trick, bcoz
otherwise  java tries to read the file according to its own interpretation
which destroys the information

TIA
sanjay

-Original Message-
From: Thompson Willard [mailto:[EMAIL PROTECTED]]
Sent: 30 November 2000 15:03
To: [EMAIL PROTECTED]
Subject: Re: Opening a word document file through a JSP/servlet


I don't think you have to transfer data from word document (that resides on
the server or back end) to word document (for the client) but you might, I'm
not completely sure.  I'm sure JSP provides a way to grab the file instead,
perhaps.

What I was working on earlier was generating data (not from another
document) and present it in word in the browser for the client.  What you're
trying to do I believe is different.

-Original Message-
From: Sanjay Gomes [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 30, 2000 6:53 AM
To: [EMAIL PROTECTED]
Subject: Re: Opening a word document file through a JSP/servlet


But is it possible to read a .doc file
bcoz I tried to read the file thro a BufferedReader
and it reads the file in chars which in effect gets the wrong data
So when the document opens up it has some illegible characters
I tried the same with a txt file and it was able to read the txt perfectly

The solution could be to read the file in terms of bytes and output the same
to
the client so that the file gets sent to the Word Application uninterpreted
by Java

My Servlet is as

  import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class CVUpload extends HttpServlet
{
 public void doGet(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException
 {
 String str="";
 res.setContentType("application/vnd.ms-excel");
  //PrintWriter out=res.getWriter();
  BufferedReader in= new BufferedReader(new FileReader("c:/Test.txt"));

  while((str=in.readLine())!=null)
  {
  out.print(str);

   }

  }
}

TIA
Sanjay



-Original Message-
From: Thompson Willard [mailto:[EMAIL PROTECTED]]
Sent: 30 November 2000 12:37
To: [EMAIL PROTECTED]
Subject: Re: Opening a word document file through a JSP/servlet


For Excel:

<%@ page contentType="application/vnd.ms-excel" %>

So for Word I believe its:

<%@ page contentType="application/msword" %>

But you'll need to do a little more to open an already made word doc.


-Original Message-
From: Sanjay Gomes [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 30, 2000 4:03 AM
To: [EMAIL PROTECTED]
Subject: Opening a word document file through a JSP/servlet


 Hi guys
 Could someone help me in finding a solution for this
I have a Word document file on Server. I want to open this file in a JSP

Could this be done if yes so how

TIA
Sanjay

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto

BASE HREF="" with Tomcat 3.2 ?

2000-11-30 Thread Peter Pilgrim

Hi

Am I doing the  wrong?
I put this inside  ..  of my JSP.


  Dosh Tosh
 

Then I wrote


 ..


Now my webapp should run no matter what the context name path is ?
The JSP should not care if the webapp is `foobar', `doggone' or `pilgpe'
Yet I get a bad connection servlet no found,
unless I explicity hard code it


 ..


Is this a TOMCAT 3.2 bug or just me getting it wrong again?

--
Peter Pilgrim
G.O.A.T
"the Greatest Of All Time"



--

This e-mail may contain confidential and/or privileged information. If you are not the 
intended recipient (or have received this e-mail in error) please notify the sender 
immediately and destroy this e-mail. Any unauthorised copying, disclosure or 
distribution of the material in this e-mail is strictly forbidden.

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Opening a word document file through a JSP/servlet

2000-11-30 Thread Mark Wutka

Use a FileInputStream instead of a FileReader to read the file, and from
your servlet, call getOutputStream instead of getWriter. You almost had it
except for the fact that you were using readers and writers.
   Mark

On Thu, 30 Nov 2000, Sanjay Gomes wrote:

> Hi Thomson,
> Well What I want to do is display a document on  the server .But I dont want
> the URL to be displayed for security purposes, that is why I want it to be
> gone thro a servlet. Oherwise it is very easy since If I do a simple
> redirect to the file thro a JSP,it opens up the word and solves ur problem,
> but displays the URL.
> My problem can be solved if I am able in any way to read the file in a
> continuous stream format
> and in turn stream it to the clients browser then that should th trick, bcoz
> otherwise  java tries to read the file according to its own interpretation
> which destroys the information
>
> TIA
> sanjay
>

--

Mark Wutka
Author of Special Edition Using Java Server Pages & Servlets (ISBN: 0789724413)

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Table data autometic scrolling ticker applets..

2000-11-30 Thread fau k

Hi all,


Please let me know any one have solution for  this problem..

My problem is:


1) I want to take data from a table.. by use jsp...
   It's ok.. there is no problem..



2) after that I want to display this information in Autometic virtical
scrolling  ticker applet .. with 4 rows at a time upto end of data.

So my question is How can I implement Autoscrolling in java Applet.. Is
there any API available??

Can I use JTable to disply the data in applet.. If it is ok, Who to scroll
the JTable autometically like scrolling ticker..

Please let me know any one have solution or sample code, I will appricate u.


3) After end of data.. I have to goback to table and look for the new data..
and I have to display same in scrolling ticker..

>From Applets.. How can I referesh..it..
I want get the data from tables... and I want to display in scrolling
ticker..

Please help in this solution..

I found some of scrolling text tickers.. but I am unable to find any help
for similar problem..

Please give me some guidelines.. then I will thankfull to u..

Please reply to this mail asap.

Thanks & Regards,
Malla Reddy Choodi
[EMAIL PROTECTED]

_
Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Is possible to access an HttpSession with its ID from another session ?

2000-11-30 Thread Clemente Dani

You could use the application context, but data will be available for
the rest of sessions.

- Mensaje Original -
De: Ismael Blesa Part <[EMAIL PROTECTED]>
Fecha: Miércoles, Noviembre 29, 2000 7:54 pm
Asunto: Is possible to access an HttpSession with its ID from another
session ?

> Is possible to access an HttpSession with its ID from another
> session ?
> I have an application and I need to pass some information from one
> session to another. Then I send the sessionID to a JSP where I
> want to
> get access to the two sessions, the created session and the session
> associated with the given ID.
>
> Is it possible with servlet 2.2 ?
>
> With servlet 2.1 it was possible, but the class used has been
> deprecated.
>
>
> Best regards,
> Ismael
>
>

===
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-
> INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>



Consigue tu cuenta gratuita de acceso a internet y de correo en
http://www.navegalia.com

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



jsp-interest@java.sun.com

2000-11-30 Thread TravisFalls

Hello,
I am creating a DBConnection Class that I am creating an instance of in a login class. 
 In this login class I pass a dynamic query string to DBConnection.  I have this 
deployed on a Weblogic server.  (yes I registered the servlet :) )I have an index page 
that calls a Login servlet where the DbConnection instance is.  I have registered the 
Data source name for my access 2000 database and still I get a server 500 error.  I 
don't have a URL to show but all my code for the two classes is as follows:


package com.thehartford.MusicStore;

/**
 * This class will define a connection to the MusicStore Database written in Microsoft 
Access 2000
 * Creation date: (11/24/00 3:03:11 PM)
 * @author: Travis D. Falls
 */
import java.sql.*;
import java.util.*;

public class DBConnection {
private Connection connection;
public String query1;
Statement stmt;
ResultSet rs;
public DBConnection(){
String pass;
String userId;


String url = "jdbc:odbc:MusicStore";

try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
connection = DriverManager.getConnection(
url);
}

catch(ClassNotFoundException cnfex){
System.err.println("Failed to load JDBC/ODBC Bridge Driver.");
cnfex.printStackTrace();
//System.exit(1);//Terminates attempted Connection
}
catch(SQLException sqlex){
System.err.println("Unable to Connect");
sqlex.printStackTrace();
}



try{
stmt = connection.createStatement();
rs = stmt.executeQuery(query1);
stmt.close();
}
catch( SQLException sqlex){
sqlex.printStackTrace();
}
}
}






package com.thehartford.MusicStore;

/**
 * Login Class accesses MusicStore Database and validates the user as being registered.
 * Creation date: (11/24/00 3:00:29 PM)
 * @author: Travis D. Falls
 */

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.sql.*;


public class Login extends HttpServlet{
public void doGet(HttpServletRequest req, HttpServletResponse res)
throws 
ServletException, IOException{

PrintWriter out;

res.setContentType("text/html");
out = res.getWriter();

StringBuffer buf = new StringBuffer();
String Un, Pw, Bn;

Un= req.getParameter("UserId");
Pw= req.getParameter("Password");
Bn= req.getParameter("BusinessName");
String pass = Pw;
String userId = Un;
String query= ("Select * from Customer where CustomerId = " +"'" + userId + 
"'" + " and Password = " + "'" + pass + "'");
DBConnection c = new DBConnection();
c.query1=query;
try{
if (c.rs.next()){
out.println ("you are in");

}

else{
out.println ("error on page");
}
}

catch(SQLException e){
out.println("SQL exception catught in the lgoin class" + 
e.getMessage());
}

}
public void doPost(HttpServletRequest req, HttpServletResponse res)
throws 
ServletException, IOException{

PrintWriter out;

res.setContentType("text/html");
out = res.getWriter();

StringBuffer buf = new StringBuffer();
String Un, Pw, Bn;

Un= req.getParameter("UserId");
Pw= req.getParameter("Password");
Bn= req.getParameter("BusinessName");
String pass = Pw;
String userId = Un;
String query= ("Select * from Customer where CustomerId = " +"'" + userId + 
"'" + " and Password = " + "'" + pass + "'");
DBConnection c = new DBConnection();
c.query1=query;
try{
if (c.rs.next()){
out.println ("you are in");

}

else{
out.println ("error on page");
}
}

catch(SQLException e){
out.println("SQL exception catught in the lgoin class" + 
e.getMessage());
}

}
}

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq

Using xml with jsp

2000-11-30 Thread Maximiliano Muller

Hello,

I used this code to parse an xml file:

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = factory.newDocumentBuilder();
Document doc = docBuilder.parse(new File("ejemplo.xml"));

Then I modified some nodes but the problem is that I don't know how to save
this changes.
Thanks

--

Maximiliano Muller
[EMAIL PROTECTED]

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Fw: How to call a remote EJBean from a Servlet/JSP using j2ee server

2000-11-30 Thread Mircea Moisei

- Original Message -
From: Mircea Moisei
To: A mailing list about Java Server Pages specification and reference
Sent: Thursday, November 30, 2000 1:32 PM
Subject: How to call a remote EJBean from a Servlet/JSP using j2ee server


Hi all,
I'm back. I think something is wrong somewhere. Let me explain what I'm
trying to achieve.
Reading thru Writing Enterprise Application with J2EE(Monica Pawlan, Sept
27th 2000 ) I build the very first example with CalcBean. After I run in
locally(localhost) using j2ee server from Sun I tried to deploy the bean to
a different machine.
I renamed the JNDI name for the one was locally deployed. I've redeployed
the application made from a web tier( on single Servlet and one single html
file) and the unused session stateless bean on my machine.
I've created a second application made only from the bean described above
and I deployed on the second machine. The JNDI name for second one is
"calcs".
When I'm trying to run it the lookup fails - the name "calcs" given to the
second bean is not visible.
(javax.naming.NameNotFoundException: calcs not found)
Here is the init method where it fails.

public void init(ServletConfig config) throws ServletException{

//Look up home interface
   try
   {
 //InitialContext ctx = new InitialContext();
//new code
Properties p = new Properties();
p.put(Context.PROVIDER_URL, "iiop://ddd.ddd.ddd.ddd:1050");
InitialContext ctx = new InitialContext(p);

Object objref = ctx.lookup("calcs");
 homecalc = (CalcHome)PortableRemoteObject.narrow(objref,
CalcHome.class);
   }
   catch (Exception NamingException)
  {
 NamingException.printStackTrace();
throw new ServletException( NamingException );
   }
  }

An additional test I've replace ddd.ddd.ddd.ddd with my IP address and
rename calcs with the name of the "local" EJB and it worked just fine.
 I have now some doubts about some security issues(policies) that I have to
take care of.
If anyone had ever a similar problem, please give me a hint to move on.
Thanks.

Regards,
Mircea



From: "Mark Wutka" <[EMAIL PROTECTED]>
To: "Mircea Moisei" <[EMAIL PROTECTED]>
Sent: Wednesday, November 29, 2000 5:02 PM
Subject: Re: How to call EJBean from JSP?


>
> You need to set up the provider URL for your naming service. You can set
> it two ways. First, you can set a system property called
> java.naming.provider.url. The URLs vary for different servers. If you're
> using Sun's reference implementation I *think* the parameter is:
> -Djava.naming.provider.url=iiop://yourejbhostname:1049
>
> You can also set the parameter when you create the InitialContext, and for
> a JSP that's probably your best bet since it's not always easy to set
> system properties for the JSP server. Do something like this:
>
> Properties p = new Properties();
> p.put(Context.PROVIDER_URL, "iiop://yourejbhostname:1049");
>
> Context ctx = new InitialContext(p);
>
> If you're using weblogic, the URL is t3://yourejbhostname:7001
>Mark
>
>  On Wed, 29 Nov 2000, Mircea Moisei wrote:
>
> > This is working when both are on the same machine what about when the
jsp is
> > running on a web tier and the ejb itself is deployed on different
machine.
> > How do I connect my jsp with the ejb.
> > I've try using j2ee server but is not working.
> > Regards,
> > Mircea
> >
>
> --
>
=Servlets

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Using xml with jsp

2000-11-30 Thread Daryani Santosh

Here's the code

Part 1 - This class writes xml node data to a file


import org.w3c.dom.*; // W3C DOM classes for traversing the document
import java.io.*;

/**
 * Output a DOM Level 1 Document object to a java.io.PrintWriter as a simple
 * XML document.  This class does not handle every type of DOM node, and it
 * doesn't deal with all the details of XML like DTDs, character encodings and
 * preserved and ignored whitespace.  However, it does output basic
 * well-formed XML that can be parsed by a non-validating parser.
 **/
public class XMLDocumentWriter {
PrintWriter out;  // the stream to send output to

/** Initialize the output stream */
public XMLDocumentWriter(PrintWriter out) { this.out = out; }

/** Close the output stream. */
public void close() { out.close(); }

/** Output a DOM Node (such as a Document) to the output stream */
public void write(Node node) { write(node, ""); }

/**
 * Output the specified DOM Node object, printing it using the specified
 * indentation string
 **/
public void write(Node node, String indent) {
// The output depends on the type of the node
switch(node.getNodeType()) {
case Node.DOCUMENT_NODE: {   // If its a Document node
Document doc = (Document)node;
out.println(indent + "");  // Output header
Node child = doc.getFirstChild();   // Get the first node
while(child != null) {  // Loop 'till no more nodes
write(child, indent);   // Output node
child = child.getNextSibling(); // Get next node
}
break;
}
case Node.DOCUMENT_TYPE_NODE: {  // It is a  tag
DocumentType doctype = (DocumentType) node;
// Note that the DOM Level 1 does not give us information about
// the the public or system ids of the doctype, so we can't output
// a complete  tag here.  We can do better with Level 2.
out.println("");
break;
}
case Node.ELEMENT_NODE: {// Most nodes are Elements
Element elt = (Element) node;
out.print(indent + "<" + elt.getTagName());   // Begin start tag
NamedNodeMap attrs = elt.getAttributes(); // Get attributes
for(int i = 0; i < attrs.getLength(); i++) {  // Loop through them
Node a = attrs.item(i);
out.print(" " + a.getNodeName() + "='" +  // Print attr. name
  fixup(a.getNodeValue()) + "'"); // Print attr. value
}
out.println(">"); // Finish start tag

String newindent = indent + "";   // Increase indent
Node child = elt.getFirstChild(); // Get child
while(child != null) {// Loop
write(child, newindent);  // Output child
child = child.getNextSibling();   // Get next child
}

out.println(indent + "");
break;
}
case Node.TEXT_NODE: {   // Plain text node
Text textNode = (Text)node;
String text = textNode.getData().trim();   // Strip off space
if ((text != null) && text.length() > 0)   // If non-empty
out.println(indent + fixup(text)); // print text
break;
}
case Node.PROCESSING_INSTRUCTION_NODE: {  // Handle PI nodes
ProcessingInstruction pi = (ProcessingInstruction)node;
out.println(indent + "");
break;
}
case Node.ENTITY_REFERENCE_NODE: {// Handle entities
out.println(indent + "&" + node.getNodeName() + ";");
break;
}
case Node.CDATA_SECTION_NODE: {   // Output CDATA sections
CDATASection cdata = (CDATASection)node;
// Careful! Don't put a CDATA section in the program itself!
out.println(indent + "<" + "![CDATA[" + cdata.getData() +
"]]" + ">");
break;
}
case Node.COMMENT_NODE: { // Comments
Comment c = (Comment)node;
out.println(indent + "");
break;
}
default:   // Hopefully, this won't happen too much!
System.err.println("Ignoring node: " + node.getClass().getName());
break;
}
}

// This method replaces reserved characters with entities.
String fixup(String s) {
StringBuffer sb = new StringBuffer();
int len = s.length();
for(int i = 0; i < len; i++) {
char c = s.charAt(i);
switch(c) {
default: sb.append(c); break;
case '<': sb.append("<"); break;
case '>': sb.append(">"); break;
case '&': sb.append("&"); break;

Re: Using xml with jsp

2000-11-30 Thread Daryani Santosh

Here's the code

Part 1 - This class writes xml node data to a file


import org.w3c.dom.*; // W3C DOM classes for traversing the document
import java.io.*;

/**
 * Output a DOM Level 1 Document object to a java.io.PrintWriter as a simple
 * XML document.  This class does not handle every type of DOM node, and it
 * doesn't deal with all the details of XML like DTDs, character encodings and
 * preserved and ignored whitespace.  However, it does output basic
 * well-formed XML that can be parsed by a non-validating parser.
 **/
public class XMLDocumentWriter {
PrintWriter out;  // the stream to send output to

/** Initialize the output stream */
public XMLDocumentWriter(PrintWriter out) { this.out = out; }

/** Close the output stream. */
public void close() { out.close(); }

/** Output a DOM Node (such as a Document) to the output stream */
public void write(Node node) { write(node, ""); }

/**
 * Output the specified DOM Node object, printing it using the specified
 * indentation string
 **/
public void write(Node node, String indent) {
// The output depends on the type of the node
switch(node.getNodeType()) {
case Node.DOCUMENT_NODE: {   // If its a Document node
Document doc = (Document)node;
out.println(indent + "");  // Output header
Node child = doc.getFirstChild();   // Get the first node
while(child != null) {  // Loop 'till no more nodes
write(child, indent);   // Output node
child = child.getNextSibling(); // Get next node
}
break;
}
case Node.DOCUMENT_TYPE_NODE: {  // It is a  tag
DocumentType doctype = (DocumentType) node;
// Note that the DOM Level 1 does not give us information about
// the the public or system ids of the doctype, so we can't output
// a complete  tag here.  We can do better with Level 2.
out.println("");
break;
}
case Node.ELEMENT_NODE: {// Most nodes are Elements
Element elt = (Element) node;
out.print(indent + "<" + elt.getTagName());   // Begin start tag
NamedNodeMap attrs = elt.getAttributes(); // Get attributes
for(int i = 0; i < attrs.getLength(); i++) {  // Loop through them
Node a = attrs.item(i);
out.print(" " + a.getNodeName() + "='" +  // Print attr. name
  fixup(a.getNodeValue()) + "'"); // Print attr. value
}
out.println(">"); // Finish start tag

String newindent = indent + "";   // Increase indent
Node child = elt.getFirstChild(); // Get child
while(child != null) {// Loop
write(child, newindent);  // Output child
child = child.getNextSibling();   // Get next child
}

out.println(indent + "");
break;
}
case Node.TEXT_NODE: {   // Plain text node
Text textNode = (Text)node;
String text = textNode.getData().trim();   // Strip off space
if ((text != null) && text.length() > 0)   // If non-empty
out.println(indent + fixup(text)); // print text
break;
}
case Node.PROCESSING_INSTRUCTION_NODE: {  // Handle PI nodes
ProcessingInstruction pi = (ProcessingInstruction)node;
out.println(indent + "");
break;
}
case Node.ENTITY_REFERENCE_NODE: {// Handle entities
out.println(indent + "&" + node.getNodeName() + ";");
break;
}
case Node.CDATA_SECTION_NODE: {   // Output CDATA sections
CDATASection cdata = (CDATASection)node;
// Careful! Don't put a CDATA section in the program itself!
out.println(indent + "<" + "![CDATA[" + cdata.getData() +
"]]" + ">");
break;
}
case Node.COMMENT_NODE: { // Comments
Comment c = (Comment)node;
out.println(indent + "");
break;
}
default:   // Hopefully, this won't happen too much!
System.err.println("Ignoring node: " + node.getClass().getName());
break;
}
}

// This method replaces reserved characters with entities.
String fixup(String s) {
StringBuffer sb = new StringBuffer();
int len = s.length();
for(int i = 0; i < len; i++) {
char c = s.charAt(i);
switch(c) {
default: sb.append(c); break;
case '<': sb.append("<"); break;
case '>': sb.append(">"); break;
case '&': sb.append("&"); break;

JSP contentType setting question in context of jsp:include action

2000-11-30 Thread Rich Carreiro

Here's the story...(using JWS 2.0...I know, I know :()

I have a page, call it foo.jsp.  Inside of foo.jsp is
  

Both foo.jsp and fooTable.jsp have
<%@ page contentType="text/html" [etc] %>

When I look at the generated Java source, both
have calls to response.setContentType("text/html").

But despite the fact that fooTable.jsp is called via
a jsp:include action, I get no complaints about it messing
with response headers.

Now the plot thickens...

For various reasons, I want to specify a character set.  So
in both cases I change the page directive to
<%@ page contentType="text/html; charset=SJIS" [etc] %>
and sure enough, both generated Java files now have
response.setContentType("text/html; charset=SJIS") in them.

But now an exception IS thrown (IllegalStateException, MIME type
already set) by the server!  So I try removing the contentType=
attribute from the directive in fooTable.jsp and I still
get the exception.

Is this a bug with JWS2.0?

And if not, how on earth ARE you supposed to deal with
non-standard charsets when you use the jsp:include
action?

== Rich

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



passing hashtables in request

2000-11-30 Thread Firat Ozcan

Is it ok to do the following:

JSP A puts all its parameters into "Hashtable myHash". And then it passes
this myHash object to JSP B within a URL such as
"/path_to_JSP_B/B.jsp?parameter1=myHash".

And then upon being called, JSP B does this:

Hashtable passedHash = (Hashtable)request.getAttribute("myHash");

and then enumerates the contents of passedHash.

I am doing this because I need to pass like 100 parameters from JSP A to JSP
B. I am wondering if the above method will create a memory problem.

Thanks for the help

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: internationalization and localization

2000-11-30 Thread Oleg V Alexeev

Hello Misak,

Thursday, November 30, 2000, 11:16:27 PM, you wrote:

BM> Does anyone know anything about internationalizing JSP files as JSP 1.1
BM> standard expects like attaching languange code to the JSP file names (e.g.
BM> jspname_ja.jsp, etc.).

I think struts library is good solution -
 http://jakarta.apache.org/struts

--
Best regards,
 Olegmailto:[EMAIL PROTECTED]

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Using xml with jsp

2000-11-30 Thread Kevin Citron

Why not just use JDOM ??
You could accomplish the same thing with half the code.
http://jdom.org/

-Original Message-
From: Daryani Santosh [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 30, 2000 1:20 PM
To: [EMAIL PROTECTED]
Subject: Re: Using xml with jsp


Here's the code

Part 1 - This class writes xml node data to a file


import org.w3c.dom.*; // W3C DOM classes for traversing the document
import java.io.*;

/**
 * Output a DOM Level 1 Document object to a java.io.PrintWriter as a simple
 * XML document.  This class does not handle every type of DOM node, and it
 * doesn't deal with all the details of XML like DTDs, character encodings
and
 * preserved and ignored whitespace.  However, it does output basic
 * well-formed XML that can be parsed by a non-validating parser.
 **/
public class XMLDocumentWriter {
PrintWriter out;  // the stream to send output to

/** Initialize the output stream */
public XMLDocumentWriter(PrintWriter out) { this.out = out; }

/** Close the output stream. */
public void close() { out.close(); }

/** Output a DOM Node (such as a Document) to the output stream */
public void write(Node node) { write(node, ""); }

/**
 * Output the specified DOM Node object, printing it using the specified
 * indentation string
 **/
public void write(Node node, String indent) {
// The output depends on the type of the node
switch(node.getNodeType()) {
case Node.DOCUMENT_NODE: {   // If its a Document node
Document doc = (Document)node;
out.println(indent + "");  // Output header
Node child = doc.getFirstChild();   // Get the first node
while(child != null) {  // Loop 'till no more nodes
write(child, indent);   // Output node
child = child.getNextSibling(); // Get next node
}
break;
}
case Node.DOCUMENT_TYPE_NODE: {  // It is a  tag
DocumentType doctype = (DocumentType) node;
// Note that the DOM Level 1 does not give us information about
// the the public or system ids of the doctype, so we can't
output
// a complete  tag here.  We can do better with Level
2.
out.println("");
break;
}
case Node.ELEMENT_NODE: {// Most nodes are Elements
Element elt = (Element) node;
out.print(indent + "<" + elt.getTagName());   // Begin start tag
NamedNodeMap attrs = elt.getAttributes(); // Get attributes
for(int i = 0; i < attrs.getLength(); i++) {  // Loop through
them
Node a = attrs.item(i);
out.print(" " + a.getNodeName() + "='" +  // Print attr.
name
  fixup(a.getNodeValue()) + "'"); // Print attr.
value
}
out.println(">"); // Finish start
tag

String newindent = indent + "";   // Increase indent
Node child = elt.getFirstChild(); // Get child
while(child != null) {// Loop
write(child, newindent);  // Output child
child = child.getNextSibling();   // Get next child
}

out.println(indent + "");
break;
}
case Node.TEXT_NODE: {   // Plain text node
Text textNode = (Text)node;
String text = textNode.getData().trim();   // Strip off space
if ((text != null) && text.length() > 0)   // If non-empty
out.println(indent + fixup(text)); // print text
break;
}
case Node.PROCESSING_INSTRUCTION_NODE: {  // Handle PI nodes
ProcessingInstruction pi = (ProcessingInstruction)node;
out.println(indent + "");
break;
}
case Node.ENTITY_REFERENCE_NODE: {// Handle entities
out.println(indent + "&" + node.getNodeName() + ";");
break;
}
case Node.CDATA_SECTION_NODE: {   // Output CDATA sections
CDATASection cdata = (CDATASection)node;
// Careful! Don't put a CDATA section in the program itself!
out.println(indent + "<" + "![CDATA[" + cdata.getData() +
"]]" + ">");
break;
}
case Node.COMMENT_NODE: { // Comments
Comment c = (Comment)node;
out.println(indent + "");
break;
}
default:   // Hopefully, this won't happen too much!
System.err.println("Ignoring node: " +
node.getClass().getName());
break;
}
}

// This method replaces reserved characters with entities.
String fixup(String s) {
StringBuffer sb = new StringBuffer();
int len = s.length();

Re: passing hashtables in request

2000-11-30 Thread Geert Van Damme

Nope, that's not OK.

You can do what you describe, but not by passing the Hashtable as a
parameter in the URL.
Instead, put the Hashtable in the request
request.setAttribute("parameter1",myHash)
and redirect to the second JSP.
where you can use myHash = (Hashtable)request.getAttribute("parameter1")
Of course, you cannot use response.sendRedirect to go from one page to
another.
You need to use requestdispatcher.include or forward
or the page include or forward tags (which is essentially the same)

Geert

> -Original Message-
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Firat Ozcan
> Sent: donderdag 30 november 2000 21:41
> To: [EMAIL PROTECTED]
> Subject: passing hashtables in request
>
>
> Is it ok to do the following:
>
> JSP A puts all its parameters into "Hashtable myHash". And then it passes
> this myHash object to JSP B within a URL such as
> "/path_to_JSP_B/B.jsp?parameter1=myHash".
>
> And then upon being called, JSP B does this:
>
> Hashtable passedHash = (Hashtable)request.getAttribute("myHash");
>
> and then enumerates the contents of passedHash.
>
> I am doing this because I need to pass like 100 parameters from
> JSP A to JSP
> B. I am wondering if the above method will create a memory problem.
>
> Thanks for the help
>
> ==
> =
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set
> JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re:

2000-11-30 Thread Denny Pichardo

Did you make sure that the Data Source Name was in System DSN in the ODBC
Data Sources.  JSP uses only System DSN for it's jdbc-odbc bridge.

Denny Pichardo
IT Specialist
Agilent Technologies

From: TravisFalls <[EMAIL PROTECTED]>

Hello,
I am creating a DBConnection Class that I am creating an instance of in a
login class.  In this login class I pass a dynamic query string to
DBConnection.  I have this deployed on a Weblogic server.  (yes I registered
the servlet :) )I have an index page that calls a Login servlet where the
DbConnection instance is.  I have registered the Data source name for my
access 2000 database and still I get a server 500 error.  I don't have a URL
to show but all my code for the two classes is as follows:
_
Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: JSP contentType setting question in context of jsp:include ac tion

2000-11-30 Thread Krakow, Ira

Hi Rich,

   Remember me - Ira Krakow, ex-editor of Persfin-Digest?  Fancy meeting you
here!!!  Are you a JSP guru?

   Hope all is well.

Ira

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: problem of passing the request parameters

2000-11-30 Thread Duffey, Kevin

There are a couple of books on Servlets out there. I forget all the
names..but one explains how to read in parameters from a multi-part/formdata
post. When you change the way the post is going...request.getParameter() no
longer works. Therefore, you will have to manually (in code) extract the
parameters in say..a file upload servlet, and then put them BACK into the
request before forwarding on. However..I am not sure if you can forward on
to a resource using text/html AFTER your servlet gets the
multi-part/formdata post. I think you'll have to do a response.sendRedirect
in this case..so that you can set the headers in the response back to
text/html, which can then go to the browser and BACK to the server using
text/html.


> -Original Message-
> From: Muhammad Asim Ajmal [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, November 29, 2000 11:38 PM
> To: [EMAIL PROTECTED]
> Subject: problem of passing the request parameters
>
>
>  Hi all.
>
> Currently I'm facing the problem of passing the request parameters
> to the next form. When I use encrypt multipart/formdata in
> the form tag
> the images are properly uploaded but the request parameters are not
> passed to the next page by submitting the data.
>
> Thank you in anticipation for sparing your time.
>
> From
>  : Shuwaz.
>
> ==
> =
> To unsubscribe: mailto [EMAIL PROTECTED] with body:
> "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set
> JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Is possible to access an HttpSession with its ID from another session ?

2000-11-30 Thread Duffey, Kevin

Keep in mind..Servlet 2.1 deprecated this ability. Its still available for
backwards binary compatibility, but its very possible the next release of
Servlet (2.3) removes this ability. Don't depend on deprecated apis unless
you don't plan on moving forward with newer apis.


> -Original Message-
> From: Peter Pilgrim [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, November 30, 2000 2:49 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Is possible to access an HttpSession with its ID from
> anothersession ?
>
>
> Yep
>
> Have a look at the SessionListServlet? in the "Instant Java
> Servlets" book
> (unfortunately the Servlets are 2.0 and the JSP is 1.0 but
> it's still a good
> book with loads of code).
> It maintains a list of session in separate hashtable class, and uses
> the HttpSessionBindingListerner etc.
>
> --
> Peter Pilgrim
> G.O.A.T
> "the Greatest Of All Time"
>
>
>  Message History
> 
>
>
> From: "Craig R. McClanahan"
> <[EMAIL PROTECTED]>@java.sun.com> on 29/11/2000 16:40 PST
>
> Please respond to A mailing list about Java Server Pages
> specification and reference <[EMAIL PROTECTED]>
>
> DELEGATED - Sent by: A mailing list about Java Server
> Pages specification and [EMAIL PROTECTED]>
>
>
> To:   [EMAIL PROTECTED]
> cc:
> Subject:  Re: Is possible to access an HttpSession with its
> ID from anothersession ?
>
>
> "Duffey, Kevin" wrote:
>
> > Not any more. Servlet 2.1 deprecated that ability. I don't
> know if Servlet
> > 2.2 removed it..but due to security risks, they removed the ability
> > (deprecated it) so that one session couldn't gain access to another.
>
> It is still deprecated, but not removed so that binary
> compatibility doesn't get
> broken.
>
> > Its too
> > bad because it would be nice to have the ability to search
> through all
> > active sessions, display them, etc..like an Admin page
> where we can see
> > where a person is on the site, how many people are active,
> logged in, etc.
> >
>
> All of those things can be accomplished with some appropriate
> coding (such as the
> previous suggestion on this thread to maintain a collection
> in application scope
> that is keyed by session id so you can access shared information).
>
> 
>
>
>
> --
>
> This e-mail may contain confidential and/or privileged
> information. If you are not the intended recipient (or have
> received this e-mail in error) please notify the sender
> immediately and destroy this e-mail. Any unauthorised
> copying, disclosure or distribution of the material in this
> e-mail is strictly forbidden.
>
> ==
> =
> To unsubscribe: mailto [EMAIL PROTECTED] with body:
> "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set
> JSP-INTEREST DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re:

2000-11-30 Thread Rama Krishna

Hello Travis,


where have u declared the query1 method in ur dbconnection class,
unless u declare that ,how can u call it in the ur servlet
thanks

I am creating a DBConnection Class that I am creating an instance of in a
login class.  In this login class I pass a dynamic query string to
DBConnection.  I have this deployed on a Weblogic server.  (yes I
registered the servlet :) )I have an index page that calls a Login servlet
where the DbConnection instance is.  I have registered the Data source name
for my access 2000 database and still I get a server 500 error.  I don't
have a URL to show but all my code for the two classes is as follows: 

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: internationalization and localization

2000-11-30 Thread Boulatian, Misak

Hi Oleg,

Thanks for responding. We were trying to use struts library. The only thing
I don't like about it is that for every request the action servlet is
instantiating (class.forname call) the object and then calls perform method
of that object. So, If your action classes are not servlets themselves then
every single thread will be using a new instance of that class. In cases
where you need to access session beans (EJB) then there is no init method
for placing these calls to do only once. That is why we are still evaluating
struts but have not made any decisions yet. Let me know if I am wrong.

Thanks,
Misak

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: internationalization and localization

2000-11-30 Thread Craig R. McClanahan

"Boulatian, Misak" wrote:

> Hi Oleg,
>
> Thanks for responding. We were trying to use struts library. The only thing
> I don't like about it is that for every request the action servlet is
> instantiating (class.forname call) the object and then calls perform method
> of that object. So, If your action classes are not servlets themselves then
> every single thread will be using a new instance of that class.

Um, that is *not* the case.  Only one instance of an action class ever gets created
for any particular mapping, and that instance is reused for all subsequent requests
-- in the same manner that the servlet container instantiates only one instance of
the servlet.

A consquence of this is that you must program your actions in a thread-safe manner.

> In cases
> where you need to access session beans (EJB) then there is no init method
> for placing these calls to do only once. That is why we are still evaluating
> struts but have not made any decisions yet. Let me know if I am wrong.
>

The best place to initialize stuff at application startup is in the init() method
of the controller servlet, or in some other servlet that you mark 
in the deployment descriptor.  Make these resources available to your actions (and
your JSP pages) by storing them as servlet context attributes (in JSP terms, these
are application scope beans).

>
> Thanks,
> Misak
>

Craig McClanahan

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



's and JSP's

2000-11-30 Thread Firat Ozcan

Ok , here is my problem:

Given: Client is presented with a Form either pure HTML or embedded in a Jsp
page. In that Form there are 20 's and a submit button. Upon
submitting this Form, all those 20 's should be processed.

Unfortunately upto here I cannot change anything. Because it is a customer
requirement.

Problem: I cannot think of a solution which will pick up those 20
's and process them. How can I pass those guys to a Jsp (or a
Bean). The only way possible is:
bla bla
bla bla
bla bla
... till 20

is it OK to send these guys like that and then the reciever JSP will extract
the text from each of the 20 text's by using request.getParameter("text1") ,
request.getParameter("text2") , bla bla

Is there a more elegant way of doing this considering the "given"
constraints.

Thanks...

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Which Servlet Engine ???

2000-11-30 Thread Parvez Rishi

hi,
i'm new to jsp/servlets and i'm confused which servlet engine to use
with apache 1.3.12 and redhat linux 6.2.

i'm using tomcat as of now, but then someone told me ApacheJserv is much
better in peformance. can someone pls. guide me. Also what is the diff.
between tomcat and jserv.

thanks in advance.
parvez

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



can i run JSP with JSDK2.1??

2000-11-30 Thread Deepak C S

  hi all,

can i run JSP with JSDK2.1?? If not, what else I need to run JSPs??


Thanks and Regards,

Deepak C. S.
Planetasia Ltd,
A Microland Group Company,
Bangalore,India
Contact: 5522252 54 57 58 58 Extn 544
Email: [EMAIL PROTECTED]

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



How to pass string fromjsp to database accessing bean

2000-11-30 Thread Manish Joshi

hi all,
hey i m generating sqlquery in my jsp page,to update the database i need =
to pass it to bean where i will run this query on sql database,can =
somebody tell me how do u pass this query to bean.
thx in advance
MJ

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: can i run JSP with JSDK2.1??

2000-11-30 Thread subramanian Athimoolam

hi

  use javawebserver /  or  JRUN


ch..


_
Get more from the Web.  FREE MSN Explorer download : http://explorer.msn.com

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: internationalization and localization

2000-11-30 Thread Oleg V Alexeev

Hello Misak,

Friday, December 01, 2000, 1:20:11 AM, you wrote:

BM> Thanks for responding. We were trying to use struts library. The only thing
BM> I don't like about it is that for every request the action servlet is
BM> instantiating (class.forname call) the object and then calls perform method
BM> of that object. So, If your action classes are not servlets themselves then
BM> every single thread will be using a new instance of that class. In cases
BM> where you need to access session beans (EJB) then there is no init method
BM> for placing these calls to do only once. That is why we are still evaluating
BM> struts but have not made any decisions yet. Let me know if I am wrong.

I can not write anymore else about problem after Craig's letter.
It is one of base features of struts - to use one instance of action
to process all requests.

--
Best regards,
 Olegmailto:[EMAIL PROTECTED]

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Result Sets

2000-11-30 Thread joydeep dasgupta

For gurus,

A slightly off topics question! Does Tomcat support ejb development, or only
JSP/ Servlet?

joydeep

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: Result Sets

2000-11-30 Thread Nidhi Bhatia

- tomcat is not an application server

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets



Re: internationalization and localization

2000-11-30 Thread Boulatian, Misak

Hi everybody,

Does anyone know anything about internationalizing JSP files as JSP 1.1
standard expects like attaching languange code to the JSP file names (e.g.
jspname_ja.jsp, etc.).

I appreciate the response.
Thanks,
Misak

===
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets