In my web.xml I've defined a user-data-constraint for some resources:
<security-constraint>
<web-resource-collection>
<web-resource-name>Personal Area</web-resource-name>
<url-pattern>/personal/*</url-pattern>
</web-resource-collection>
<web-resource-collection>
<web-resource-name>User Area</web-resource-name>
<url-pattern>/u...
I'm currently using a hosting service that offers users access to MySQL databases, but does not offer a Tomcat server or any other way to perform server side processing. So a three tier design is out.
Being a novice in Java and Javascript I was planning on using them on this project to gain more experience. I know nothing about PHP, wh...
I am not sure where to begin with this error message. I have tried googling, but I was never able to nail down a solid reason why I am getting this message.
I have looked at various jsp tutorials and they all seem relatively simple so I don't see the problem.
I am writing another plugin for JetBrains TeamCity and have been passing va...
The Java NIO Socket Framework supposedly hides the dirty details of non-blocking IO from developers, allowing them to build highly scalable applications, which can handle over 10000 incoming and outgoing sockets using only one thread.
Are non blocking IOs still a pain with the typical version of Java 2 SE/EE?
Is this framework still ne...
Optimistic locking using the version attribute for an entity works fine and is easy to implement:
<version property="VERSION" type="int" column="EX_VERSION" />
The entity has a property of the following type:
private int VERSION;
public int getVERSION() { return VERSION; }
public void setVERSION(int VERSION) { this.VERSION = VERSION;...
I would like to find out how to get IP address of the client, that is visiting my web pages.
Content of JSP page:
<%
out.print( request.getRemoteAddr() + "<br>");
out.print( request.getRemoteHost() );
%>
Output:
0:0:0:0:0:0:0:1
0:0:0:0:0:0:0:1
...
I have a need to set a collection of name/value pairs inside my application - representing effectively a many-to-many map (i.e. keys can have multiple values and vice-versa), so Hashtable and Hashmap don't really work for me.
I'd like to be able to declare these via Spring in a format similar to <props>, but of course that won't work di...
I'm migrating a couple of projects from an ant build to a maven one. The build server is , and will remain, Hudson.
I've been having trouble recording code coverage in hudson with cobertura due to the tests run and recorded twice problem.
The project is multi-module and it would be nice, although not required, to have an aggregated out...
I'm solving algorithmical problems, and i want to write custom functions and predicates that can be applied to collections. Recently, i started using Google Collections and it is just wonderful for this task.
I want to use BigInteger and BigDecimal same way, as i would use any other numbers. Without pondering how it should be done, i d...
Hello,
what I would like to achieve is to sort a colletion of objects by a string value. However in a locale dependant way using a collator. Due to performance reasons I do not want to use the Collator compare() method (as below in the code) rather the CollationKey class, as the java API states the using a CollationKey is much faster. ...
I have a working prototype of a Java application that is using Apache Commons Net FTPSClient to connect to a FileZilla server over SSL (port 990 for what it is worth).
No problem. The problem is, the application is currently maintaining the credentials of the FTP user in the form of a username and password.
Is it possible to perform au...
When I am running my code, it always stops at the for loop and skips it.
public void assignCell()
{
Prisoner prisoner = prisoners.get(id-1);
for(Cell cell : cells)
if(cell.isAvailable())
{
cell.allocate(prisoner);
String bunk = null;
if(cell.isEven())
{
bunk = "top bunk of cell...
I am using
org.apache.http.impl.client.DefaultHttpClient
to login to websites through java.
How can I get the html source of the webpage after having logged in to a website.
...
I want to login to the ORKUT through a java program. I am using the following program to do it. I have copied it from some website. Now I want to use it for ORKUT. But I have some questions regarding some lines.
Q1. Where to give the URL of the login page (I think in the new HTTPGET("....."))? Am I right or not?
Q2. What argument to pa...
My users are going to be uploading files with a .EXP extension. In ColdFusion on Windows 2003 I'm using getPageContext().getServletContext().getMimeType() to make sure that the file that they upload is of the correct mime-type, which will be text/plain. The issue I'm having is that no matter where I register the mime-type on the server, ...
Is there any trick to calling JFrame.setGlassPane(Component) more than once? In the code below, I first call it to create a red box in the glass pane. That works fine. Then, in a mouse click handler, I call it again to create a blue box in a new glass pane. This doesn't work. The original red glass pane disappears, but the blue glas...
I am trying to make a color change on a canvas in java to respresent how strong or weak the values respresented by color are relative to each other.
The rgb colors have to be the same color just different shades, like white to grey to black and every shade of grey in between. How can I change the rgb values considering that the values I...
I'd like to configure a process that looks something like:
Method Call -> Dynamic Proxy Gateway -> Channel -> Service Activator -> Method Call
^---------- Transformer <- Channel <- [return value]
Effectively, I'd like to somehow access the hidden channel Spring Integration creates and transform the return mess...
I have a zip file containing a number of jar files that is being downloaded from an HTTPS site.
The jars form a command line driven, server side application. I have a Java written application installer that does some checks to verify that the jars are signed using a particular trusted digital certificate and have not been modified durin...
I have a problem at school. I'm new to programing and I need some help. Please complete the dotted line:
import java.net.*;
import java.io.*
public class Test{
public static void main (String arg[]}
int x=0;
try {
ServerSocket s=new ServerSocket ( k );
s.close();
}
catch (..........................) ...