Julia Reynolds

Ranch Hand
+ Follow
since May 31, 2001
Merit badge: grant badges
For More
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 Julia Reynolds

Hi Raj,

Maybe explicitly set redirect="false" in the struts-config.xml and get your list this way in the jsp before accessing it:

<c:set var="myList" value="${requestScope['myList']"/>

Julia
16 years ago
I've done this numerous times with Jakarta POI, nice project and easy to use.

http://jakarta.apache.org/poi/
16 years ago
You can use java.io.File for either files or directories.
So you can create the source directory like so:

File sourceDir = new File("C:\\test");

and then get all the subdirectories or files as an array of files:

File[] subdirects = sourceDir.listFiles();

Then you can simply test each subdirectory to see if it is a directory or file.

The best way to manipulate a batch of directories and files is to use a recursive process, as in the method zipFiles shown below.


So you can call zipFiles, passing in sourceDir = new File("C:\\test");

BufferedInputStream origin = null;
FileOutputStream dest = new FileOutputStream("c:\\MyZip1.zip");
CheckedOutputStream checksum = new CheckedOutputStream(dest, new Adler32());
ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(checksum));
//out.setMethod(ZipOutputStream.DEFLATED);
byte data[] = new byte[BUFFER];

public static void main(String[] args){
try{
zipFiles(new File("C:\\test");
out.close();
System.out.println("checksum : " + checksum.getChecksum().getValue());
} catch(Exception e){
e.printStackTrace();
}
}


private static void zipFiles(File dir){
if(dir.isDirectory()){
File[] files = dir.listFiles();
for (int i = 0; i < files.length; i++) {
zipFiles(files[i]);
}//end for

}else{
System.out.println("Adding: "+files[i]);
FileInputStream fi = new
FileInputStream(files[i]);
origin = new
BufferedInputStream(fi, BUFFER);
ZipEntry entry = new ZipEntry(files[i]);
out.putNextEntry(entry);
int count;
while((count = origin.read(data, 0,BUFFER)) != -1) {
out.write(data, 0, count);
}
origin.close();
}
}

Julia
17 years ago
I'm just wondering if anyone has done anything with Darkstar yet?
If so, what do think about the project?

https://games-darkstar.dev.java.net/

Julia
17 years ago
Ramesh,

We use the apache commons net package. http://jakarta.apache.org/commons/net/

The code is simple to implement, here is a sample:

// Connect and logon to FTP Server
FTPClient ftp = new FTPClient();
ftp.connect(server);
ftp.login(username, password);

// Change to the directory
ftp.changeWorkingDirectory(folder);

FileInputStream src2 = new FileInputStream(outFile);
ftp.storeFile(filename,src2 );
src2.close();
ftp.logout();
ftp.disconnect();

Hope this helps,

Julia
19 years ago
I'm not sure if this is what you are looking for, but I have used
the JDK 1.4.2 classes XMLEncoder and XMLDecoder to convert javabeans from xml to objects.

http://java.sun.com/j2se/1.4.2/docs/api/java/beans/XMLDecoder.html

Julia
19 years ago
Xie,

I think by saying "Node" the interviewer was giving you a clue to
talk about the LinkedList data structure in Java. Here is a good
explanation:

http://www.javacoffeebreak.com/books/extracts/javanotesv3/c11/s2.html

Julia
19 years ago
Shailesh,

I wrote a web scraper using the Apache httpclient to handle the connections.
http://jakarta.apache.org/commons/httpclient/

I fetched the text of the web page with httpclient and then wrote an html parser for the data tables on the page. The parser uses regex patterns to recognize groups of html table/row/column tags.

I hope this helps.

Julia
19 years ago
The JDeveloper 10 books on the market now don't cover ADF very well, just introductory chapters. This is a good source, Jonas Jacobi's blog.
http://www.orablogs.com/jjacobi/

Good luck,

Julia
I think they do something like what you are describing in the w3c
xml tutorial with xsl.

http://www.w3schools.com/xml/default.asp

Julia
19 years ago
Brian,
<shot in the dark>
Is there a setting in Tomcat's configuration that governs redirects?
Maybe that could be the source of the problem?

</shot in the dark>

Julia
19 years ago
I can't answer your question directly, but here are the Documentum resources I have:

The Web Development Kit support mailing list:
http://groups.yahoo.com/group/wdk5_developer_community/

The DM_Developer site:
http://www.dmdeveloper.com/

The Documentum developer support site:
http://customernet.documentum.com/developer/index.html

Hopefully you can find the API docs you are looking for somewhere at one of these links.

Good Luck,

Julia
19 years ago
Chris,

You can use the SimpleDateFormat class to transform a Date into a formatted
string that should be acceptable to mySQL. http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html

Here is an example:
public String paintSystemTimeStamp(){
String timestamp = "";

String dateformat = "MM-dd-yyyy HH:mm:ss a z";
timestamp = (new SimpleDateFormat(dateformat)).format(new Date());

return timestamp;

}

If this were for an Oracle db, you might use the to_date SQL function to convert a string into a date. Is there an equivalent function in mySQL?

Julia
[ January 11, 2005: Message edited by: Julia Reynolds ]
19 years ago
IBM has this tutorial called Java programming for C/C++ developers:

http://www-106.ibm.com/developerworks/edu/j-dw-ijcc++p-i.html

Julia
19 years ago
Heath,

I worked at a company with a JSP transcription product. We integrated the Wintertree spellcheck applet with success. Easy to install and performant, and you can customize the word list:

http://www.wintertree-software.com/dev/spellcheckapplet/

Julia
19 years ago