Servlets & Servers
applet only on the Linux? Does anyone give me a suggestion?
Answer: Take a look at your port number. If it is under 1024, it is a protected port
number and non privileged users cannot touch it on Linux or any other
Unix system.
Where Can I find a server to try my servlets?
I am creating a client/server application. I don t run my own server
and my ISP won t allow me to install and run applications from their
server.
Does anyone know of anywhere (preferably FREE) that will allow
me to use server side Java? Any help is GREATLY appreciated.
Answer:
http://www.mycgiserver.com/
Hi, I am using servlets. I need to store an object NOT a string in a cookie. Is that
possible? The helpfile says BASE64 encoding is suggested for use with binary
values. How can I do that???
Answer: You could serialize the object into a ByteArrayOutputStream and then
Base64 encode the resulting byte []. Keep in mind the size limitations of a cookie and
the overhead of transporting it back and forth between the browser and the server.
Limitations are:
* at most 300 cookies
* at most 4096 bytes per cookie (as measured by the characters that comprise
the cookie non terminal in the syntax description of the Set Cookie2 header, and as
received in the Set Cookie2 header)
* at most 20 cookies per unique host or domain name
For more details please refer to RFC 2965.
Q: Hi, I want to send a POST request, but I can t find such functionality in the
servlet API, how can I do this? Must I implement this with a socket connection to port
80?
Answer: A servlet can do anything a standalone Java application can do. It doesn t
need anything beyond what the java.net package already provides. You can use an
httpURLConnection to POST to a server program like a servlet or CGI script:
// Create a string with the parms you want to post and convert it to a byte array. You
may need to
// pass the values through java.net.URLEncoder.encodeURL()
// if they have embedded blanks or special characters
String parms = "a=10" + "&b=20" + "&c=30";
byte[] bytes = parms.getBytes();
// Create a URL pointing to the servlet or CGI script and open an HttpURLConnection
on that URL
URL url = new URL(TARGET_URL);
HttpURLConnection con = (HttpURLConnection) url.openConnection();
// Indicate that you will be doing input and output, that the method is POST, and that
file:///F|/a_jsite/350_tips/servlets_servers.htm (3 of 7) [2001 07 08 11:24:58]
footer
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved