Re: session variables

2001-04-06 Thread Ortiz, William J

The JSP 0.91 Specification does not provide support for session objects by
default.  This was implemeted in JSP 1.0 and above (correct me if wrong).
You can still create HttpSession objects in your JSP code and work with them
as usual.  You can do something like this:

% HttpSession currentSession = request.getSession();
  currentSession.putValue(""variable_name", variable_value);
%

If you would like a copy of the JSP 0.91 specification send me an e-mail.  I
believe that SUN removed it from their web-site some time ago.

William J Ortiz
EDS E.Solutions/BlueSphere
XEEP Buyout
Phone: (716) 427-6892
e-mail: [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
e


-Original Message-
From: Diana Luz Buitrago B. [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 05, 2001 6:44 PM
To: [EMAIL PROTECTED]
Subject: session variables


Hello!
i'm working jsp with GNUJSP 0.9.10 compiler and i don't know how i can
define session variables and how to read them from other pages.

i was trying to define them with "session.putValue("variable_name",
variable_value);" but because of the GNUJSP 0.9.10 it appears as not
defined. how can i define them and read them for this compiler?

Diana Buitrago
Webmaster UIS

===
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: A tip on how to avoid browser caching problems..

2001-03-30 Thread Ortiz, William J

We had some problems with caching in our projects too, and the META tags
did'nt work (we have to use IE exclusively).  After some testing we decided
to add a random number to the JSP URL's, but trying to minimize the
possibility to zero, we decided to add the timestamp to the url
(System.currentTimeMillis()).  That way you will NEVER hit the same cached
page twice.

William J Ortiz
EDS E.Solutions/BlueSphere
XEEP Buyout
Phone: (716) 427-6892
e-mail: [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
e


-Original Message-
From: Duffey, Kevin [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 28, 2001 5:07 PM
To: [EMAIL PROTECTED]
Subject: A tip on how to avoid browser caching problems..


Hi there all,

I just wanted to pass on a bit of info I finally got working for web
browsers..just incase some of you out there may be seeing a similar
situation. On our site, we have 3 "top" tabs that all call the same one URL
to log in to various parts of the site. The URL the browser sees for all
three tabs is identical. Therefore, at times the browser does NOT go to the
server to display the page, but instead pulls it from cache. Before anyone
replies about META tags and setting headers..I have done all of this. I am
not sure if MSIE 5 has a bug with this, or not, but I also see this happen
sometimes on Netscape 6. Therefore I tend to think despite trying to tell
the browser never to cache a page, it still does. It mostly seems to happen
if you rapidly click between the tabs that go to the same URL. Most of the
time it works right..it goes to the server. I think what happens is, BEFORE
the page is fully displayed if you click on a link again the browser does
not at that moment have a page in memory with META tags or what not telling
it not to cache..so it simply pulls the SAME page from its cache. I don't
think this is the fault of the browser..per se. What I think browsers should
do is NOT allow another link to be clickable when a link is clicked until
the page is done loading, or the STOP button is pressed. At any rate,
someone once told me a while back a "trick" to force the browser to go to
the server EVERY time is to add a random number to the URL. There are
probably a couple of ways this can be done. However, if you generate a
dynamic page with links having hardcoded random numbers, its again possible
that while the page is being loaded, the hard-coded link is being looked at
and is already in the cache so it reloads that cached page again,
effectively not working. So what I did is I created a simple javascript that
ALL links would call. Instead of a href="page.jsp"click/a, you would do
something like a href="javascript: handleLink('page.jsp')"click/a. Then,
the method would simply add a random number to it, and then cause the
location to change of the page (or frame). I am not sure if this suffers the
same problem as the hard-coded href links, but it at least is working for me
right now. I have yet to see a cached page come back.

Just thought I would pass that in..if it helps anyone else out there.

===
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: A tip on how to avoid browser caching problems..

2001-03-30 Thread Ortiz, William J

If you are going to submit a form, do something like the following:

form action="/servlet/Whatever?x=%= System.currentTimeMillis() %" 

if you're doing it from a link:

a href="/servlet/Whatever?x=%= System.currentTimeMillis() %" click/a

this will work fine with JSP's and servlets

William J Ortiz
EDS E.Solutions/BlueSphere
XEEP Buyout
Phone: (716) 427-6892
e-mail: [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
e


-Original Message-
From: sufi malak [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 30, 2001 1:16 PM
To: [EMAIL PROTECTED]
Subject: Re: A tip on how to avoid browser caching problems..


How did you do it please ?


From: "Ortiz, William J" [EMAIL PROTECTED]
Reply-To: A mailing list about Java Server Pages specification and
 reference [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: A tip on how to avoid browser caching problems..
Date: Fri, 30 Mar 2001 12:06:26 -0600

We had some problems with caching in our projects too, and the META tags
did'nt work (we have to use IE exclusively).  After some testing we decided
to add a random number to the JSP URL's, but trying to minimize the
possibility to zero, we decided to add the timestamp to the url
(System.currentTimeMillis()).  That way you will NEVER hit the same cached
page twice.

William J Ortiz
EDS E.Solutions/BlueSphere
XEEP Buyout
Phone: (716) 427-6892
e-mail: [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
e


-Original Message-
From: Duffey, Kevin [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 28, 2001 5:07 PM
To: [EMAIL PROTECTED]
Subject: A tip on how to avoid browser caching problems..


Hi there all,

I just wanted to pass on a bit of info I finally got working for web
browsers..just incase some of you out there may be seeing a similar
situation. On our site, we have 3 "top" tabs that all call the same one URL
to log in to various parts of the site. The URL the browser sees for all
three tabs is identical. Therefore, at times the browser does NOT go to the
server to display the page, but instead pulls it from cache. Before anyone
replies about META tags and setting headers..I have done all of this. I am
not sure if MSIE 5 has a bug with this, or not, but I also see this happen
sometimes on Netscape 6. Therefore I tend to think despite trying to tell
the browser never to cache a page, it still does. It mostly seems to happen
if you rapidly click between the tabs that go to the same URL. Most of the
time it works right..it goes to the server. I think what happens is, BEFORE
the page is fully displayed if you click on a link again the browser does
not at that moment have a page in memory with META tags or what not telling
it not to cache..so it simply pulls the SAME page from its cache. I don't
think this is the fault of the browser..per se. What I think browsers
should
do is NOT allow another link to be clickable when a link is clicked until
the page is done loading, or the STOP button is pressed. At any rate,
someone once told me a while back a "trick" to force the browser to go to
the server EVERY time is to add a random number to the URL. There are
probably a couple of ways this can be done. However, if you generate a
dynamic page with links having hardcoded random numbers, its again possible
that while the page is being loaded, the hard-coded link is being looked at
and is already in the cache so it reloads that cached page again,
effectively not working. So what I did is I created a simple javascript
that
ALL links would call. Instead of a href="page.jsp"click/a, you would do
something like a href="javascript: handleLink('page.jsp')"click/a.
Then,
the method would simply add a random number to it, and then cause the
location to change of the page (or frame). I am not sure if this suffers
the
same problem as the hard-coded href links, but it at least is working for
me
right now. I have yet to see a cached page come back.

Just thought I would pass that in..if it helps anyone else out there.

===
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.

Strange JSP Exception

2001-02-12 Thread Ortiz, William J

Hey folks:

In our project we're using VA Java and Webshere as our app. server.
Recently I've noticed that while loading one of our JSP's we'vw been getting
a strange exception.  What makes it even weirder is that it is a very small
JSP and after we get the exception and it bombs out we can continue to use
it normally.  The HTML is only a small form, Here is ALL the java code in
that page:

%

HttpSession curSession = request.getSession();
 if ((request.getParameter("contact") == null) ||
(request.getParameter("contact").equals(""))){
curSession.putValue("contact", " ");
}
else{
curSession.putValue("contact", request.getParameter("contact"));
}
if ((request.getParameter("salesPerson") == null) ||
(request.getParameter("salesPerson").equals(""))){
curSession.removeValue("salesPerson");
curSession.putValue("salesPerson", " ");
}
else{
curSession.removeValue("salesPerson");
curSession.putValue("salesPerson",
request.getParameter("salesPerson"));
}
%

We have to use JSP 0.91 (DUH!), there's no intrinsic(?) support for the
session built in, and we use JSDK 2.0 (Double DUH!) and JDK 1.1.7, so
session.putValue() is not deprecated. BTW, the session is not timed out.
Here is the exception we get...

java.net.SocketException: Connection reset by peer
 java.lang.Throwable(java.lang.String)
 java.lang.Exception(java.lang.String)
 java.io.IOException(java.lang.String)
 java.net.SocketException(java.lang.String)
 void java.net.SocketOutputStream.socketWrite(byte [], int, int)
 void java.net.SocketOutputStream.write(byte [], int, int)
 void
com.ibm.servlet.engine.http_transport.HttpTransportConnection.write(byte [],
int, int)
 void
com.ibm.servlet.engine.http_transport.HttpTransportConnection.prepareForWrit
e(int, java.lang.String, java.lang.String [], java.lang.String [], int)
 void com.ibm.servlet.engine.srp.SRPConnection.prepareForWrite(int,
java.lang.String, java.lang.String [], java.lang.String [], int)
 void com.ibm.servlet.engine.srt.SRTServletResponse.commit()
 void com.ibm.servlet.engine.srt.SRTServletResponse.alertFirstWrite()
 void com.ibm.servlet.engine.srt.SRTOutputStream.write(byte [], int, int)
 void java.io.OutputStreamWriter.flushBuffer()
 void java.io.OutputStreamWriter.flush()
 void java.io.PrintWriter.flush()
 void com.ibm.servlet.engine.webapp.BufferedWriter.flushChars()
 void com.ibm.servlet.engine.webapp.BufferedWriter.write(char [], int, int)
 void java.io.PrintWriter.write(char [], int, int)
 void java.io.PrintWriter.write(char [], int, int)
 void com.ibm.ivj.jsp.debugger.IBMPrintWriter.write(char [], int, int)
 void
com.ibm.servlet.jsp.http.pagecompile.filecache.CharFileCacheEntry.writeChars
(int, int, java.io.Writer)
 void
pagecompile._PrintScreen2_xjsp_debug.service(javax.servlet.http.HttpServletR
equest, javax.servlet.http.HttpServletResponse)
 void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
 void
com.ibm.servlet.jsp.http.pagecompile.JSPState.service(javax.servlet.ServletR
equest, javax.servlet.ServletResponse)
 void
com.ibm.servlet.jsp.http.pagecompile.PageCompileServlet.doService(javax.serv
let.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 void
com.ibm.servlet.jsp.http.pagecompile.PageCompileServlet.doGet(javax.servlet.
http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
 void
javax.servlet.http.HttpServlet.service(javax.servlet.http.HttpServletRequest
, javax.servlet.http.HttpServletResponse)
 void javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
 void
com.ibm.servlet.engine.webapp.StrictServletInstance.doService(javax.servlet.
ServletRequest, javax.servlet.ServletResponse)
 void
com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(javax.servlet.
ServletRequest, javax.servlet.ServletResponse)
 void
com.ibm.servlet.engine.webapp.IdleServletState.service(com.ibm.servlet.engin
e.webapp.StrictLifecycleServlet, javax.servlet.ServletRequest,
javax.servlet.ServletResponse)
 void
com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(javax.servlet.S
ervletRequest, javax.servlet.ServletResponse)
 void
com.ibm.servlet.engine.webapp.ServletInstance.service(javax.servlet.ServletR
equest, javax.servlet.ServletResponse,
com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent)
 void
com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(com.ibm.se
rvlet.engine.webapp.ServletInstanceReference, javax.servlet.ServletRequest,
javax.servlet.ServletResponse,
com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent)
 void
com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(javax.servle
t.ServletRequest, javax.servlet.ServletResponse,
com.ibm.servlet.engine.webapp.WebAppServletInvocationEvent)
 void
com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(c

FW: Your post has been returned (Getting all the values in a sele ction box)

2000-11-20 Thread Ortiz, William J

Hello fellow Jsp'ers:

In the project I'm working on we display a JSP page to the user that allows
them to type in Customer Numbers(CN) in a text box.  We added a method to
include multiple CN's in a selection box, they type in a CN and click on an
'Add' button, the CN will be added to the selection box and deleted from the
text box.

One of the requirements is that we process the CN's one at a time, so we
have another script that makes the 1st item in the list the default(ie.
selected). I can get this value in the servlet.

Now, we need to keep the rest of the list!  But
request.getParameter("selectionBox") only 'sees' the selected value.  How
could I go around this problem either in the servlet, the JSP code, or
JavaScript? T.I.A for your help.

William J Ortiz
EDS E.Solutions/BlueSphere
XEEP Buyout
e-mail: [EMAIL PROTECTED]
e

===
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: Streaming RTF via JSPs

2000-11-14 Thread Ortiz, William J

It can be done with Servlets.   Here's what I did for my current project, it
is a web based app using servlets and JSP's:

1.  We store the RTF files in the server, obviously in a directory the
application can read.  The files include some 'place-holders' that we
replace later with mainframe data.
2.  After we open the files to change the placeholders for real data, we
stream them down to the user. The browser then opens up a Word window with
the completed RTF file.

I don't know if it can be done purely from JSP's. Since JSP's were designed
for HTML and browser output in mind it might not be a good idea.  RTF files
have a very specific format that can get screwed very easily if you don't
know what you're doing. But, since a JSP is essentially a servlet, there
might be a way to do so.

Here is some sample code.  Some of it I took from "Java Servlet Programming"
by Jason Hunter (ie. returnFile(...)). The class FileUtilities is a class we
created that makes a copy of a file and stores it elsewhere with a name you
provide, among other things. I had to ommit some code for security reasons,
but I think you can grasp the idea.  You could also look up page 92 (Serving
Files) of the book I mentioned for the full example.

public class PrintServlet extends HttpServlet{
public void doPost(...) yada yada yada{

}


private void createLetterDocument(HttpServletRequest req,
HttpServletResponse res) throws IOException, ServletException{
FileUtilities copier = new FileUtilities();
String filename = "";
ServletOutputStream out = res.getOutputStream();
// Is this a CPC Customer? If not, do the following:
if (!cpcCustomer){
if ((Purchase.equals("true"))  Return.equals("true")){
filename = session.getId() + "prletter.rtf";
copier.copyFile("prletter.rtf", filename);
}
else{
...
...
}
String contentType = getServletContext().getMimeType(filename);
res.setContentType(contentType);
// add section to replace the placeholders
fillDocument();// ?
// add section to return file
try{
returnFile(filename, out);
}catch(FileNotFoundException fnfe){
}
}

public static void returnFile(String filename, OutputStream out) throws
IOException, FileNotFoundException{
FileInputStream fis = null;
try{
fis = new FileInputStream(filename);
byte[] buf = new byte[4 * 1024]; // 4k buffer
int bytesRead;
while((bytesRead = fis.read(buf)) != -1){
out.write(buf, 0, bytesRead);
}
}
finally{
if(fis != null)
fis.close();
}
}

William J Ortiz
EDS E.Solutions/BlueSphere
XEEP Buyout
Phone: (716) 427-6892
e-mail: [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
e


-Original Message-
From: Whitwell, Carl [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 13, 2000 12:11 PM
To: [EMAIL PROTECTED]
Subject: Streaming RTF via JSPs


Hi all

I'm working on a document generation application that will generate RTF
documents on the fly for viewing in the Web browser.

I have an RTF file that I created in MS-Word. As a test, I have changed its
extension to .jsp and placed it where it is visible to my jsp engine (IBM
WebSphere 3).  When I try to load the file using its url, the server takes
ages (ok as I know it is "compiling" the jsp into a servlet) then bombs with
the error I've included at the bottom.  I've tried adding some jsp
directives, such as content-type and buffer="none", but the error is the
same.  I've also removed all the graphics that were originally present,
again to no avail.

Does anyone have experience with RTF and JSP?  Can it be done?  If not, my
project is in trouble!

Cheers

Carl.

Here's the exception:

java.io.UTFDataFormatException
at java.lang.Throwable.(Compiled Code)
at java.lang.Exception.(Compiled Code)
at java.io.IOException.(Compiled Code)
at java.io.UTFDataFormatException.(Compiled Code)
at java.io.DataOutputStream.writeUTF(Compiled Code)
at java.io.ObjectOutputStream.writeUTF(Compiled Code)
at java.io.ObjectOutputStream.writeObject(Compiled Code)
at java.io.ObjectOutputStream.outputArray(Compiled Code)
at java.io.ObjectOutputStream.writeObject(Compiled Code)
at
com.sun.jsp.compiler.Jsp1_0ParseEventListener.endPageProcessing(Compiled
Code)
at com.sun.jsp.compiler.Main.compile(Compiled Code)
at com.sun.jsp.runtime.JspLoader.compile(Compiled Code)
at com.sun.jsp.runtime.JspLoader.loadJSP(Compiled Code)
at
com.sun.jsp.runtime.JspServlet$JspServletWrapper.loadIfNecessary(Compiled
Code)
at com.sun.jsp.runtime.JspServlet$JspServletWrapper.service(Compiled
Code)
at com.sun.jsp.runtime.JspServlet.serviceJspFile(Compiled Code)
at 

Re: Streaming RTF via JSPs

2000-11-14 Thread Ortiz, William J

We found the same situation with IE, Netscape works fine with it.  It is a
documented bug, I think I found the info in the Apache web site.  Anyway, I
included it in our project documentation:

1) A documented bug in Internet Explorer prevents the browser from opening
binary data or files downloaded in a Word window unless the file has a .doc
or .rtf extension; even though the Content Type of the data is specified to
be "application/msword", Internet Explorer will not open the document.
Servlets commonly send data without an extension.  To solve this problem,
when submitting input from Print.html to the PrintServlet, a special
parameter must be sent in the request URL.  In this case, the request must
be made in the form: PrintServlet?.rtf (i.e.
http://serveraddress/servlet/PrintServlet?.rtf ), this way IE will be forced
to interpret the Content Type correctly.

If you are using a link or form to output the rtf file you could add the
'?.rtf' to your query string!! I hope this is what you were looing for.

William J Ortiz
EDS E.Solutions/BlueSphere
XEEP Buyout
Phone: (716) 427-6892
e-mail: [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
e


-Original Message-
From: Whitwell, Carl [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 14, 2000 11:28 AM
To: [EMAIL PROTECTED]
Subject: Re: Streaming RTF via JSPs


Thanks William

Yes we also have an application that performs exactly the same task.  I
wanted to use jsps, however, because of the ease of plugging in your own
content with jsp:getProperty.

I've just found out that it is in fact a bug in WebSphere 3.0.1 - we've
tried it in WebSphere 3.0.2 and 3.5 and it works fine.  So there you have it
- don't try and stream RTFs through WS3.0.1.

Only problem is getting the browser to recognise it as RTF without giving
the file an RTF extension.  This will manifest itself in the production
system, where we'll be using a central "Control" servlet (see the
Fields/Kolb book) so the user will never see the JSP file in their url.  I
think we'll have to name the servlet something.rtf in order to get the
browser to recognise it, unless anyone has a better idea...

-Original Message-
From: Ortiz, William J [mailto:[EMAIL PROTECTED]]
Sent: 14 November 2000 16:05
To: [EMAIL PROTECTED]
Subject: Re: Streaming RTF via JSPs


It can be done with Servlets.   Here's what I did for my current project, it
is a web based app using servlets and JSP's:

1.  We store the RTF files in the server, obviously in a directory the
application can read.  The files include some 'place-holders' that we
replace later with mainframe data.
2.  After we open the files to change the placeholders for real data, we
stream them down to the user. The browser then opens up a Word window with
the completed RTF file.

I don't know if it can be done purely from JSP's. Since JSP's were designed
for HTML and browser output in mind it might not be a good idea.  RTF files
have a very specific format that can get screwed very easily if you don't
know what you're doing. But, since a JSP is essentially a servlet, there
might be a way to do so.

Here is some sample code.  Some of it I took from "Java Servlet Programming"
by Jason Hunter (ie. returnFile(...)). The class FileUtilities is a class we
created that makes a copy of a file and stores it elsewhere with a name you
provide, among other things. I had to ommit some code for security reasons,
but I think you can grasp the idea.  You could also look up page 92 (Serving
Files) of the book I mentioned for the full example.

public class PrintServlet extends HttpServlet{
public void doPost(...) yada yada yada{

}


private void createLetterDocument(HttpServletRequest req,
HttpServletResponse res) throws IOException, ServletException{
FileUtilities copier = new FileUtilities();
String filename = "";
ServletOutputStream out = res.getOutputStream();
// Is this a CPC Customer? If not, do the following:
if (!cpcCustomer){
if ((Purchase.equals("true"))  Return.equals("true")){
filename = session.getId() + "prletter.rtf";
copier.copyFile("prletter.rtf", filename);
}
else{
...
...
}
String contentType = getServletContext().getMimeType(filename);
res.setContentType(contentType);
// add section to replace the placeholders
fillDocument();// ?
// add section to return file
try{
returnFile(filename, out);
}catch(FileNotFoundException fnfe){
}
}

public static void returnFile(String filename, OutputStream out) throws
IOException, FileNotFoundException{
FileInputStream fis = null;
try{
fis = new FileInputStream(filename);
byte[] buf = new byte[4 * 1024]; // 4k buffer
int bytesRead;
while

Re: Visual Age system requirements

2000-11-14 Thread Ortiz, William J

I am using VA Enterprise version 3.0.2; I can tell you that for a good
performance you want to have a 600+Mhz CPU and a MINIMUM of 256 MB of RAM.
My workstation has a 733 PIII and 256MB RAM.  If you go to VA 3.5 you might
want to get an even better CPU.  A fast hard disk for paging wouldn't hurt
either.

William J Ortiz
EDS E.Solutions/BlueSphere
XEEP Buyout
Phone: (716) 427-6892
e-mail: [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
e


-Original Message-
From: Tofteland, Barry [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 14, 2000 3:55 PM
To: [EMAIL PROTECTED]
Subject: Visual Age system requirements


I would like to hear from people using IBM's VisualAge for Java what they
consider to be the system requirements in terms of processor and memory.  I
will be doing development work with JSPs, servlets and EJBs.  I will
probably be debugging with the JSP execution monitor as well as the
Websphere test environment.  I am more interested in what people have found
to be "practical/optimal" hardware configurations rather than the bare-bones
statistics they list on the box.

Thanks in advance for your help.
   -Barry

===
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



Re: Best JSP Tool

2000-11-10 Thread Ortiz, William J

Visual Age for Java for itself does not offer a visual JSP editor.  The
Enterprise Edition (the one we're starting to use) comes bundled with
WebSphere Studio, a very capable HTML/JSP editor.  You can create JSP's,
link them to a servlet, debug, test, etc.

An amazing resource hungry program.

William J Ortiz
EDS E.Solutions/BlueSphere
XEEP Buyout
Phone: (716) 427-6892
e-mail: [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
e


-Original Message-
From: Edward Garson [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 10, 2000 8:12 AM
To: [EMAIL PROTECTED]
Subject: Re: Best JSP Tool


JBuilder4 has wonderful support for all aspects of JSP development, and
comes with Tomcat straight out of the box.

Edward Garson
Channel 4 Television Corporation
[EMAIL PROTECTED]

 -Original Message-
 From: Khurram Sardar [SMTP:[EMAIL PROTECTED]]
 Sent: Friday, November 10, 2000 5:57 AM
 To:   [EMAIL PROTECTED]
 Subject:  Re: Best JSP Tool

 IBM WebSphere Studio provides support to develop JSP pages. But ain't
 really
 good at it. It has a lot of wizards but not really good GUI (An essential
 need
 of a developer).




 Sherry Hu [EMAIL PROTECTED] on 11/09/2000 10:08:54 PM

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

 To:   [EMAIL PROTECTED]
 cc:(bcc: Khurram Sardar/PK/ABNAMRO/NL)
 Subject:  Re: Best JSP Tool



 Hi,

 Has anybody used IBM WebSphere to create JSP?
 According to the product introduction, I think it
 might be something like Symantec Visual Cafe, but not
 sure.  Can someone help me out here?  Thanks.

 Sherry
 --- Alan KF LAU [EMAIL PROTECTED] wrote:
  Very informative(Score: 5) and very helpful. Thanks
  a lot.
 
  
   It's worth checking out the free version of IBM
  VisualAge.  You can run
   Apache Tomcat within the IDE and debug servlets
  and JSPs.  You can even
   modify running code.
  
   See
  
 
 http://www7.software.ibm.com/vad.nsf/Data/Document2390?OpenDocumentp=1BC
 T=
   3Footer=1.
  
   I wouldn't call it an IDE for JSPs though, as
  there are no features for HTML
   designing.  I could do with a visual HTML editor
  that knows JSP.  Preferably
   free.  Any ideas?
  
   Chris Walker
   Brainbench MVP for ASP
   http://www.brainbench.com
  
  
  
-Original Message-
From: Mio Nino Marquez
  [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 06, 2000 2:12 PM
To: [EMAIL PROTECTED]
Subject: Re: Best JSP Tool
   
   
Khurram,
   
We went to the product launch of JBuilder 4
  recently and was really
impressed with it.
The JBuilder 4 Enterprise edition allows you to
  do Servlet / JSP
debugging... this includes stepping through
  codes, modify
variable values
etc.
It's expensive though. vbg But you can have
  the Pro albeit
without JSP /
Servlet debugging capabilities. g
   
For other stuffs, you may want to check this
  out:
   
JSP for Code Jockeys
   
 
 http://www.zdnet.com/products/stories/reviews/0,4161,2639151,00.html
   
Mio Nino P. Marquez
Senior Analyst Programmer
Apsilon Technologies Pte Ltd
Email: [EMAIL PROTECTED]
DID  : (65) 6613219
   
- Original Message -
From: "Khurram Sardar"
  [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Monday, November 06, 2000 3:00 PM
Subject: Best JSP Tool
   
   
 Hello Everyone,
  Does any one know that which one is the
  best JSP tool
other than
notepad.
 AS per my knowledge Tools like JBuilder are
  really good at it.
  Please share your knowledge of JSP tools
  with me also
if anyone know
about
 some web site giving benchmarks on comparisons
  of JSP tools.
  I think it will be helful to all of us
  and solve many of tool
dependent
 problems.
 Waiting for your interest
 Khurram
 Junior System Analyst Programmer

   
 
 __
___

 Disclaimer:

 "This  message is confidential. It may also be
  privileged
or otherwise
protected
 by  legal  rules. If you have received it by
  mistake please
let us know by
reply
 and then delete it from your system."


   
 
 ==
=
 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:
   
 

Re: Method getMaxIntervalTime() not found in interface javax.serv let.http.HttpSession

2000-11-09 Thread Ortiz, William J

I think you should use session.getLastAccessedTime() or
session.getLastInactiveInterval(); I don't see a getMaxIntervalTime() in the
API documents (JSDK 2.1)

William J Ortiz
EDS E.Solutions/BlueSphere
XEEP Buyout
Phone: (716) 427-6892
e-mail: [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
e


-Original Message-
From: John Thomas [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 09, 2000 9:55 AM
To: [EMAIL PROTECTED]
Subject: Method getMaxIntervalTime() not found in interface
javax.servlet.http.HttpSession


Hi,
 This is the error i am getting for the code in jsp file. the
problem is to set or view max interval time for  sessions.


HTML

HEAD
TITLE
 User Name
/TITLE

/HEAD

BODY BACKGROUND="images/Backgrnd.gif"

% out.println(session.getMaxIntervalTime()); %

/body

/head



The error msg is

Method getMaxIntervalTime() not found in interface
javax.servlet.http.HttpSession.
 out.println(session.getMaxIntervalTime()); 

Pls help.

===
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