JSPs -> eigene Objekte einbinden

Tim Oliver Wagner <[email protected]>
Newsgroups gmane.linux.suse.programming
Message-ID <[email protected]>
Hallo,
ich möchte in ein JSP ein eigen erstelltes Objekt einbinden. Ein einfaches 
(eigentlich unnötige Klasse) Beispiel für mein Problem ist:

class MyClass {

    public MyClass() {
	count = 0;
    }

    public String calc(int a, int b) {
	return "" + (a+b);
    }
}

Jetzt möchte ich in einer JSP dieses Objekt erzeugen und dann _mit_ dem Objekt 
2+4 rechnen und dieses so ausgeben:

******************************************************
Das Ergebnis: 6
Jippie hat gefunzt! :-)
******************************************************

Wenn es nicht zu viel verlangt ist würde ich mich über den Quellcode der JSP 
sehr freuen.

Ich hoffe es kann mir jemand bei meinen Problemen helfen.

tia

Oli
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQBDnZ90nLZw+P+YldoRAtxIAJ0SgsLKy6onX5k9OK4kMCWdqfEYwQCgmrXa
J/m0hxRcKWvLTj5RBoBXWrY=
=RWgj
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.