mike nu

Ranch Hand
+ Follow
since Mar 11, 2001
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by mike nu

I need to map my domain name to ip ort, which is where my app running on JBoss. Can anyone tell me how to do that?

What I want is when typing www.mydomain.com, the it will be automatically forward to my xxx.xxx.xx.xx:9090 address.

Thanks.
16 years ago
Hi there,

I am trying to use regular expression to validate a zip code, but could not find a good solution. This is my requirements:
1. The zip code should be 5 digits.
2. The zip code should not be "00000", "88888" or "99999".

How can I do this validation in a single reqular expression?

Thanks,
Mike
18 years ago
Hi Stan,

Thank you very much for your suggestions. Is it possible to do it using JDK 1.4?

Thanks,
Mike
18 years ago
Hi there,

I have a web application for monitoring use, and I have some other JVM nodes. There are some settings passed to the JVM node, like java -Dmyprop=someValue. In my web application, I need to retrieve these properties. Is this possible to do it? If yes, how should I do it?

Thanks,

Mike
18 years ago
Hi there,

I encountered a navigation problem, and hope I can get help from here.

My page layout is header-menu-content. This layout is defined in a layout.jsp page using <c:import> tag. In my menu.jsp page, I have a list of link, which was generated dynamically using <commandLink>. What I want to do is when clicking on the link, it will go to the back bean and update the data, and the content should be updated accordingly.

My problem is the link works only the first time when the page was loaded. After clicking one link, and then click another link, nothing happened.

Can anyone tell me how should I do it in my case?

Thanks a lot.
18 years ago
JSF
Hi there,

I am trying the do an internationalization programming using Java. My question is do you have to set the locale explicitely in my code? Will java program get the current locale automatically? Since I already set the Reginal option in the control panel (Reginal and Language Options).

Thanks in advance.

Mike
19 years ago
Now I know that the return code of Process.exitValue() = 1, means that can not find the class.

Now the actuall error is:

java.lang.NoClassDefFoundError: my/pkg/MyProgram

MyProgram is in the same package of the parent process. Is there any trick in specifying the subprocess classpath?
19 years ago
It's suppose to work cross platforms, so both Windows and Unix.
19 years ago
Hi,

I am trying to use the Runtime.exec() to call another Java program. Here is what I did:

String mycmd = "java mypackage.Myprogram";

Runtime runtime = Runtime.getRuntime();
Process process = null;
process = runtime.exec(cmdarray, null, null);

Myprogram is in the same package as the calling program. When I tried to run the calling program, I got the error said,

java.lang.NoClassDefFoundError: mypackage/Myprogram

Could anyone tell me how should I specify the classpath of Myprogram?

Thanks.

Mike
19 years ago
Hi there,

I am trying to use the Runtime.exec() to call another Java program, like this way:

Runtime runtime = Runtime.getRuntime();
Process process = null;

try{
process = runtime.exec("java mypackage.MyProgram");
}catch(Throwable t){
t.printStackTrace();
}
......

process.waitFor();
int exitValue = process.exitValue();

But MyProgram does not get executed, and the exitValue = 1

Can anyone tell me what does the exitValue = 1 mean? What's wrong with my code?

Thanks a lot.

Mike
19 years ago
Hi there,

As we know that the managed server can be started using the start script and the Node Manager. If I want to add a parameter to the JVM when I start the managed server using the Node Manager, can anyone tell me how should I do it?

Thanks,
Mike
19 years ago
Hi Brian,

Thanks for your reply. Here is my code:

DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();

factory.setNamespaceAware(true);
factory.setValidating(true);
factory.setIgnoringElementContentWhitespace(true);
factory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaLanguage", "http://www.w3.org/2001/XMLSchema");
factory.setAttribute("http://java.sun.com/xml/jaxp/properties/schemaSource", getSchemaURLs());
builder = factory.newDocumentBuilder();

The method getSchemaURLs() will return a File[] for schemas on my local machine.

Mike
Hi there,

I am trying to validate an XML document against a master schema. In my master schema document, I imported some other namespaces by using import like this:

<import namespace="http://www.xyz.com/schema/Test.xsd" schemaLocation= "Test.xsd" />

When I tried to run it, I got warning says:

src-import.0: Failed to read imported schema document 'Test.xsd'.

Does anyone had such experience and know what cause this problem?

Thanks,

Mike
Hi there,

I am trying to do the DOM in-memory validation against schema. Xerces DOM level 3 has such a feature by using normalizeDocument() method, but this is only applied to namespace-aware node. But my DOM was created using DOM level 1 method (createElement()), which is namespace-unaware.

Does anyone has such experience to do this? Any suggestions will be appreciated.

Thanks,

Mike