What is the best way to represent in java a "choice" namespace tag?
ie.
<xs:complexType name="MyType">
<xs:sequence>
<!-- common elements here -->
<xs:element type="xs:string" name="name" ... />
</xs:sequence>
<xs:choice>
<xs:element name="stringValue" type="xs:string"></xs:element>
<xs:element name="intValue" type...
I'm now working with code that looks like this
public String getName(User user) {
user.setSth(...);
return user.getName();
}
I think it's bad practice to change objects passed as parameters. Is there a tool that detects that kind of code? I looked at findbugs, pmd and checkstyle, but could not find any check for this.
P.S....
Hi,
is there a way to point a maven target (with classess) path to jBoss instead of building .ear and deploying it everytime I edit some sources?
Thanks in advance,
Etam.
...
Check out the below program.
public class test {
/**
* @param args
*/
public static void main(String[] args) {
try {
String data = null;
// TODO Auto-generated method stub
BufferedReader br = new BufferedReader(new FileReader(new File("D:/sample.txt")));
while((data=br.readLine())!= null){
...
Hi.
I have Web Service deployed to JBoss 4.2.2.GA environment and need to consume its methods from .NET application on WindowsCE 5.X. The problem is that I'm not able to consume service's methods when security is turned on (@SecurityDomain("java:/jaas/JBossWS") on class and @RolesAllowed(value={"friend"}) on method declaration. I tried ...
This is a follow up to my earlier question.
Tomcat 5.0.28 had a bug where the Servlet's destroy() method was not being invoked by the container on a shutdown. This is fixed in Tomcat 5.0.30, but if the Servlet's destroy() method had a System.exit(), it would result in the Tomcat windows service throwing the Error 1053 and refusing to sh...
How do I avoid floating point errors in financial calculations performed with Colt matrix libraries?
...
I'm building a little app using Java and Swing in NetBeans. Using NetBeans design window, I created a JFrame with a JPanel inside.
Now I want to dynamically add some jTextFields to the JPanel.
I wrote something like that:
Vector textFieldsVector = new Vector();
JTextField tf;
int i = 0;
while (i < 3) {
tf = new JTextField();
te...
I have an action class that expects a FormFile from a DynaActionForm. Typically in JMock, I'll just add request params to the struts mock, which will in turn populate the DynaActionForm.
Obviously, the set request param is for strings only. So I'm unsure how to get or set the mock to use a multi-part request such that I can add the Fo...
I'm uploading a file to the server. The file upload HTML form has 2 fields:
File name - A HTML text box where the user can give a name in any language.
File upload - A HTMl 'file' where user can specify a file from disk to upload.
When the form is submitted, the file contents are received properly. However, when the file name (point ...
I'm using spring and acegi in a webapp that's deployed in tomcat 5.5.26.
I want to see if the user is logged in on the 404 page, so that we can show their name if they're logged in, and a login link otherwise.
I have the HttpSessionContextIntegrationFilter, in the filters on the REQUEST dispatcher. I also have it in the ERROR dispatche...
I've an issue with a project I try to deliver using the one-jar packager to simplify the deployment process.
Without the packaging, everything works fine and the logging configuration is perfectly loaded, but within the packaging, only part of the configuration is appied.
So, here is the logging.properties I use:
handlers= java.util.lo...
Hiya - quick one - is there any harm / value in subclassing JComponent as compared to JPanel ?
To me they pretty much look to be the same thing if I'm doing my own drawing & the object won't have any children, however there seems to be a pref for subclassing JPanel over JComponent - just looking for opinions on why this might be ...
T...
I am an experienced Java developer, used to all the nice features that Eclipse provides for Java development (in particular Ctrl+T to open type, Ctrl+Click or F3 to open referenced declaration, outline, ...). I really like this degree of comfort.
Now I have a project, where I need to do some changes in the existing database (stored proc...
For this university assignment that I have been assigned.
I have to develop an application for use on a PDA which is running J2ME and Apache Derby in embedded mode.
I would like to both import/export an image to the database. How would I do this? Also would storing the image as a blob be suitable?
Thanks in advanced.
...
I've been building web sites off an on for about 10 years. 2 years ago I started using ASP.Net. I'm working on 2 projects right now, one using ASP.Net MVC and the other using Java / JSF / Spring / Hibernate.
I've also used other frameworks (cgi/perl, php, ASP, jsp, jsf).
What do you think is the most productive programming environment...
Obeying NDA restrictions I have to be vague.
I've been tasked to evaluate the feasibility of forcing a .dm file from my client's system to a cellular device. So far I know I can send a smil payload with a txt & gif|jpg payload but not a .dm file.
Inside of the DRM wrapper there is a header prefix before the payload starts.
Content...
Hi all.
I have a shutdown hook in my application (created using Runtime.getRuntime().addShutdownHook). However if I launch the application from within Eclipse, when it is shut-down the shutdown hook doesn't execute.
I think this is because Eclipse sends the equivalent of a force-kill signal to the process, which doesn't cause the shut...
My co-workers and I are having a problem using Firefox 3.0.6 to access a Java 1.6.0___11 web application we're developing. Everything works fine anywhere from 1-30 minutes into the session...but eventually, the connection fails and the following error appears:
Secure Connection Failed
An error occurred during a connection to 10.x.x.x...
I am currently working on a mantenance project that is written in Java. We are currently working to clean up the code some and try to provide a little more organization to the project overall.
The list of libraries that are included in the build have grown long, and honestly no one remains that knows/remembers what each library is used ...