I'm doing some simple HTTP authentication and am getting a
java.lang.IllegalArgumentException: Illegal character(s) in message header value: Basic OGU0ZTc5ODBk(...trimmed from 76 chars...)
(...more password data...)
which I think is due to me having a really long username and password and the encoder wraps it with a \n at 76 chars. I...
Just wonder if i can deploy my java ee application in any application server for eg: glassfish, and user are able to access without typing the port number, for eg:http://abc.com
(my current application url will be http://abc.com:8080)
as from my knowledge, i might need another web server like for eg:Apache to redirect request to applica...
Hi,
this is my Main class which belongs to the server application! but it is really surprizing that without running the client application,these sentences will be written in the console.would you please help me why?thanks.
my Main class:
public class Main {
static Socket client = null;
static ServerSocket server = null;
// We can hav...
I have Java application which adds JTextFields @ runtime to JPanel. Basically user clicks a button and new JTextField is added, clicks again added again...
Each new JTextField is directly below the previous one. Obviously I run out of space pretty soon so I'm trying to use JScrollPane and thats where the hell begins, because it just do...
Hi
I am using Twitter4J API on GAE/J.
I want to use the request token when user came to my page. (called back URL). And press refresh button. I write following code for that. But When user press refresh button. I got Authentication credentials error. Please see the stacktrance. It works fine when user first time used that token.
Ho...
I've noticed that having a data access object (DAO) interface and implementation is really starting to add up:
public interface ForceDAO{
public void store(Force force);
public void delete(Long forceId);
public Force findById(Long forceId);
public List<Force> findAll();
public void deleteAll();
}
I have this same i...
On Linux & Mac, is there anyway that I can pre-cache the JVM (either in RAM, or a state of it) so taht when I start a Java program, it starts as fast as C/C++ programs?
I am willing to waste memoory to make this happen.
...
I'm writing my own Java applet that can write to /tmp on my local unix machine.
this applet is only going to run on a html page, inside my machine only. No server involved.
But when I try to open my page inside Firefox, the applet doesn't seem to work at all. I don't understand why, since all the .class, .html and .jar files are on the ...
is it possible to translate one language to another with an interpreter?
heard that quercus could translate php to java? at first, i thought it was a cheap lousy solution which could give code errors, but it seems that it´s fully possible to do so.
could you translate php to other languages, like python or ruby? c++ to java and so on?
...
Hi,
These are two classes that one of them is in my Client application and the other is in Server application.
my MainServer class :
public class MainServer {
static Socket client = null;
static ServerSocket server = null;
static BufferedReader in;
static PrintWriter out;
static String line;
public static void main() {
System.out...
Hi,
I am wokring on a linux applicaiton which should open an URL in mozilla, populate username and password in the form (url, username and password are obtained from mysql db) and submit it.
Can anyone suggest how to use mozilla API's to do it.
Regards,
Sunil.
...
Ran into another problem using SSL and Tomcat: I've configured a keystore which contains a key and a certificate (the server certificate I wish to present to the clients connecting to the site). I've done the same for the truststore (I'm going to need client authentication).
The problem I have now is that when I connect to my Tomcat ins...
I know that using generic in an assignment, a method can implicitly know the type of the return type by looking at the type of the left hand side variable.
Example from Google Collection:
List<String> l = Lists.newArrayList()
My question is why it doesn't work for a method or higher type of inference?
Example:
List<List<String>> ll...
I would like to create java client project to connect to JBossMQ server by use JNP Protocal.
but It have error "org.jboss.jms.exception.MessagingNetworkFailureException
" when it start to create connection.
Could you help me by give any suggestion or guide me to any resource? I think it has some point I'm missing but I can't recognize....
Hello,
Am trying convert date which is in local time zone to GMT, i did some thing like this
SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
String gmtStrDate = sdf.format(Calendar.getInstance().getTime());
System.out.println("GMT 1"+gmtStrDate...
Does Java allow something like good ol' C or even C# in the sense that you can define an enum with fields that grow in value automatically, and start at an optionally given value?
E.g.
In C or C#:
enum Foo { A = 10, B, C, D = 5000, E, Fish };
Yields A = 10, B = 11, C = 12, D = 5000, E = 5001, Fish = 5002.
...
which is the best way to add formated string in jframe.
Previously I was trying to add jlabel
...
I've been using IntelliJ IDEA 9.0 Community Edition for some time after years living in Eclipse. One thing seems to be hard to find in it. I'd like to create a patch on some subfolder in my project. In Eclipse it is done using right click, Team, Create Patch.
Does anybody know how to do that in IDEA?
...
It is posible for a portlet to read a request parameter of its surrounding page?
E.g. the URL of the page the portlet resides in is http://example.com/mypage?foo=bar
Is it possible to read the "foo" parameter from a portlet that is on that page?
Portlet Container is Liferay 5.2.5.
...
Hi,
I am creating a CAPTCHA input using SimpleCaptcha, and did validation of the Captcha input. I am created a captcha input with the following codes.
HTML Code:
<form action="submit_proceed.do" method="post">
<img src="captchaImg" /><input type="text" name="captcha" value=""><br />
<input type="submit" value="Submit" name="submit" />...