java

ready made parser in java

i have some user defined tag. for example data here , jssj .I have a file(not xml) which contains some data embeded in tags.I need a parser for this which will identify my tags and will extract the data in proper format. Eg <newpage> thix text </newpage> <tagD> <tagA> kk</tagA> </tagD> tags can also have some attributes as simlar...

Eclipse plugin activator class

What is the role of activator class in eclipse plugin ? ...

Can i track an IMAP mail reply ?

Hi, I am working on an IMAP client using java mail. We currently have a requirement of creating a "group by conversation" feature where user can view mails as conversation (Refer to how gmail groups mails that are replied and forwarded) I am able to retrieve mails from the server, but in the mail parts i recieve, the replied mail is "fu...

Why does calling close() on an InitialContext break JNDI for all future lookups (Glassfish)?

The second JNDI lookup in the code below fails with an exception when running as a standalone application against Glassfish (which has been configured to expose a QueueConnectionFactory and a DataSource via JNDI). However, the code works fine when the line jndiContext.close() is removed. In the real code, the call to close() is being ma...

Running an applet in Linux?

I did a voice recorder applet and deployed in Apache Tomcat server. In Windows I tested the URL (http://localhost/Sound.html) in Firefox and IE; it's working fine. But the same applet is not loaded in Safari browser in Linux. I have signed the applet too. What might I be doing wrong? ...

Implementing RESTful web service

Hello, I have a requirement to create RESTful web service. I have narrowed down on 'Restlet' for the web service implementation. Can someone tell me the clear pro's and con's of using Restlet and if there are any better alternatives. thanks in advance ...

What is the best way to secure a shopping cart within a JAVA/Tomcat website?

I am looking for the best-practice solution regarding how to secure a "shopping-cart" part of an otherwise (relatively) unsecure website. The existing setup in the site uses an unsecure-cookie, and only secures (via SSL) the transaction of credentials. The rest of the site is accessed via HTTP and thus, data is transmitted unsecurely. ...

What are the benefits of Scala?

I am a Java developer and I want to know how I can use Scala in my Java programs? ...

What are the uses of getter/setters in Java?

I have seen member variables given a private modifier and then using getter/setter methods just to set and get the values of the variable (in the name of standardization). Why not then make the variable public itself (Other than cases like spring framework which depends on getter/setters for IOC etc). It serves the purpose. In C# I hav...

calling and invoking w.r.t. to any computer language..

Is there any difference between a calling of a function and invoking of a function? ...

How do I define dynamic and just-in-time bindings with Guice?

I am trying to use Guice for a test framework based on TestNG. This frameworks analyzes the test class for dependencies and provides them eliminating the need to build them in tests. Guice is all about injection and I think is a good fit for the framework. But the question is how do I define bindings after I have created the injector? T...

Log4j: Events appear in the wrong logfile

Hi there! To be able to log and trace some events I've added a LoggingHandler class to my java project. Inside this class I'm using two different log4j logger instances - one for logging an event and one for tracing an event into different files. The initialization block of the class looks like this: public void initialize() { System....

Best XML handling class in Java

Which is the best class in Java to work with XML documents? ...

JMenuItem setMinimumSize doesn't work

I try to set a minimum width for my menu items, but it doesn't seem to work. Here is my function, which creates the items: private JMenuItem newItem(String text, String iconPath) { JMenuItem myMenuItem; if (iconPath == null || iconPath.isEmpty()) { myMenuItem = new JMenuItem(text); } else { ImageIcon icon = new ImageIcon(...

Configuring Spring based servlet with sysadmin defined properties

I have a web application that's based on Spring and the application contexts, applicationContext.xml and myServlet-servlet.xml contain settings that should be configurable by the sysadmin in deployment. What's the best way to enable changing of settings like [database server details, remote webservice endpoints, etc] without requiring e...

How will the client of a Web Service consuming a DoTNET vs JAVA wsdl differ?

How will the client of a Web Service consuming a DoTNET vs JAVA wsdl differ? Also, is it correct in stating that the dot NET WS invokes the constructor of the WS on each operation invocation whereas a JAVA WS has its constructor called only once when the application server starts up! ...

Is Perforce worth it?

A colleague of mine has become excited about the possibilities with PerForce (we basically need an abillity to logistically group patches and changes, and having the SCM support this natively would be very nice). We currently use CVS and are open to all posibillities. We are only few developers who use plain Eclipse and run builds usin...

Changing Database schemas & unit tests

Hello all,      Before we start I know a fair few people consider tests that hit the database not "unit tests". Maybe "integration tests" would be a better name. Either way developer tests that hit the database.      To enable unit-testing I have a developer local database which I clear and the populate with a know set of data at the st...

How to change the list in a SelectOneMenu, if the value is changed in another?

Hey, I want to change the SelectItem[] array in the second SelectOneMenu, if the value is changed in the first one. Is that possible? Thanks in advance! ...

Java Swing Free Memory component needed

I need Java Swing Free Memory component (similar to that in Eclipse IDE). Preferably free (and open source). Thank you in advance. ...