[Offtopic] JDBC

2001-10-26 Thread Chris Tucker

Hi all,

Has anyone here ever had trouble with a connection request to an ODBC source
through the JDBC<->ODBC bridge (driver: sun.jdbc.odbc.JdbcOdbcDriver)
failing with an error "Login failed for user '\'"?  I'm getting this
whenever I try to connect to the DB, despite the fact that username/password
being sent through are correct (and are not \!).  Any ideas/suggestions
would be gratefully received.

Chris Tucker
ePangea.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://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: Tab order in a JSP

2001-10-31 Thread Chris Tucker

This thread would be much better addressed to a JavaScript forum than a JSP
one: head over to www.devshed.com for some good JS discussions, or check out
pages like http://developer.irt.org/script/form.htm for a load of sample
code that should cover some, if not all, of what you want to do.

Chris Tucker
ePangea.com

-Original Message-
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Vibha Jindal
Sent: Wednesday, October 31, 2001 1:11 AM
To: [EMAIL PROTECTED]
Subject: Re: Tab order in a JSP


No, they are not permamnently readonly.

I am using field.readOnly = true;

this means it readonly.



- Original Message -
From: Badrinarayan K. Melkote <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 31, 2001 2:34 PM
Subject: Re: Tab order in a JSP


> I would like to know
> 1. Are the readonly fields in the form permanently readonly?
> If not how do u make the form element readonly thro' scripts?(i think its
> not possible)
> 2. Are u are disabling it?
>
>
> - Original Message -
> From: "Vibha Jindal" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, October 31, 2001 11:51 AM
> Subject: Tab order in a JSP
>
>
> > Hi,
> >
> > I am trying to set the tab order in a JSP and am using tabindex for
that.
> > The problem I am encountering is that the tab enters a readonly field
and
> > then does not tab out because the way I am making a field readonly is by
> > using readonly and onfocus = this.blur()
> >
> > Can anyone help?
> >
> > Regards,
> > Vibha
> >
> >
>
===
> > 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://archives.java.sun.com/jsp-interest.html
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.jsp
> >  http://www.jguru.com/faq/index.jsp
> >  http://www.jspinsider.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://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.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://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.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://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: Apache and PWS (Maybe OT)

2001-11-02 Thread Chris Tucker

This is possible, though it'll take a little buggering about on your part.
You'll have more luck asking a question like this on an Apache (or PWS)
list: I don't know about PWS, but for Apache you need to be looking at the
idea of virtual hosts -- there's a load of good docs/mailing list archives
available from http://www..apache.org  Also, you won't be able to have both
of them running on the same port on the same machine (unless you have
multiple IP addresses), so you'll have to set one of them up to use
something other than the default port 80.  That'll mean you have to address
it as e.g http://pws:8080/webpages -- not sure if there's any way around
this, though I would be somewhat surprised if there is.

You'll probably need to be taking a look at the hosts configuration file to
set up your local aliases -- not sure where this is in Windows.  Probably
somewhere in c:\windows or wherever.

-Original Message-
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Theo Starr
Sent: Friday, November 02, 2001 3:37 AM
To: [EMAIL PROTECTED]
Subject: Apache and PWS (Maybe OT)


Hi Everyone

I know it is possible to have Apache and PWS running on the same machine but
I find they clash where they are both running at the same time and you use
"localhost"

Is it possible to give one or both a different address such as "apache" and
"pws" where both are exclusive addresses?

such as

http://apache/webpages

and

http://pws/webpages


Has anyone tried this??

Theo Starr
Almityand-Mega Multimedia
WWW:  http://www.ozemail.com.au/~almity1
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://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.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://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Passing parameters to includes

2001-11-09 Thread Chris Tucker

Hi all,

I was wondering how other people approach the problem of passing parameters
to include files (or even if this is really something that it's a good idea
to do...).  For example, say I want to specify some button text for an
included file, I may want pass a parameter called "buttontext" with the
value "Hello".  The way I've been approaching this so far is to encode the
parameters as a query string on the include URL, e.g.

but this doesn't really scale up to anything more than simple textual
arguments.  I could add stuff to the session or context, allowing me to use
more complex objects, but I don't want to be creating a load of
interdependencies as far as attribute naming etc. is concerned between an
include file and the file including it.  Ideally, I'd like to just be able
to parameterise the include as one would a method.

Any suggestions?

Chris Tucker

===
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://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: Passing parameters to includes

2001-11-09 Thread Chris Tucker

Thanks to everyone for the replies.  I'm thinking that my best approach (as
yet untested) will probably be to combine string parameter passing (using
jsp:param) and request attributes: i.e. use string parameters to identify
the name of the request attribute, and an object in that request attribute
to store my actual data.  That way I can keep the namespaces of each file
completely separated but still refer to objects between them.
e.g.

<%-- set parameters --%>


<%-- set parameters --%>






Now I just have to work out how well it handles sending multiple values in
like that, and see if maybe I need to just use one and wrap it up in a
Vector or whatever.  Anyway, thanks again.

Cheers,

Chris

-Original Message-
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Chen, Gin
Sent: Friday, November 09, 2001 11:19 AM
To: [EMAIL PROTECTED]
Subject: Re: Passing parameters to includes


Chris,
Depending on how dynamic you want the text to be there are several
methods you can use. For example. if a specific include page has a button
with the text "hello" and that changes only when business requirements
dictate it. You can actually just put it into your web.xml file as an init
parameter. You see this alot with webaddresses. For example a JSP page that
is included as a footer file may have a "Questions and Comments contact the
webmaster" where the webmaster is actually a link that says
<.mailto:[EMAIL PROTECTED]> (the . was put to prevent this from showing in
HTML) That web address is usually placed as a web.xml init param called
webmaster (or whatever).
But if the text must change dynamically depending on who is
accessing the page. It may be better to have it as a database value stored
and keyed by the customers id.
Another approach is just do it the way that you are now. But that
may cause a problem as the url has a length limitation and depending on how
many fields you are setting this may cause some problems. Security is of
course an issue with that method as well. Any user can tell that you are
setting up fields through the URL and can easily just pass a new URL to
display what he/she wants to display.
Of course there are more solutions as well but I think these 2 are
the main solutions if you are not hardcoding values.
-Tim

-----Original Message-
From: Chris Tucker [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 09, 2001 2:14 PM
To: [EMAIL PROTECTED]
Subject: Passing parameters to includes


Hi all,

I was wondering how other people approach the problem of passing parameters
to include files (or even if this is really something that it's a good idea
to do...).  For example, say I want to specify some button text for an
included file, I may want pass a parameter called "buttontext" with the
value "Hello".  The way I've been approaching this so far is to encode the
parameters as a query string on the include URL, e.g.

but this doesn't really scale up to anything more than simple textual
arguments.  I could add stuff to the session or context, allowing me to use
more complex objects, but I don't want to be creating a load of
interdependencies as far as attribute naming etc. is concerned between an
include file and the file including it.  Ideally, I'd like to just be able
to parameterise the include as one would a method.

Any suggestions?

Chris Tucker

===
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://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.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://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.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://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: Please help! Recursive loop in JSP

2001-11-12 Thread Chris Tucker

Easiest way to do this is just to set up a recursive method call to go
through each level in the tree.  Effectively you're just doing a tree
traversal, and can apply all the standard algorithms to this: your nodes are
each of the people, and can be picked out using an appropriate SQL query
(e.g. SELECT name FROM People WHERE parent = 4).  You can build this query
for each recursive call, modifying the WHERE clause appropriately.

The problem with this approach is that you can end up with a shedload of
database connections going on, and if the tree is deep or broad you'll
suffer from a hell of a slowdown related to having to initiate a query for
every single person.  You can optimise this by using more complicated WHERE
clauses on your SQL to select everyone at a given level meeting the
appropriate criteria, thereby limiting the number of recursive calls to h
(where h is the height of the tree).  You may also want to maintain a list
of all the nodes you have already processed to check for the a mistake in
the data that leads to a cyclic dependency (e.g. mary is johns mother, mary
is johns daughter).  Your data shouldn't have these in it, but it's a good
idea to check to make sure or you risk crashing the server in a big ol'
recursive loop.  There are further ways to optimise the queries (such as
unrolling your recursion into a loop), but unless this is going to be a real
heavy load situation you're likely to be better off going for code
readibility and maintainability.

As far as doing this in JSP is concerned, you should put the code to do the
actual recursive search into a bean and simply format its output with
appropriate JSP.

Hope that helps,

Chris Tucker

-Original Message-
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Frank Mancini
Sent: Monday, November 12, 2001 2:04 PM
To: [EMAIL PROTECTED]
Subject: Please help! Recursive loop in JSP


I have a recursive looping problem here.

For example, say I have this table

id, name, parent

1,john,4
2,bill,3
3,cathy,4
4,jackie,0
5,jeff,4
6,joe,7
7,amy,0

Essentially,

jackie doesn't have a parent, but has john, jeff and cathy as children. bill
is the child of cathy and thus jackies grandchild.


How would I do this query such that I say I want to see all the children
(including everyone below him/her) below, say jackie...this is really a self
join to oneself with an unknown number of levels below.

How would I do this in jsp do display all of jackies relatives below her?

_
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

===
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://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.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://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: pls help to check if it is syntax error

2001-11-12 Thread Chris Tucker

Take out the quotes around damount:

String updatebalance ="Update dsnuser set balance= balance+ "+damount+" from
dsnuser where cardnumber='"+cardnumber+"'  ";


-Original Message-
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Miao, Franco CAWS:EX
Sent: Monday, November 12, 2001 2:12 PM
To: [EMAIL PROTECTED]
Subject: pls help to check if it is syntax error


here is the source code, for some reason, the balance just add up in string
instead of amount, let's say original balance has $2000, after update $1000
its should has total $3000, but the the fact is $20001, pls help me out
thanks!

Franco


String updatebalance ="Update dsnuser set balance= balance+'"+damount+"'
from dsnuser where cardnumber='"+cardnumber+"'  ";


// Get result code

int updateCount=SQLStatement.executeUpdate(updatebalance);

if(updateCount > 0)

===
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://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.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://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



Re: Login Authentication against database...

2001-11-14 Thread Chris Tucker



I'm assuming that 
you are actually entering that while() loop (i.e. data is coming back from the 
query).  In that case, it seems likely that a SQLException is being thrown 
by either myResultSet.getString("UserLoginId") or 
myResultSet.getString("UserPassword").   The most likely cause of this 
is that you've got the wrong name for a column (i.e. UserLoginId or UserPassword 
does not exist in the results of the query you execute to get 
myResultSet).  Check your column names.  Also, I assume you're going 
to be catching SQLException's somewhere nearby: output the error message, it's 
generally quite informative.

  -Original Message-From: A mailing list about Java 
  Server Pages specification and reference 
  [mailto:[EMAIL PROTECTED]]On Behalf Of Praveen 
  PotineniSent: Wednesday, November 14, 2001 7:59 AMTo: 
  [EMAIL PROTECTED]Subject: Login Authentication against 
  database...
  Hi all,
  I'm doing a Username/password validation against 
  Sybase database.
  When the user enters the details i check for the 
  values in the database and if it dosen't match i redirect to login 
  page.
  I got the result set from the query and 
  i check if the username/password entered exists in the 
  database...
  login.jsp:::
   
  id = 
  request.getParameter("username");      pin = 
  request.getParameter("password");
  if (loginBean.UserExists(id,pin) == true) 
  { 
  session.setAttribute("user", id);     monitor.put(id, 
  session); System.out.println("Assigned 
  new session for: " + id);
   
  session.setMaxInactiveInterval(900);
   display = 
  "control.jsp?";  }  else{ 
  display = "showLogin.html";   }%>
  
   
  Login.java:::
   
  while(myResultSet.next()){String uid = 
  myResultSet.getString("UserLoginId");String upin = 
  myResultSet.getString("UserPassword");   
       if 
  ((username.equals(uid)) && 
  (password.equals(upin))){  validUser = 
  true;}   }
   
  When i debug i find that ""if 
  ((username.equals(uid)) && (password.equals(upin)))"" dosen't 
  execute...That means i'm doing a mistake in that code...
  Can someone help me with this
   
  Thanks
  Praveen


Re: how to embed Javascript in Jsp?

2001-11-14 Thread Chris Tucker

There was a long discussion on this a while ago in this list which went into
some detail about this whole issue.  In fact, reviewing it, you were
involved in the discussion!  Basically, your JavaScript has to go, in source
form, to the browser (i.e. the client) because it is a client-side
interpreted language.  There is absolutely no way you can prevent someone
with a little guile from reading your JavaScript -- you can make it harder
by using  tags etc., but the script is
still sent to the client.  You can look for an obfuscator to make it harder
for people to understand the code, but it'll still be there.  You can't use
JavaScript on the server side to execute any form of dynamic client side
activity.   Period.

-Original Message-
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Miao, Franco CAWS:EX
Sent: Wednesday, November 14, 2001 11:13 AM
To: [EMAIL PROTECTED]
Subject: Re: how to embed Javascript in Jsp?


but then I can not hide the Javascript file, I saw a website has floating
object, I knew it is running Javascript, but can see it in "Soure" menul in
brower, but , just wondering how this web guy hide
the javascript. I guess this guy program javascript run at server side.

Franco


-Original Message-
From: Noble Long [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 14, 2001 10:36 AM
To: [EMAIL PROTECTED]
Subject: Re: how to embed Javascript in Jsp?


Don't put it inside the JSP tags <% and %> put it inside  or html
tags and surround those with your JSP statements in there own tags -

example:
(snip)
 }
  catch(SQLException sqle){}
 }

  %>