Bom dia Galera!
Estou tentando executar um exemplo de Java web Start, mas já fiz tudo do tutorial..mas dá erro 404.
Eu criei o projeto, a classe principal, o arquivo xml do jnlp , criei o .jar abri a pasta do tomcat e joguei dentro do ROOT o .xml e o .jar e na pasta conf o arquivo web.xml já estava configurado no mime-mapping pro jnlp.
Se alguem puder me ajudar agradeço, pois parece ser tão simples.Obrigada!!!
package com.mkyong;
import java.awt.*;
import javax.swing.*;
import java.net.*;
import javax.jnlp.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class TestJnlp {
static BasicService basicService = null;
public static void main(String args[]) {
JFrame frame = new JFrame("Mkyong Jnlp UnOfficial Guide");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel label = new JLabel();
Container content = frame.getContentPane();
content.add(label, BorderLayout.CENTER);
String message = "Jnln Hello Word";
label.setText(message);
try {
basicService = (BasicService)
ServiceManager.lookup("javax.jnlp.BasicService");
} catch (UnavailableServiceException e) {
System.err.println("Lookup failed: " + e);
}
JButton button = new JButton("http://www.mkyong.com");
ActionListener listener = new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) {
try {
URL url = new URL(actionEvent.getActionCommand());
basicService.showDocument(url);
} catch (MalformedURLException ignored) {
}
}
};
button.addActionListener(listener);
content.add(button, BorderLayout.SOUTH);
frame.pack();
frame.show();
}
}
<?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://localhost:8080/" href="Test.jnlp">
<information>
<title>Jnlp Testing</title>
<vendor>YONG MOOK KIM</vendor>
<homepage href="http://localhost:8080/" />
<description>Testing Testing</description>
</information>
<security>
<all-permissions/>
</security>
<resources>
<j2se version="1.6+" />
<jar href="TestJnlp.jar" />
</resources>
<application-desc main-class="com.mkyong.TestJnlp" />
</jnlp>
web.xml do tomcat
TESTE: URL http://localhost:8080/Test.jnlp