Hello,

I'm new in java and must make a dummy server client connection (webserver) that check if the client has the actual software (actual version) and send links (in .txt or something else, if any update available). I'd like to make a program as simple as possible.

I am using Eclipse Java EE IDE and Tomcat v6.0, and xml for the software lists.
Now, I can upload the client's list into server and this list is saved here:
C:\Users\Kemplu\Desktop\MTK\.metadata\.plugins\org .eclipse.wst.server.core\tmp0\wtpwebapps\Project\client.xml

I'd like now to compare that list with the server's list (is that ok?), but I don't know what I should do here, because I still have problem with importing java code into jsp.

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Iterator"%>
<%@ page import="java.io.File"%>
<%@ page import="java.lang.Object"%>
<%@ page import="junit.framework.Assert"%>
<%@ page import="org.custommonkey.xmlunit.XMLUnit"%>
<%@ page import="org.custommonkey.xmlunit.DetailedDiff"%>
<%@ page import="mtk.MyXMLTestCase"%> 

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Check for Updates</title>
</head>
<%
    String myControlXML = "actual.xml";
    String myTestXML = "client.xml";

%>

<body>
Hulaa
<input type="button" value="Download" onclick="window.open('Link.txt')"></input>
</body>
</html>

Anyone has any suggestion?
I really appreciate any help, and sorry for my poor english.

Best regards,
Kem

Recommended Answers

All 2 Replies

if you really want to do this in a serious way: don't put java code in your jsp.
learn how to write/use servlets, and let them deal with your business logic.
off course, there are plenty other ways (frameworks) you could learn, and that would propably be a lot better, but IMHO learning how to deal with servlets will be easier to learn and a good basis to have if you want to study further.

well ... to compare versions .. I assume you know how to use the .equals method? you can store your version as a Double, or a String, and then just compare them by the normal version1.equals(version2);

if you need to know which version is the biggest, you might want to go for a compare method.

Hello,

thank you for your fast reply.
I'll try to use a servlet.

Kem

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.