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!!!
[code]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();
}
}[/code]
[code]
<?xml version="1.0" encoding="utf-8"?> Jnlp Testing YONG MOOK KIM Testing Testing[/code]
web.xml do tomcat
jnlp application/x-java-jnlp-fileTESTE: URL http://localhost:8080/Test.jnlp