I want to write a web proxy for exercise, and this is the code I have so far:
// returns a map that contains the port and the host
def parseHostAndPort(String data) {
def objMap // this has host and port as keys
data.eachLine { line ->
if(line =~ /^(?i)get|put|post|head|trace|delete/) {
println line
...
I'm making a App to send SMS trough VOIP providers from betamax...
To send I just need to execute the url
https://www.12voip.com/myaccount/sendsms.php?username=w&password=x&from=y&to=z&text=some%20text
My app already creates the URL, but i cant understand how to execute...i think i have to make an http request....bu...
I create fullscreen interactive demos in Flash and have recently been looking to migrate to a new language. My Flash demos are basically software prototypes and operate in a projector EXE, outside of the browser. I want to leave Flash for a variety of reasons, including:
Poor quality control in the Flash player
Hardware acceleration is...
I am working on a mutual exclusion assignment, but when I started I noticed my application's thread ID's start at 9. It doesn't change when I compile and execute it again. Is there some problem I'm missing, or can Java Thread IDs start at an arbitrary number? This question is related.
For those interested, here is a class from Herlih...
Has anyone had any success attaching a rich:toggleControl component to a radio button component (h:selectOneRadio) or alternatively any of its children select items (in this case s:enumItem).
Basic code example:
<h:selectOneRadio value="#{backingValue}">
<s:enumItem enumValue="VAL_1" itemLabel="Value One" />
<s:enumItem enumValue...
I'd like some kind of string comparison function that preserves natural sort order1. Is there anything like this built into Java? I can't find anything in the String class, and the Comparator class only knows of two implementations.
I can roll my own (it's not a very hard problem), but I'd rather not re-invent the wheel if I don't hav...
What I want to accomplish is a tool that filters my files replacing the occurrences of strings in this format ${some.property} with a value got from a properties file (just like Maven's or Ant's file filtering feature).
My first approach was to use Ant API (copy-task) or Maven Filtering component but both include many unnecessary depend...
I would like to find out the 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
...
Hi,
I am new at Hibernate, and I have a question regarding HQL Lejt join.
I try to left join 2 tables, patient and provider, and keep getting "Path expected for join! " erroron the second table. Appreciate it if anybody can help on this issue!
Here is the mapping of the 2 tables/classes:
patient.hbm.xmL:
<?xml version="1.0"?>
<!DOC...
I’m currently monitoring a Java application with jconsole. The memory tab let you choose between:
Heap Memory Usage
Non-Heap Memory Usage
Memory Pool “Eden Space”
Memory Pool “Survivor Space”
Memory Pool “Tenured Gen”
Memory Pool “Code Cache”
Memory Pool “Perm Gen”
What is the different between them ?
...
The question says it all; what are some good introductory resources for getting a good overview of J2EE framework(preferably ones with examples)?
...
Java is not allowing inheritance from multiple classes (still it allows inheritance from multiple interfaces.), I know it is very much inline with classic diamond problem. But my questions is why java is not allowing multiple inheritance like C++ when there is no ambiguity (and hence no chances of diamond problem) while inheriting from m...
I have a hibernate object that gets detached and transferred to a thick java swing client using EJBs. The object is then modified in some way and returned to the server where the server then updates the modified object to the database. Everything works well for properties that change, but I am having a problem on how to delete a many-to-...
Hi all,
I've been tasked with converting an application which was developed by myself in the Waffle Framework using PicoContainer as a DI mechanism into our new "stack" which is to use Struts2 as a framework with Guice as the DI mechanism. Does anyone out there have any helpful pointers as to how to do this with minimal pain and at the...
Hi,
I'm running into a problem that I think is related to updating JAXB to the latest version. I'm running a marshal command that returns:
??? Java exception occurred:
javax.xml.bind.MarshalException
- with linked exception:
[java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.lang.String]
at com.sun.xml....
I've seen this done in TextMate and I was wondering if there's a way to do it in IDEA.
Say I have the following code:
leaseLabel = "Lease";
leaseLabelPlural = "Leases";
portfolioLabel = "Portfolio";
portfolioLabelPlural = "Portfolios";
buildingLabel = "Building";
What is the best way to append '+ "foo"' to every line? Column mod...
Hi there,
I have multiple drop down menus with my JSF/ICEFaces application that update each others so depending on the selection of one the contents of others update.
The problem is that the menu is sending the wrong value. It seems it sends the value before instead of the current one! not sure why!
Any ideas?
Thanks,
Tam
<td>
...
What are the primary reasons for using the J2EE (EJB's) over just a simple servlet implementation?
I am working on developing a new project that will primarily be a web service that must be very fast and scalable.
Sorry for any confusion, Although I am experienced in Java, I am very new to the Java Web world, and may not be asking thi...
How do I pull a spring bean manually? I have a rather large web application, and in a given service, a transient object requires access to a bean that is machine specific (database connection info.) Since the application runs in a cluster, this transient object (which can bounce between servers) always needs to grab the correct connectio...
I wrote a very simple toy program to complete the execution of a task inside a thread as per the timing requirements specified by a user. The code and the sample output is below. What happens is that everytime you run the code, the task completion times would be within a + delta range of the time specified by the user. For e.g if the use...