27.04.2013 Views

330 Java Tips.pdf - FTP Server

330 Java Tips.pdf - FTP Server

330 Java Tips.pdf - FTP Server

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Servlets & <strong>Server</strong>s<br />

Answer:<br />

Try Resin, www.caucho.com<br />

Try tomcat from http://jakarta.apache.org - pure <strong>Java</strong>,<br />

servlets 2.2, good stuff! Tomcat is good. It's not fast, but it's very easy to setup and<br />

good solution for development. Since most heay-duty servers do implement SUN<br />

specification, one can migrate application in no time.<br />

--<br />

DG<br />

Jigsaw is also good but doesn't support the Servlet 2.2 spec<br />

<br />

Both of these are open source with BSD-like license.<br />

There's also Jetty http://jetty.mortbay.com/ Artistic license, Servlet 2.2 spec<br />

compliant), GNU Paperclips<br />

http://www.tapsellferrier.co.uk/gnupaperclips/ GPL, claims to be moving towards<br />

Servlet 2.3 spec compliance) and also<br />

vq<strong>Server</strong> http://www.vqsoft.com/vq/server/ which is free but not open source.<br />

Finally many of the commercial servers can be downloaded free for trial periods.<br />

--<br />

Simon Brooke http://www.jasmine.org.uk/~simon<br />

How can I get access to Cookie set at the Client?<br />

Answer: The following code should access a cookie on a client. It reads in all the<br />

cookies on the machine. And checks there name for whichever one you are looking<br />

for.<br />

Cookie[] cookies = request.getCookies();<br />

for(int i=0; i < cookies.length; i++) {<br />

Cookie thisCookie = cookies[i];<br />

if (thisCookie.getName().equals("Cookiename")) {<br />

// Do whatever you want with the cookie....<br />

} else {<br />

// cookie doesn't exist...<br />

}<br />

}<br />

The Cookie class is in package javax.servlet.http.Cookie<br />

I'd like to provide to the showDocument() method of an applet the URL of a CGI<br />

program...<br />

I'd like to provide to the showDocument() method of an applet the URL of a CGI<br />

program with including a certain number of (URL-encoded) parameters to this URL<br />

(which is the same as doing a GET HTTP request).<br />

What is the maximum size I can give to this URL ?<br />

Answer: If I remember exactly it something around 240 for many servers. Maybe<br />

less, but not more!!!<br />

1000000%<br />

I read it last year in "<strong>Java</strong> Servlet Programming" from O'Reily.<br />

file:///F|/350_t/350_tips/servlets_servers.htm (2 of 8) [2002-02-27 21:19:05]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!