Body Tag throwing nullpointer exception with scripting elements

2003-03-10 Thread Scott Walter
Greetings,

I am trying to get an existing tg that I have written
under Tomcat 4.1.x.  I have a tag that extends
BodyTagSupport, within the doStart tag I return
EVAL_BODY_INCLUDE, however I keep  getting a null
pointer exception, because none of my scripting
element attributes are being found.  I checked the
generated source code and found the following if
statement:

int _jspx_eval_tag_iterate_0 =
_jspx_th_tag_iterate_0.doStartTag();
if (_jspx_eval_tag_iterate_0 !=
javax.servlet.jsp.tagext.Tag.SKIP_BODY) {
RowBean row = null;
if (_jspx_eval_tag_iterate_0 !=
javax.servlet.jsp.tagext.Tag.EVAL_BODY_INCLUDE) {
  javax.servlet.jsp.tagext.BodyContent _bc =
pageContext.pushBody();
  _bc.clear();
  out = _bc;
  _jspx_th_tag_iterate_0.setBodyContent(_bc);
  _jspx_th_tag_iterate_0.doInitBody();
  row= (RowBean) pageContext.findAttribute(row);
}
do {


Inside the if block is where the findAttribute()
method is called to locate my scripting elements?

Any clues why Tomcat is generating source code to
exclude the finding of scripting elements if my
doStart returns EVAL_BODY_INCLUDE?

thanks in advance,

scott




=
~~
Scott Walter--have you been to scottwalter.com lately?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



List of jsp pages

2002-01-13 Thread Scott Walter

Is there an easy way to get a list of JSP pages that
are inside the war file?

I can do this with the java.io.File class but would
like to do it by get access to the resources in the
jar file?

thanks,

scott.

=
~~~
Scott

__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Jsp Tag State

2001-11-28 Thread Scott Walter

If I have an instance variable defined in a custom
tag.  It seems each time I refresh a page that I have
the placed the tag onto the value of the variable gets
re-initialized.

Is there anyway that you can maintain state of
instance variables of a custom tag for a given user's
session without resorting to session attributes,
cookies, or hidden fields?

thanks.

=
~~~
Scott

__
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




custom tag architecture question

2001-11-26 Thread Scott Walter

Just curious, if I place the same tag on a JSP page
twice,  will there be two instances of the tag class
or just one?

thanks.

=
~~~
Scott

__
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Request Dispatcher

2001-11-14 Thread Scott Walter

I am trying to use a RequestDispatcher include with a
JSP page, it seems to be including the content above
the location where I have coded the include.  Any 
clues???

Below is my code
%
RequestDispatcher rd =
request.getRequestDispatcher(pageName);
 
rd.include(request,response);
%

=
~~~
Scott

__
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Re: how to embed Javascript in Jsp?

2001-11-13 Thread Scott Walter

you could try:

%
  out.println(SCRIPT src=\file.js\/SCRIPT);
%

--- Miao, Franco CAWS:EX
[EMAIL PROTECTED] wrote:
 
 
 
 Basically I would like to put javascript file .js
 inside %%,
 just don't know the syntax. thanks!
 
 
 Franco 
 
 --
 To unsubscribe:  
 mailto:[EMAIL PROTECTED]
 For additional commands:
 mailto:[EMAIL PROTECTED]
 Troubles with the list:
 mailto:[EMAIL PROTECTED]
 


=
~~~
Scott

__
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com

--
To unsubscribe:   mailto:[EMAIL PROTECTED]
For additional commands: mailto:[EMAIL PROTECTED]
Troubles with the list: mailto:[EMAIL PROTECTED]




Environment Entries via JNDI Woes

2001-10-23 Thread Scott Walter

I am trying to access an environment entry via JNDI. 
I have set up in my web.xml and server.xml but I am
get an exceptions saying the name is not found in the
context.  Any clues?  Below are my files

portion of web.xml

env-entry
   
env-entry-nameparms/filesLocation/env-entry-name
env-entry-typejava.lang.String/env-entry-type
  /env-entry

portion of server.xml

Environment name=parms/filesLocation
type=java.lang.String
  value=test/

Source code which causes exception

Context initCtx = new InitialContext();
String loc = (String)
initCtx.lookup(java:comp/env/parms/filesLocation);

Thanks for your help.

=
~~~
Scott

__
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com



Re: ResultSet not found

2001-04-18 Thread Scott Walter

I have never used the jsp:directive tag, instead try
this:

%@ page import="java.sql.*" %

--- Shun-Luoi Daniel Fong
[EMAIL PROTECTED] wrote:
 I'm using a JavaBean to communicate with a mysql
 database.
 Here's what I do:
 
 1. login.jsp -- user enters ID and password; also
 when this page is
 loaded the ConnectionBean is declared with
 scope="session"
 
 2. when the user hits "submit", the form sends the
 data to checklogin.jsp
 where the submitted data is checked against the
 database.
 
 I'm getting an error though at checklogin.jsp
 
 ***
 
 Error: 500
 
 Location: /gamezone/checklogin.jsp
 
 Internal Servlet Error:
 
 org.apache.jasper.JasperException: Unable to compile
 class for

JSP/usr/java/jakarta-tomcat-3.2.1/work/localhost_8080%2Fgamezone/_0002fchecklogin_0002ejspchecklogin_jsp_0.java:91:
 Class
 ResultSet not found.
 ResultSet results =
 connection.executeQuery(sql);
 ^
 1 error
 
 at

org.apache.jasper.compiler.Compiler.compile(Compiler.java:254)
 at

org.apache.jasper.servlet.JspServlet.doLoadJSP(JspServlet.java:462)
 at

org.apache.jasper.servlet.JasperLoader12.loadJSP(JasperLoader12.java:146)
 at

org.apache.jasper.servlet.JspServlet.loadJSP(JspServlet.java:433)
 at

org.apache.jasper.servlet.JspServlet$JspServletWrapper.loadIfNecessary(JspServlet.java:152)
 at

org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:164)
 at

org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
 at

org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
 at

javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
 at

org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
 at

org.apache.tomcat.core.Handler.service(Handler.java:286)
 at

org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
 at

org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
 at

org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
 at

org.apache.tomcat.service.connector.Ajp13ConnectionHandler.processConnection(Ajp13ConnectionHandler.java:160)
 at

org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
 at

org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
 at java.lang.Thread.run(Thread.java:484)
 
 
 
 Here is the code I have in checklogin.jsp
 
 *
 
 jsp:directive.page
 import="java.sql.*,java.sql.ResultSet"
 errorPage="error.jsp" /
 jsp:useBean id="connection" class="ConnectionBean"
 scope="session" /
  
 %
 String p_ID = request.getParameter("player_id");
 String p_passwd =
 request.getParameter("player_passwd");
 connection.setAutoCommit(false);
 String sql;
 sql = "SELECT player_id, player_passwd FROM player
 WHERE player_id=" + p_ID + " AND player_passwd=" +
 p_passwd;
 ResultSet results = connection.executeQuery(sql);
  
 if( results.next() ) { %
% /* ID and password correct, forward to main
 page */ %
jsp:forward page="index.jsp" /
 % } else { %
% /* ID and password incorrect, forward to
 login.jsp to reenter login
 info */ %
jsp:forward page="login.jsp" /
 % } %
 
 **
 Is there an obvious(or not so obvious) reason why
 the jsp can't find the
 ResultSet class?
 
 Thanks,
 Luoi
 
 btw. I'm using Tomcat 3.2.1/linux/apache
  my jsp's are located in
 /home/httpd/html/gamezone rather than 
  $TOMCAT_HOME/webapps/
 
 
 -- 
 D. Shun-Luoi Fong
 821 Melrose Avenue
 Iowa City, IA 52246
 email: [EMAIL PROTECTED]
 
 ---
 Colossions 2:8 See to it that no one takes you
 captive through philosophy
 or empty deception, according to the traditions of
 men, according to the
 elementary principles of the world, rather than
 according to Christ.
 ---
 


=
~~~
Scott

__
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/



Re: Dates in Java

2001-04-06 Thread Scott Walter

This is the way I would do it, which will allow it be
portable to any database.


Calendar c = Calendar.getInstance();
c.add(Calendar.DATE,-7);

//Connection is assumed
PreparedStatement stmt = conn.prepareStatement("select
* from sometable where somedatetimefield = ?");
stmt.setTimestamp(1,new
Timestamp(c.getTime().getTime()));




--- Ryan [EMAIL PROTECTED] wrote:
 I have a simple question about the Date object (or
 similar object)
 
 I have a mySQL table with a DATETIME cell. I want to
 get the date from this cell
 
 (formatted like so: e.g.  2001-03-23 13:04:59)
 
  and retrieve the date that is exactly 7 days
 earlier than the retrieved date.
 
 What is the easiest way to do this? I noticed a lot
 of method deprecations in the specs and I am having
 trouble using the Date object.
 -
 For example, 
 DateTest.java:20: cannot resolve symbol
 symbol  : constructor Date  ()
 location: class java.sql.Date
 Date d = new Date();
  ^
 1 error
 
 -
 
 thanx
 -ryan
 


=
~~~
Scott

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/



Re: Servlet Chaining...

2001-04-04 Thread Scott Walter

Could you use a request dispatcher to forward the
request to the second servlet?

From the first servlet's request object you could code
this:

RequestDispatcher rd = req.getRequestDispatcher("path
to second servlet");

rd.forward();


--- Gaël_Oberson [EMAIL PROTECTED] wrote:
 
 
 Hello
 
 I try to use Servlet Chaining with Tomcat.
 Can I do that with a tag in the web.xml file (with
 servlet-mapping for
 example), or must I modify my Request parameters??
 does anyone know how to
 do that???
 
 I have a Servlet that generates an complete and
 valid XML file from a
 database, and this file must be processed by the
 Cocoon servlet and then be
 returned to the client. That's it. Can anyone help
 me please???
 
 Thanks.
 
 
 
 
 
 ***
   Gaël Oberson
   Computer scientist
   Student in Computer Science Engineering (HES)
 
   Switzerland
   [EMAIL PROTECTED]
   [EMAIL PROTECTED]
 ***
 


=
~~~
Scott

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/



Storing property file

2001-04-02 Thread Scott Walter

Hi,

I want to get your guys/girls input on the following:

I am building an app that will run under Tomcat and in
the future J2EE app servers.  Currently I am storing
parameters for connecting to a database (i.e. jdbc
url, driver, etc.) inside a .properties file.  

When the app is started for the first time I want the
user to enter values for db parameters and then to
write them to the property file.

Currently I am reading the properties file off the
classpath via getResource().  Is there anyway that I
can figure where exactly on the file system where the
properties file is located at so I can write to it in
the correct location???

I took a look at the Jive open source project and they
have the user put the location where the file exists
on the file system as an entry in the properties file,
I would like a more elegant solution.

thanks in advance.


=
~~~
Scott

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/?.refer=text



Re: JSP Load on startup?

2001-03-30 Thread Scott Walter

In the war file under the servlet tag, instead of
using servlet-class, use jsp-file.

scott.
--- "Alex A. Almero" [EMAIL PROTECTED] wrote:
 just the same with servlets
   - Original Message - 
   From: Angel Blesa Jarque 
   To: [EMAIL PROTECTED] 
   Sent: Friday, March 30, 2001 4:04 PM
   Subject: JSP Load on startup?
 
 
   Hello All,
   I would like to know how load JSP(pre-compiled) on
 startup.
   I know how do it with servlets, from web.xml file,
 but no with JSP, my JSPs be compiled before deploy
 and install the web application.
   Thanks in advance and rgds,
 
   Angel Blesa Jarque 
   C.A.S.A.- E.A.D.S - E S P A C I O   
   Departamento de Instrumentacion y Ensayos
   Division Espacio  Tel:  (34 1) 585
 71 44
   Av. de Aragon, 404  Fax:  (34 1) 747
 47 99
   28022   Madrid - Spain  
   E-mail: [EMAIL PROTECTED]
 
 


=
~~~
Scott

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/?.refer=text



Tags and Sendredirect

2001-03-19 Thread Scott Walter

Is this even possible:

I have a JSP page called (page1.jsp), that uses
jsp:include to include page2.jsp.  Page2.jsp has a
custom tag on it.  Inside my custom tag based on a
condition I want to send the user to another page,
let's say page3.jsp.

The way I attempted to do this is within my custom tag
is to call a sendRedirect().  However I keep on
getting a response has already been committed
exception, I have also tried setting a session
attribute and within page1.jsp to check the session
attribute and if it has a certain value, try to do a
sendredirect in page1.jsp, this gives me the same
exception.

Is this feat possible?




=
~~~
Scott

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/



Re: How to get rs.last() supported by Tomcat

2001-03-18 Thread Scott Walter

First of all are you using a JDBC 2.0  driver?  How
are you creating your statement object.  By default
statement objects are forward-only.  You need use a
onverloaded version of the createStatement() method to
make it scrollable, which is needed for the last()
method.  Check the jdk api docs for the exact syntax
of the overloaded createStatement() method.

scott.
--- Jack Li [EMAIL PROTECTED] wrote:
 Hello,
 I need help on JDBC 2.0.
 I have Apache,  Tomcat 3.2.1 and jdk1.3. But I can't
 call JDBC 2.x methods
 such as rs.last(). Any ideas?
 
 Thanks,
 Jack
 


=
~~~
Scott

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/



RE: How to get rs.last() supported by Tomcat

2001-03-18 Thread Scott Walter

Tomcat will only look in the web-inf\classes and
web-inf\jar directories for classes.  If the driver is
already packaged in a jar file place it in the
web-inf\jar directory, otherwise place it in
web-inf\classes.

If you have just the classes to the driver, make sure
the package structure remains intact under
web-inf\classes

You might have to restart tomcat for the effect to
take place.
--- Jack Li [EMAIL PROTECTED] wrote:
 Scott,
 
 I created the statment by using:
 
  "createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
 ResultSet.CONCUR_READ_ONLY)"
 
 I pointed JAVA_HOME to c:\jdk1.3. As I know, jdk3.0
 has JDBC 2.0 in it. When
 I used the javac to compile a similar program at DOS
 prompt and it worked
 fine. But the same code in JSP got no class error
 message. Do I need to
 install JDBC2.0 separately?
 
 Thanks,
 Jack
 
 -Original Message-----
 From: Scott Walter [mailto:[EMAIL PROTECTED]]
 Sent: Sunday, March 18, 2001 10:11 AM
 To: [EMAIL PROTECTED]
 Subject: Re: How to get rs.last() supported by
 Tomcat
 
 
 First of all are you using a JDBC 2.0  driver?  How
 are you creating your statement object.  By default
 statement objects are forward-only.  You need use a
 onverloaded version of the createStatement() method
 to
 make it scrollable, which is needed for the last()
 method.  Check the jdk api docs for the exact syntax
 of the overloaded createStatement() method.
 
 scott.
 --- Jack Li [EMAIL PROTECTED] wrote:
  Hello,
  I need help on JDBC 2.0.
  I have Apache,  Tomcat 3.2.1 and jdk1.3. But I
 can't
  call JDBC 2.x methods
  such as rs.last(). Any ideas?
 
  Thanks,
  Jack
 
 
 
 =
 ~~~
 Scott
 
 __
 Do You Yahoo!?
 Get email at your own domain with Yahoo! Mail.
 http://personal.mail.yahoo.com/
 


=
~~~
Scott

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/



Re: Simple SQL Statement.....

2001-03-12 Thread Scott Walter

Looks to me you are trying to update the price field
with the literal "thePrice", move "thePrice" outside
your double quotes such as:

 String query = "UPDATE parkingPrice SET
 Price = " + thePrice;

--- Mick Sullivan [EMAIL PROTECTED] wrote:
 Hi,
 Does anyone know why this statement WILL ADD a value
 to a record (Price)in a 
 database named parkingPrice:
 Statement statement = connection.createStatement();
 String query = "INSERT INTO parkingPrice(" +
 " Price " +
   ") VALUES ('" +
   thePrice +
   "')";
   System.out.println("query "+ query);
   statement.executeQuery( query );
 
 but this statement WILL NOT UPDATE the record Price:
 Statement statement = connection.createStatement();
 String query = "UPDATE parkingPrice SET
 Price = thePrice";
 System.out.println("query "+ query);
 
 statement.executeUpdate( query );
 
 The Variable thePrice is got using this function
 public void setPrice( String price ) {
 thePrice = price;
 }
 
 It works for INSERT but not UPDATE
 Also my table has only 1 value , being Price(1 row
 and 1 column).
 I do not want to INSERT, I just want to UPDATE the
 single value.
 
 Anyone at all with any ideas???
 Thanks in advance, Mick

_
 Get Your Private, Free E-mail from MSN Hotmail at
 http://www.hotmail.com.
 
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, email:
 [EMAIL PROTECTED]
 


=
~~~
Scott

__
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: How to configure tomcat to us xalan and xerces

2001-03-09 Thread Scott Walter

I just deleted the jaxp.jar and the parser.jar from
the tomcat\lib directory and replaced with the
xerces/xalan jars and it worked like a champ,

scott.
--- [EMAIL PROTECTED] wrote:
 Which files to I have to replace to get tomcat to
 work with xalan 2.0.   Is
 it simply a matter of removing jaxp.jar and
 parser.jar and replacing them
 with xalan and xerces or do I need to do something
 else?
 
 Regards,
 
 Todd
 
 
 The information in this electronic mail ("e-mail")
 message may
 be confidential and for use of only the named
 recipient.  The
 information may be protected by privilege, work
 product immunity
 or other applicable law.  If you are not the
 intended recipient
 the retention, dissemination, distribution or
 copying of this
 e-mail message is strictly prohibited.  If you
 receive this e-mail
 message in error please notify us immediately by
 telephone
 at 770-723-1011 or [EMAIL PROTECTED]  Thank you. 
 
 
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, email:
 [EMAIL PROTECTED]
 


=
~~~
Scott
May the Force be with you!

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




RE: saving a file on client's machine using servlets

2001-03-07 Thread Scott Walter

Below is some code I have written which will take a
file that was uploaded from an html page that has the
file control on it to a servlet.  The servlet then
inserts the file into a database, it can be easily
modified to save to a disk file.  FYI--I use the
o'reilley package for working with fileparts within
the http header so you will need to download it from
o'reilley to get it to work.

package sitemanager.shr.upload;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import com.oreilly.servlet.multipart.*;
import sitemanager.shr.app.AppManager;
import java.sql.*;

/**
 *  Description of the Class
 *
 *@author Scott F. Walter
 *@createdFebruary 17, 2001
 */
public class UploadContent extends HttpServlet {

/**
 *  Description of the Method
 *
 *@param  request   Description of
Parameter
 *@param  response  Description of
Parameter
 *@exception  IOException   Description of
Exception
 *@exception  ServletException  Description of
Exception
 */
public void doGet(HttpServletRequest request,
HttpServletResponse response)
 throws IOException, ServletException {
}


/**
 *  Description of the Method
 *
 *@param  request   Description of
Parameter
 *@param  response  Description of
Parameter
 *@exception  IOException   Description of
Exception
 *@exception  ServletException  Description of
Exception
 */
public void doPost(HttpServletRequest request,
HttpServletResponse response)
 throws IOException, ServletException {
MultipartParser mp = new MultipartParser(request,
1024 * 1024);
Part p = mp.readNextPart();

Connection conn = null;
byte[] fileData = null;
byte[] fileData2 = null;

try {
conn = AppManager.getConnection();

//while(p != null) {
if (p instanceof FilePart) {
ByteArrayOutputStream ba = new
ByteArrayOutputStream();
((FilePart) p).writeTo(ba);
fileData = ba.toByteArray();

PreparedStatement stmt =
conn.prepareStatement("INSERT INTO sm_banners
(filename,bannerimage) values(?,?)");
stmt.setString(1, ((FilePart) p).getFileName());
stmt.setBytes(2, fileData);
stmt.executeUpdate();
stmt.close();

Statement stmt2 = conn.createStatement();
ResultSet rs = stmt2.executeQuery("select
bannerimage from sm_banners");
rs.next();
fileData2 = rs.getBytes(1);

}
//p = mp.readNextPart();
//}
}
catch (Exception e) {
sitemanager.util.Logger.log(e);
}
finally {
try {
conn.close();
}
catch (Exception e) {
sitemanager.util.Logger.log(e);
}
}

response.setContentType("text/html");
ServletOutputStream out =
response.getOutputStream();
out.println("the file was uploaded!");
out.close();
}
}


--- Adilakshmi Lingam [EMAIL PROTECTED] wrote:
 Can you please point me to some info on how to do
 that. I'm kind of a newbie
 in this area.
 thanks in advance,
 Lakshmi
   -Original Message-
   From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of
 David Crooke
   Sent: Monday, March 05, 2001 11:28 PM
   To: [EMAIL PROTECTED]
   Subject: Re: saving a file on client's machine
 using servlets
 
 
   Sounds like a case for JavaScript, or possibly an
 applet. Pushing to the
 server and back is kinda clonky.
   If you just want them to create a file and save to
 disk, why not have them
 crank up a local text editor?
 
   "Burgess, Jay" wrote:
 
 
 I believe one solution is to POST the form data
 from the text area to
 you servlet, then return it right back, but with an
 unknown MIME type.
 Typically, browsers give you the option to "Save to
 Disk" when they
 encounter an unknown MIME type. To set the MIME type
 on the response, simply
 call "res.setContentType(type);", where "type" is
 something unknown like
 "lakshmi/post".
 
 Passing this data back and forth doesn't seem to
 be the most efficient
 solution, though, so I'm interested to see if 

Tomcat, Jaxp, Xalan

2001-03-01 Thread Scott Walter

Help!

I am trying to do xml transformation with tomcat.  I
want to use the xalan transformation engine.  However
the jaxp.jar that is included in the tomcat lib is
getting in the way.  I keep on getting a "Namespace
not supported by parser" exception.

If I remove jaxp.jar and parser.jar from the tomcat
lib directory and replace it with the xerces.jar
everything works great.  Is there anyway to keep the
installed jaxp.jar and parser.jar but still get my
transformations to work, because my app will be
running at a hosting provider and they probably won't
make the change I need.

thanks in advance,
scott.

Below is the code I use to do my transformation:
TransformerFactory tFactory =
TransformerFactory.newInstance();
Transformer transformer =
tFactory.newTransformer(xslSource);
transformer.transform(xmlSource, new
StreamResult(response.getOutputStream()));  

=
~~~
Scott
May the Force be with you!

__
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




pre compile

2001-02-22 Thread Scott Walter

Is there a way in tomcat to precompile all my jsp
pages?  So that as I am navigating to a new page I
don't have to wait for it to compile?

thanks,

scott.

=
~~~
Scott
May the Force be with you!

__
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices! http://auctions.yahoo.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Updating cookies in servlets and JSPs

2001-02-09 Thread Scott Walter

Let's see the code snippet you are using.

--- Joseph Carew [EMAIL PROTECTED] wrote:
 I have a class used by a page that needs to update
 the value of an
 existing cookie.  It should be simple but the
 browser is not receiving
 the updated cookie.  I have even tried making a
 brand new cookie with
 the same attributes (except the value) and it is
 still not getting
 there.  If I change the name the a new cookie is
 being received.  What
 am I missing.  I have read the spec and the
 javadocs, neither describe
 the behavior I am experiencing
 
 Thanks
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, email:
 [EMAIL PROTECTED]
 


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




RE: Dynamically created calendar

2001-02-08 Thread Scott Walter

Go to one of the javascript sites, such as
javascript.com.  They have free code snippets of
generating calendars dynamically for any month and
year.

scott.
--- "Cato, Christopher" [EMAIL PROTECTED] wrote:
 Yes, I'd say it is possible. As long as you figure
 out the logics around
 creating the calendar, there are classes that handle
 dates and time.
 
 Regards,
 Christopher Cato
 
  -Original Message-
  From: Jason Teh [mailto:[EMAIL PROTECTED]]
  Sent: den 8 februari 2001 13:26
  To: [EMAIL PROTECTED]
  Subject: Dynamically created calendar
  
  
  Hi guys
  
  Is it possible to use JSP to dynamically create a
 calendar?
  
  J
  
  
 

-
  To unsubscribe, e-mail:
 [EMAIL PROTECTED]
  For additional commands, email:
 [EMAIL PROTECTED]
  
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, email:
[EMAIL PROTECTED]


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Load JSP page on start up

2001-02-08 Thread Scott Walter

Yes, but instead of specifying the servlet-class
tag, you will need to use the jsp-file tag.  This
will cause the jsp page to  be compiled and loaded.

scott.

--- Amir Nuri [EMAIL PROTECTED] wrote:
 Hi
 Can I load jsp page on start-up the same way I load
 a Servlet 
 (e.g: load-on-startup3/load-on-startup (
 
 
 
 E-mail  : [EMAIL PROTECTED]
 Web : http://www.mobilitec.com/
 
 Mobilitec, Inc. 
 P.O. Box 15049 Matam
 Haifa 31905, Israel
 Tel +972-4-855-1133 ext. 115
 Fax +972-4-855-1112
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, email:
 [EMAIL PROTECTED]
 


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Re: Servlet URLs

2001-02-08 Thread Scott Walter

just specify the url mapping in the web.xml file.  It
does not have to have servlet in it.  For example I
have a servlet that processes a login from an html and
the url to the servlet is:

http://localhost/processlogin or 
http://localhost/myapp/processlogin

cheers,
scott.
--- "Cumming, Murray" [EMAIL PROTECTED]
wrote:
 I am using tomcat with Apache (on Solaris).
 
 The tomcat example servlets are at URLs such as:
 

http://www.somedomain.com/examples/servlet/HelloWorldExample
 
 but the actual class file is at e.g.

/usr/local/jakarta-tomcat/webapps/examples/WEB-INF/classes/HelloWorldExample
 
 The 'servlet' directory is not in the actual path,
 and it is not in the
 context path in jakarta's conf/server.xml file. This
 'servlet' part of the
 URL seems to be used in mod_jk.conf-auto for a
 JKMount command, as a result
 of a JKMount command in mod_jk.conf.
 
 So:
 Is there any way to use servlets (not JSPs) with
 tomcat without using
 '/servlet/' in the URL. I am trying to set up a
 system which already uses
 fixed URLs. 
 
 Murray Cumming
 [EMAIL PROTECTED]
 www.murrayc.com
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, email:
[EMAIL PROTECTED]


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




Servlet init method called twice

2001-02-07 Thread Scott Walter

If I have a servlet that I have setup as
load-on-startup the init() method is called twice. 
However if remove the load-on-startup and call the
servlet manually the init() method is called once.

Any clues?

thanks,
scott.

__
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




RE: Another Newbie Question -- Urgent Please!

2001-02-07 Thread Scott Walter

No you don't have to download anything extra.  The
classes are included with tomcat in the servlet.jar
file, which is located in the lib directory under your
tomcat install.

FYI--When specifying a classpath for jar files you
can't just specify the directory in which the jar file
exist in, you must include the full path.  Below is an
example to compile a servlet that needs servlet.jar:

javac -classpath c:\tomcat\lib\servlet.jar
MyServlet.java

scott.
--- "Rezaul H. Safiuddin" [EMAIL PROTECTED]
wrote:
 
 OK...I am totally Confused..please Help!
 
 I have jdk 1.3, Apache Web Server and TomCat
 3.2Where is the javax
 package ? I finally downloaded jsdk 2.1 and the
 javax directory is
 there..I pointed the classpath to that directory or
 its parent directory
 in many ways.. - but it never finds it.
 
 Shouldn't the servlet API's come with TomCat or do I
 have to download Java
 Web Server or whatever ? 
 
 These are the errors I am getting :
 
 HelloWorldServlet.java:3: package javax.servlet does
 not exist
 import javax.servlet.*;
 ^
 HelloWorldServlet.java:4: package javax.servlet.http
 does not exist
 import javax.servlet.http.*;
 
 Help please...Thanks.
 
 Kash
 
 
 On Wed, 7 Feb 2001, Erik LaBianca wrote:
 
  Do you have the servlet api's in your compilers
 classpath?
  
  --erik
  
  -Original Message-
  From: Rezaul H. Safiuddin
 [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, February 07, 2001 10:09 PM
  To: [EMAIL PROTECTED]
  Subject: Another Newbie Question -- Urgent Please!
  
  
  
  
  How come I am not being able to compile a
 HelloWorldServlet.java with
  jdk1.3 ? Its giving me hundreds of compiler
 errors. I need to compile this
  file and create the .class file . Do I need
 something  especial for
  compiling servlets ? I already installed the
 TomCat 3.2.1 . Any Help would
  be appreciated. But I am able to run the
 SnoopServlet.java that comes with
  TomCat in the classes directory. Do I have to
 configure something else if
  I wanna add a new servlet class ?
  
  Kash
  
  
 

-
  To unsubscribe, e-mail:
 [EMAIL PROTECTED]
  For additional commands, email:
 [EMAIL PROTECTED]
  
 

-
  To unsubscribe, e-mail:
 [EMAIL PROTECTED]
  For additional commands, email:
 [EMAIL PROTECTED]
  
  
 
 

-
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, email:
 [EMAIL PROTECTED]
 


__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]