Jill Smythe

Greenhorn
+ Follow
since Jan 27, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jill Smythe

Hi all,

I'm new to JavaScript and am having some problems creating the exact (simple!) regular expression I need. I need to validate a form field to ensure that all words are separated by commas. For example:

word1, word2, word3
or
word1,word2, word3
etc... (note there is no comma after the last word)

So far, my regular expression is able to test for one word, random spaces and the comma, but I'm not sure how to extend this to an arbitrary number of words. So far I've got:

/\w+\s*,{0,1}/

Any help here would be really appreciated!!

Jill
Hi Lasse,
Thanks a lot for your help -- As you suggested, the jar file was corrupted and the problem was fixed by re-intalling it.

Thanks again!
Julie
Hi Lasse,
Thanks for your reply. I tried executing as you suggested and got *slightly* different error:

Would you suggest that the jar file is corrupted? What is the -tf option?
Any suggestions will help!
Thanks again,
Jill
Hi,
I am trying to run Saxon7.8 on an XML document (StreamAM.xml) with an XSL
stylesheet (StatusStream.xsl) in the following way:
/opt/java_1.4.1/bin/java -jar
/usr/dev/psoft/ps8common/saxon/saxon7.jar StatusAM.xml StatusStream.xsl
> StatusAM.htm
but keep getting the following ZipException:

I am working on UNIX with Weblogic6.1 web server and am really not sure why this is occurring -- it works fine when run on Windows...? Does anyone know Saxon or have any suggestions as to why this might be occurring? I'm pulling my hair out.
Thanks in advance,
Jill
So by synchronizing the session object in the following way will ensure that data interference cannot occur between objects created in a single session:

Also, each separate session (eg, different users on different PCs) will create separate instances of "auth" object and therefore interference is not possible between users on different PCs. I think I've got it now
Thanks for your help,
Jill
14 years ago
JSP
Hi Praful,
Thanks for your reply -- it was really helpful.
Can I just clarify with you then, a session object exists for the time that one user's browser is open and is always separate from any other users that may be referencing the bean at the same time? Eg, if PC1 and PC2 instantiate "auth" at the exact same time these are completely different session objects...? Is this correct?
If this is the case, then it would look like my code is in fact thread-safe and interference will not occur...
Have I got it right?
Thanks!
Jill
14 years ago
JSP
Hi,
I have a query about the <jsp:setProperty> tag and thread-safety. As far as I can see, any code using this tag to record variables entered in a form cannot be thread safe. Is this true?
For example, my code is:
--------------------------------------------------------------
<%@page contentType="text/html"%>
<%@ page session="true" errorPage="errorpage.jsp" import="TeamWebsite.Security.Authenticate%>
<jsp:useBean id="auth" scope="session" class="TeamWebsite.Security.Authenticate20" />
<jsp:setProperty name="auth" property="*"/>
<% auth.authenticate(request, response); %>
---------------------------------------------------------------------
Even though auth.authenticate(request, response) is a synchronized method, I'm pretty sure interference can occur during the setProperty method as in the following trace:
Thread 1: Enters form Data
Thread 1: jsp:setProperty methods are called, and form items recorded in instance "auth" of this object
<Control switches to thread 2>
Thread 2: Enters form Data
Thread 2: jsp:setProperty methods are called, and form items are called in instance "auth" of this object
<Control switches to thread 1>
Thread 1: Calls authenticate() and uses the variables set by Thread 2 (unintentially)
<Control switches to thread 2>
Thread 2: Calls authenticate() and uses the variables set by Thread 2
All of the methods in my JavaBean are thread-safe, but the initial code using <jsp:setProperty> is not by default. Am I able to include this tag within a synchronized method so the bean variables can be set and other methods executed as a single unit?
I know the other alternative is to implement the single threaded model <%@ page isThreadSafe="false" %> but this is my last resort for performance reasons.
Any light that can be shed on this subject would be much appreciated!!
Jill
14 years ago
JSP
Hi all,
I'm trying to validate user input gathered from a form with JavaScript, but am having difficulty with one field. I need to prevent a user entering any illegal characters in the text box. These illegal characters are:
white space [ ] ( ) = , " / ? @ : ;
So, for example the following is not allowed: group(1, 2?)
I think I should do this with a regular expression and have something like the following:
function checkInput(input) {
var illegalChars = new RegExp(/[\s[]()=,"/?@:;]/);
return input.test(illegalChars);
}
but would really appreciate it if someone who really knows JavaScript could help me out with this RegExp!
Thanks in advance,
Jill
Hi all,
I have come up against a problem that I'm going to try to solve with cookies. The problem is that I only have J2SE installed on my computer and cannot see the javax. servlet .http. Kookie class in the JDK 1.4 API.
Does anyone know where I can download these add-on classes (if I can)? And any good tutorials on getting started with JSP and cookies would be really appreciated too.
Thanks for your help
Jill
14 years ago
JSP
Hi,
Although I am pretty familiar with Java, I am a total newbie with using it to parse XML. I have been reading quite a few tutorials so am getting a good understanding of it and am thinking of using the DOM model for my purposes.
What I haven't been able to find, however, is how I can actually get started with this. I have tried compiling a few examples and have been getting errors such as:
>> xmltest.java package javax.xml.parsers does not exist
>> xmltest.java package org.w3c.dom does not exist
etc etc...
It looks like these packages don't come with J2SE. Can anyone confirm this? Do I need to download and install the Java Web Services Developer Pack to solve this problem?
Finally, I know I will need an XML parser but have read that JDK 1.4 has it's own parser (Crimson). Is this adequate for parsing XML files or will I also need a parser such as Xerces?
Thanks so much for any help!
Hi,
Although I am pretty familiar with Java, I am a total newbie with using it to parse XML. I have been reading quite a few tutorials so am getting a good understanding of it and am thinking of using the DOM model for my purposes.
What I haven't been able to find, however, is how I can actually get started with this. I have tried compiling a few examples and have been getting errors such as:
>> xmltest.java package javax.xml.parsers does not exist
>> xmltest.java package org.w3c.dom does not exist
etc etc...
It looks like these packages don't come with J2SE. Can anyone confirm this? Do I need to download and install the Java Web Services Developer Pack to solve this problem?
Finally, I know I will need an XML parser but have read that JDK 1.4 has it's own parser (Crimson). Is this adequate for parsing XML files or will I also need a parser such as Xerces?
Thanks so much for any help!
14 years ago