1
голосов
1ответов
796 просмотров

Using Trinidad in JSF environment

I'm facing an unpleasant issue with an JSF based application of mine. Right now i have several xhtml-Files which include / make use the following taglibs: xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:t="http://my...

1
голосов
4ответов
1817 просмотров

Data structure for search engine in JAVA?

I m MCS 2nd year student.I m doing a project in Java in which I have different images. For storing description of say IMAGE-1, I have ArrayList named IMAGE-1, similarly for IMAGE-2 ArrayList IMAGE-2 n so on..... Now I need to develop a search engine, in which i need to find a all image's whose ...

1
голосов
2ответов
6237 просмотров

How to create EJB 2.1 beans in Eclipse 3.5

I am not able to create EJB 2.1 beans using a wizard in the latest version of Eclipse. I only see options to create EJB 3.0 beans. I selected 2.1 as the 'EJB Module Version' while creating the "EJB Project". But now when I want to create a session bean, I don't see any option to create a 2.1 bea...

1
голосов
1ответов
1472 просмотров

Jaxb Support for Netbeans 6.5

I have not been working on java for a long time, and now I am back; so I am sort of noob, particularly with Netbeans. I am using Netbeans 6.5 on Ubuntu. I want to use the Jaxb support to generate Jaxb binding from an XML schema, as documented at http://wiki.netbeans.org/NB6JAXBSample1 . But the d...

5
голосов
4ответов
8194 просмотров

Learning resources and tutorials for using the Java Batik Library

I am using the Batik library, which is very useful to display SVG graphics in Java. For the basic use case of displaying and rendering an SVG document is quite simple to use. However, I want to do some other advanced graphic manipulation and I am struggling as I don't find any good resource tha...

1
голосов
1ответов
514 просмотров

Not able to read contact's all values

I have made an application of reading all contacts and its values from android address book, but i am not able to read all the vlaues of contact. Currently i am getting only its name and mobile number. How can i get its all phone numbers,all eamil values and address values ? Thanks in advance...

9
голосов
3ответов
13201 просмотров

What are the c# equivalents of of Java's getClass(), isAssignableFrom(), etc.?

I am translating from Java to C# and have code similar to: Class<?> refClass = refChildNode.getClass(); Class<?> testClass = testChildNode.getClass(); if (!refClass.equals(testClass)) { .... } and elsewhere use Class.isAssignableFrom(Class c)... and similar methods Is there a tabl...

2
голосов
3ответов
1955 просмотров

Grid Computing and Java

I couldn't seem to find a similar question to this. I am currently looking at the best solution solving a grid computing problem. The setup: I have a server/client situation where there clients [typically dumb of most logic] and recieve instructions from the server Have an authorization req...

1
голосов
2ответов
179 просмотров

How to report TODOs and other tags with CruiseControl?

In one project the use of //TODO, //XXX and //FIXME tags is very common. The problem is that nobody has an overview of all TODO lines - only Eclipse shows all the tasks in one view. I would like to display all TODOs with filenames in our daily build report created by CruiseControl. How can thi...

0
голосов
3ответов
237 просмотров

Java packaging issue

I have an application that I've developed. Currently it is deployed with all its config files (including log4j.properties, as used by some external libs I use) in the same dir as my application. So, I have a bin dir, containing my app.jar, plus a few properties files, plus a lib dir with all my ...

14
голосов
6ответов
39001 просмотров

Format number in Struts 2 <property></property> tag

I would like to format number displayed by &lt;s:property value="summary.total"/&gt; tag in Struts 2. There is a double value. How can I do that? Should I use OGNL? Or maybe I must use &lt;s:text/&gt; tag and define my format in resuource file?

1
голосов
3ответов
3102 просмотров

Static vs Instance members in Stateless EJBs

I have a stateless session bean which needs access to a factory class. Is it best to declare this factory class as a static or instance member in the SLSB? Am I correct in saying that, as SLSBs are reused, only one instance of the factory will be created per bean (when going with the instance mem...

1
голосов
4ответов
3244 просмотров

A rule-based system in Java and C# environments

I need to build a "rule-based" system that can be run and developed in both C# and Java (for a chemistry application). The system needs to be able to get computed properties of objects (through existing libraries) and make decisions on those values. I am not sure what the system will look like bu...

3
голосов
2ответов
2041 просмотров

extracting a number from a string in Java

I have a string with a number inside and I want to retrieve that number. for example if I have a string "bla bla 45 bla bla" I want to get the number 45. I have searched a bit and found out that this code should make the work Matcher matcher = Pattern.compile("\d+").matcher("bla bla 45 bla bla")...

2
голосов
2ответов
10901 просмотров

JPA+Hibernate: Change of createNativeQuery() + getResultList() behaviour?

What I am going to describe is a bit of legacy code. So there is a lot of stuff I cannot touch/change. This pseudo-code runs well the in Jboss 4.0.3, big_messy_sql = "select t1.f1 as somealias, t2.f2 as somehthingelse from obj1 t1, obj2 t2 where crazy_conditions...."; Query query = entityMan...

0
голосов
1ответов
3493 просмотров

Hibernate Inheritance Mapping and Attribute Override

The system I'm working on has a domain object named Order which inherits from AbstractPersistentObject. Now I need to add another domain object named ExternalOrder which has some of the properties of Order but not all. I would like these two objects to be treated polimorphically in certain places...

7
голосов
2ответов
6492 просмотров

Java - Eclipse: Externalize Strings?

It looks like the "Externalize Strings" feature takes everything, makes a Messages class, and a .txt file in which to store the Strings themselves. This is interesting, but I've got another way to store constants: public final class Constants { //for parsing commands public static final ...

7
голосов
9ответов
7057 просмотров

XStream or Simple

I need to decide on which one to use. My case is pretty simple. I need to convert a simple POJO/Bean to XML, and then back. Nothing special. One thing I am looking for is it should include the parent properties as well. Best would be if it can work on super type, which can be just a marker inte...

1
голосов
3ответов
9902 просмотров

openfire smack sending packet 404 error means?

when sending packet to openfire using Smack, i get error remote-server-not-found(404) . Can anyone please explain what does thet error means? it mean fail to connect to server or the packet has problem? PacketFilter responseFilter = new PacketIDFilter(packet.getPacketID()); Pac...

2
голосов
4ответов
16282 просмотров

How do you add GUI to this java program?

I know only basic stuff in java. And I need to create a GUI for this type of program. It shows your credit card info. It has some other classes and makes use of the rmiregistry. This works fine in console but I need to show it in a GUI. The first thing that promps here is to enter your name (java...

3
голосов
2ответов
12266 просмотров

Rendering vector shapes in Java

I have a series of shapes (Approx. 50), that each have 5 points, and a color (with alpha transparency). I want to render these shapes onto a pixel grid. I program as an amateur, so I have no idea how I should go about doing this. Can someone give me a starting point, or some pseudo-code? Thank...

0
голосов
2ответов
1020 просмотров

Configuring Netbeans with JNotify

I'm trying to use the JNotify library along with netbeans, however I don't know the proper way to configure it. Everything I try, the lines involving jnotify (eg. import net.contentobjects.jnotify.*) are underlined in red. Google seems to show nothing helpful regarding netbeans with jnotify, alth...

0
голосов
5ответов
731 просмотров

Help needed to write a comparator for my job interview code sample

I need help to write a comparator :- I want this output :- Martin Joseph Male 4/2/1979 Green Ramya Patil Female 5/4/2009 Red Don kelly Male 5/6/1986 Yellow Van Shinde female 3/4/1984 Green But i am getting the following output :- Output 1: Van Shinde female 3/4/1984 Green ...

24
голосов
5ответов
61452 просмотров

Does JUnit support properties files for tests?

I have JUnit tests that need to run in various different staging environments. Each of the environments have different login credentials or other aspects that are specific to that environment. My plan is to pass an environment variable into the VM to indicate which environment to use. Then use th...

0
голосов
1ответов
258 просмотров

Strange behavior of RandomAccessFile object

Here is a snippet of code that is behaving strange. private void saveToFile() throws IOException { JFileChooser fileChooser = new JFileChooser(); File name = null; int returnVal = fileChooser.showSaveDialog(fileChooser); //Sets the variable name to the file the user sel...

1
голосов
1ответов
471 просмотров

Need an input dialog to populate with text

I am a student at ISU. I was working on a homework assignment where I wanted to get text that was selected (highlighted) in a TextArea to appear in a JOptionPane dialog. I tried many of the methods for JOptionPane, but I could not get any of them to place the text the user selected in the input f...

26
голосов
9ответов
64192 просмотров

Setting a parameter as a list for an IN expression

Whenever I try to set a list as a parameter for use in an IN expression I get an Illegal argument exception. Various posts on the internet seem to indicate that this is possible, but it's certainly not working for me. I'm using Glassfish V2.1 with Toplink. Has anyone else been able to get this...

4
голосов
3ответов
1405 просмотров

Why is java.util.Date's setTime() method not deprecated?

All the other mutators got deprecated back in JDK 1.1, so why was setTime() left as is? Surely java.util.Calendar - the correct way to manipulate dates - can create new instances of java.util.Date as needed using the java.util.Date(long) constructor?

6
голосов
1ответов
3735 просмотров

JavaMail API, Gmail-Auth and setFrom

for this app i'm following this example: http://pipoltek.blogspot.com/2008/02/sending-mail-using-gmail-smtp-server.html I can send emails, it looks good.....but i want to modify the sender email using this: MimeMessage msg = new MimeMessage(mailSession); msg.setFrom(new InternetAddress("baba-j...

14
голосов
3ответов
10050 просмотров

Defaults for Eclipse run configurations

I'm writing a Java library with a lot of jni code. Pretty much every test case needs to load my jni dll, and I have a lot of test cases. In order to run the test cases out of Eclipse's Junit launcher, I have to create a run/debug configuration and edit the VM arguments and environment variables. ...